The attached program crashes with this message: # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (sharedRuntime.cpp:586), pid=4116, tid=3072834448 # Error: guarantee(cb->is_adapter_blob(),"exception happened outside interpreter, nmethods and vtable stubs (1)") # # JRE version: 7.0 # Java VM: OpenJDK Server VM (17.0-b05 interpreted mode linux-x86 ) # An error report file with more information is saved as: # /tmp/hs_err_pid4116.log
Helmut
// -*- compile-command: "javac7 Foo.java" -*- /* A test case which crashes the VM. To see the crash, invoke main with no arguments. */ import static java.dyn.MethodHandles.*; import static java.dyn.MethodType.methodType; import java.dyn.*; class Foo { static final Lookup lookup = lookup().in (Foo.class); static CallSite link (Class klass, String key, MethodType t) { CallSite cs = new CallSite (klass, key, t); MethodHandle mh = exactInvoker (t.dropParameterTypes (0, 1)); cs.setTarget (mh); return cs; } static { MethodHandle link = lookup.findStatic (Foo.class, "link", Linkage.BOOTSTRAP_METHOD_TYPE); Linkage.registerBootstrapMethod (Foo.class, link); } public static void foo () { System.out.println ("foo called"); } public static void main (String[] args) throws Throwable { MethodHandle mh = (args.length == 0 ? null : lookup.findStatic (Foo.class, "foo", methodType (void.class))); InvokeDynamic.<void>funcall (mh); } }
_______________________________________________ mlvm-dev mailing list mlvm-dev@openjdk.java.net http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev