mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8268124: Update java.lang to use switch expressions
Reviewed-by: naoto, darcy, mchung, iris, lancea, dfuchs
This commit is contained in:
parent
a187fcc3ec
commit
d43c8a74b3
22 changed files with 421 additions and 551 deletions
|
@ -598,20 +598,14 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||
}
|
||||
|
||||
private int invocationOpcode() throws InternalError {
|
||||
switch (implKind) {
|
||||
case MethodHandleInfo.REF_invokeStatic:
|
||||
return INVOKESTATIC;
|
||||
case MethodHandleInfo.REF_newInvokeSpecial:
|
||||
return INVOKESPECIAL;
|
||||
case MethodHandleInfo.REF_invokeVirtual:
|
||||
return INVOKEVIRTUAL;
|
||||
case MethodHandleInfo.REF_invokeInterface:
|
||||
return INVOKEINTERFACE;
|
||||
case MethodHandleInfo.REF_invokeSpecial:
|
||||
return INVOKESPECIAL;
|
||||
default:
|
||||
throw new InternalError("Unexpected invocation kind: " + implKind);
|
||||
}
|
||||
return switch (implKind) {
|
||||
case MethodHandleInfo.REF_invokeStatic -> INVOKESTATIC;
|
||||
case MethodHandleInfo.REF_newInvokeSpecial -> INVOKESPECIAL;
|
||||
case MethodHandleInfo.REF_invokeVirtual -> INVOKEVIRTUAL;
|
||||
case MethodHandleInfo.REF_invokeInterface -> INVOKEINTERFACE;
|
||||
case MethodHandleInfo.REF_invokeSpecial -> INVOKESPECIAL;
|
||||
default -> throw new InternalError("Unexpected invocation kind: " + implKind);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue