8075263: MHI::checkCustomized isn't eliminated for inlined MethodHandles
Reviewed-by: jrose, kvn
--- a/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java Thu Mar 19 15:00:51 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java Fri Mar 20 11:42:31 2015 -0700
@@ -394,6 +394,7 @@
@ForceInline
void checkCustomized(Object o) {
MethodHandle mh = (MethodHandle)o;
+ if (MethodHandleImpl.isCompileConstant(mh)) return;
if (mh.form.customized == null) {
maybeCustomize(mh);
}
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java Thu Mar 19 15:00:51 2015 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java Fri Mar 20 11:42:31 2015 -0700
@@ -722,6 +722,13 @@
return result;
}
+ // Intrinsified by C2. Returns true if obj is a compile-time constant.
+ @LambdaForm.Hidden
+ static
+ boolean isCompileConstant(Object obj) {
+ return false;
+ }
+
static
MethodHandle makeGuardWithTest(MethodHandle test,
MethodHandle target,