8339800: Prefer invokeBasic in BootstrapMethodInvokers
Reviewed-by: jvernee
This commit is contained in:
parent
64de7813e4
commit
0d8e52b382
@ -99,7 +99,7 @@ final class BootstrapMethodInvoker {
|
||||
// with empty constant arguments?
|
||||
if (isStringConcatFactoryBSM(bootstrapMethod.type())) {
|
||||
result = (CallSite)bootstrapMethod
|
||||
.invokeExact(caller, name, (MethodType)type,
|
||||
.invokeBasic(caller, name, (MethodType)type,
|
||||
(String)info, new Object[0]);
|
||||
} else {
|
||||
info = maybeReBox(info);
|
||||
@ -131,23 +131,23 @@ final class BootstrapMethodInvoker {
|
||||
MethodType bsmType = bootstrapMethod.type();
|
||||
if (isLambdaMetafactoryIndyBSM(bsmType) && argv.length == 3) {
|
||||
result = (CallSite)bootstrapMethod
|
||||
.invokeExact(caller, name, (MethodType)type, (MethodType)argv[0],
|
||||
.invokeBasic(caller, name, (MethodType)type, (MethodType)argv[0],
|
||||
(MethodHandle)argv[1], (MethodType)argv[2]);
|
||||
} else if (isLambdaMetafactoryCondyBSM(bsmType) && argv.length == 3) {
|
||||
result = bootstrapMethod
|
||||
.invokeExact(caller, name, (Class<?>)type, (MethodType)argv[0],
|
||||
.invokeBasic(caller, name, (Class<?>)type, (MethodType)argv[0],
|
||||
(MethodHandle)argv[1], (MethodType)argv[2]);
|
||||
} else if (isStringConcatFactoryBSM(bsmType) && argv.length >= 1) {
|
||||
String recipe = (String)argv[0];
|
||||
Object[] shiftedArgs = Arrays.copyOfRange(argv, 1, argv.length);
|
||||
maybeReBoxElements(shiftedArgs);
|
||||
result = (CallSite)bootstrapMethod.invokeExact(caller, name, (MethodType)type, recipe, shiftedArgs);
|
||||
result = (CallSite)bootstrapMethod.invokeBasic(caller, name, (MethodType)type, recipe, shiftedArgs);
|
||||
} else if (isLambdaMetafactoryAltMetafactoryBSM(bsmType)) {
|
||||
maybeReBoxElements(argv);
|
||||
result = (CallSite)bootstrapMethod.invokeExact(caller, name, (MethodType)type, argv);
|
||||
result = (CallSite)bootstrapMethod.invokeBasic(caller, name, (MethodType)type, argv);
|
||||
} else if (isObjectMethodsBootstrapBSM(bsmType)) {
|
||||
MethodHandle[] mhs = Arrays.copyOfRange(argv, 2, argv.length, MethodHandle[].class);
|
||||
result = bootstrapMethod.invokeExact(caller, name, (TypeDescriptor)type, (Class<?>)argv[0], (String)argv[1], mhs);
|
||||
result = bootstrapMethod.invokeBasic(caller, name, (TypeDescriptor)type, (Class<?>)argv[0], (String)argv[1], mhs);
|
||||
} else {
|
||||
maybeReBoxElements(argv);
|
||||
if (type instanceof Class<?> c) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user