8228671: Fastdebug VM throws InternalError when publicLookup.in(T) is used to resolve a member
authormchung
Sat, 27 Jul 2019 14:49:16 -0700
changeset 57558 5e637f790bb8
parent 57551 02cffb476ab0
child 57559 9af2749af9fc
8228671: Fastdebug VM throws InternalError when publicLookup.in(T) is used to resolve a member Reviewed-by: alanb
src/java.base/share/classes/java/lang/invoke/MethodHandles.java
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Fri Jul 26 23:37:51 2019 -0400
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java	Sat Jul 27 14:49:16 2019 -0700
@@ -1329,7 +1329,14 @@
 
         // This is just for calling out to MethodHandleImpl.
         private Class<?> lookupClassOrNull() {
-            return (allowedModes == TRUSTED) ? null : lookupClass;
+            if (allowedModes == TRUSTED) {
+                return null;
+            }
+            if (allowedModes == UNCONDITIONAL) {
+                // use Object as the caller to pass to VM doing resolution
+                return Object.class;
+            }
+            return lookupClass;
         }
 
         /** Tells which access-protection classes of members this lookup object can produce.