8143142: AssertionError in MethodHandleImpl
authorredestad
Tue, 17 Nov 2015 15:29:21 +0100
changeset 33846 049daf20246e
parent 33845 8b8ce7a896fd
child 33847 7857fc64d0c0
8143142: AssertionError in MethodHandleImpl Reviewed-by: psandoz, vlivanov
jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
--- a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Tue Nov 17 22:21:45 2015 +0800
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Tue Nov 17 15:29:21 2015 +0100
@@ -781,7 +781,7 @@
 
     static boolean isStaticallyInvocable(NamedFunction[] functions) {
         for (NamedFunction nf : functions) {
-            if (!isStaticallyInvocable(nf.member)) {
+            if (!isStaticallyInvocable(nf.member())) {
                 return false;
             }
         }
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Tue Nov 17 22:21:45 2015 +0800
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Tue Nov 17 15:29:21 2015 +0100
@@ -1605,19 +1605,15 @@
 
     static {
         try {
-            NamedFunction nfs[] = {
-                NF_checkSpreadArgument = new NamedFunction(MethodHandleImpl.class
-                        .getDeclaredMethod("checkSpreadArgument", Object.class, int.class)),
-                NF_guardWithCatch = new NamedFunction(MethodHandleImpl.class
-                        .getDeclaredMethod("guardWithCatch", MethodHandle.class, Class.class,
-                                MethodHandle.class, Object[].class)),
-                NF_throwException = new NamedFunction(MethodHandleImpl.class
-                        .getDeclaredMethod("throwException", Throwable.class)),
-                NF_profileBoolean = new NamedFunction(MethodHandleImpl.class
-                        .getDeclaredMethod("profileBoolean", boolean.class, int[].class))
-            };
-            // Each nf must be statically invocable or we get tied up in our bootstraps.
-            assert(InvokerBytecodeGenerator.isStaticallyInvocable(nfs));
+            NF_checkSpreadArgument = new NamedFunction(MethodHandleImpl.class
+                    .getDeclaredMethod("checkSpreadArgument", Object.class, int.class));
+            NF_guardWithCatch = new NamedFunction(MethodHandleImpl.class
+                    .getDeclaredMethod("guardWithCatch", MethodHandle.class, Class.class,
+                            MethodHandle.class, Object[].class));
+            NF_throwException = new NamedFunction(MethodHandleImpl.class
+                    .getDeclaredMethod("throwException", Throwable.class));
+            NF_profileBoolean = new NamedFunction(MethodHandleImpl.class
+                    .getDeclaredMethod("profileBoolean", boolean.class, int[].class));
         } catch (ReflectiveOperationException ex) {
             throw newInternalError(ex);
         }