mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8263358: Update java.lang to use instanceof pattern variable
Reviewed-by: iris, chegar, mchung, dfuchs
This commit is contained in:
parent
ae9af57bf6
commit
329697b02e
18 changed files with 63 additions and 112 deletions
|
@ -302,8 +302,7 @@ class InvokerBytecodeGenerator {
|
|||
}
|
||||
|
||||
private static String debugString(Object arg) {
|
||||
if (arg instanceof MethodHandle) {
|
||||
MethodHandle mh = (MethodHandle) arg;
|
||||
if (arg instanceof MethodHandle mh) {
|
||||
MemberName member = mh.internalMemberName();
|
||||
if (member != null)
|
||||
return member.toString();
|
||||
|
@ -627,8 +626,7 @@ class InvokerBytecodeGenerator {
|
|||
|
||||
private void emitReferenceCast(Class<?> cls, Object arg) {
|
||||
Name writeBack = null; // local to write back result
|
||||
if (arg instanceof Name) {
|
||||
Name n = (Name) arg;
|
||||
if (arg instanceof Name n) {
|
||||
if (lambdaForm.useCount(n) > 1) {
|
||||
// This guy gets used more than once.
|
||||
writeBack = n;
|
||||
|
@ -1679,8 +1677,7 @@ class InvokerBytecodeGenerator {
|
|||
|
||||
private void emitPushArgument(Class<?> ptype, Object arg) {
|
||||
BasicType bptype = basicType(ptype);
|
||||
if (arg instanceof Name) {
|
||||
Name n = (Name) arg;
|
||||
if (arg instanceof Name n) {
|
||||
emitLoadInsn(n.type, n.index());
|
||||
emitImplicitConversion(n.type, ptype, n);
|
||||
} else if (arg == null && bptype == L_TYPE) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue