< prev index next >
src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
Print this page
rev 47736 : 8184777: Factor out species generation logic from BoundMethodHandle
Reviewed-by: vlivanov
Contributed-by: john.r.rose@oracle.com, claes.redestad@oracle.com
*** 774,788 ****
BoundMethodHandle mh;
try {
if (PROFILE_GWT) {
int[] counts = new int[2];
mh = (BoundMethodHandle)
! BoundMethodHandle.speciesData_LLLL().constructor().invokeBasic(type, form,
(Object) test, (Object) profile(target), (Object) profile(fallback), counts);
} else {
mh = (BoundMethodHandle)
! BoundMethodHandle.speciesData_LLL().constructor().invokeBasic(type, form,
(Object) test, (Object) profile(target), (Object) profile(fallback));
}
} catch (Throwable ex) {
throw uncaughtException(ex);
}
--- 774,788 ----
BoundMethodHandle mh;
try {
if (PROFILE_GWT) {
int[] counts = new int[2];
mh = (BoundMethodHandle)
! BoundMethodHandle.speciesData_LLLL().factory().invokeBasic(type, form,
(Object) test, (Object) profile(target), (Object) profile(fallback), counts);
} else {
mh = (BoundMethodHandle)
! BoundMethodHandle.speciesData_LLL().factory().invokeBasic(type, form,
(Object) test, (Object) profile(target), (Object) profile(fallback));
}
} catch (Throwable ex) {
throw uncaughtException(ex);
}
*** 1087,1097 ****
MethodHandle unboxResult = unboxResultHandle(type.returnType());
BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLLLL();
BoundMethodHandle mh;
try {
! mh = (BoundMethodHandle) data.constructor().invokeBasic(type, form, (Object) target, (Object) exType,
(Object) catcher, (Object) collectArgs, (Object) unboxResult);
} catch (Throwable ex) {
throw uncaughtException(ex);
}
assert(mh.type() == type);
--- 1087,1097 ----
MethodHandle unboxResult = unboxResultHandle(type.returnType());
BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLLLL();
BoundMethodHandle mh;
try {
! mh = (BoundMethodHandle) data.factory().invokeBasic(type, form, (Object) target, (Object) exType,
(Object) catcher, (Object) collectArgs, (Object) unboxResult);
} catch (Throwable ex) {
throw uncaughtException(ex);
}
assert(mh.type() == type);
*** 1883,1893 ****
LoopClauses clauseData =
new LoopClauses(new MethodHandle[][]{toArray(init), toArray(step), toArray(pred), toArray(fini)});
BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLL();
BoundMethodHandle mh;
try {
! mh = (BoundMethodHandle) data.constructor().invokeBasic(type, form, (Object) clauseData,
(Object) collectArgs, (Object) unboxResult);
} catch (Throwable ex) {
throw uncaughtException(ex);
}
assert(mh.type() == type);
--- 1883,1893 ----
LoopClauses clauseData =
new LoopClauses(new MethodHandle[][]{toArray(init), toArray(step), toArray(pred), toArray(fini)});
BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLL();
BoundMethodHandle mh;
try {
! mh = (BoundMethodHandle) data.factory().invokeBasic(type, form, (Object) clauseData,
(Object) collectArgs, (Object) unboxResult);
} catch (Throwable ex) {
throw uncaughtException(ex);
}
assert(mh.type() == type);
*** 2126,2136 ****
MethodHandle unboxResult = unboxResultHandle(rtype);
BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLLL();
BoundMethodHandle mh;
try {
! mh = (BoundMethodHandle) data.constructor().invokeBasic(type, form, (Object) target, (Object) cleanup,
(Object) collectArgs, (Object) unboxResult);
} catch (Throwable ex) {
throw uncaughtException(ex);
}
assert(mh.type() == type);
--- 2126,2136 ----
MethodHandle unboxResult = unboxResultHandle(rtype);
BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLLL();
BoundMethodHandle mh;
try {
! mh = (BoundMethodHandle) data.factory().invokeBasic(type, form, (Object) target, (Object) cleanup,
(Object) collectArgs, (Object) unboxResult);
} catch (Throwable ex) {
throw uncaughtException(ex);
}
assert(mh.type() == type);
< prev index next >