changeset 11844:dd8d2a336f90

8075263: MHI::checkCustomized isn't eliminated for inlined MethodHandles Reviewed-by: jrose, kvn
author vlivanov
date Fri, 20 Mar 2015 11:42:31 -0700
parents 1ac30570ba1a
children 884c4cc50a8f
files src/java.base/share/classes/java/lang/invoke/Invokers.java src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/invoke/Invokers.java	Thu Mar 19 15:00:51 2015 -0700
+++ b/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/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Thu Mar 19 15:00:51 2015 -0700
+++ b/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,