exception running JDK 8 test program

Frost, Gary Gary.Frost at amd.com
Thu Feb 14 13:09:33 PST 2013


Obviously ConstantPool tag 18 is MethodHandle.  So this relates to the support for MethodHandles in classfiles. 

Gary



-----Original Message-----
From: graal-dev-bounces at openjdk.java.net [mailto:graal-dev-bounces at openjdk.java.net] On Behalf Of Venkatachalam, Vasanth
Sent: Thursday, February 14, 2013 2:49 PM
To: graal-dev at openjdk.java.net
Subject: exception running JDK 8 test program

Hi,

When running the following JDK8 program (which has a lambda expression) in Graal, the VM throws the below exception and exits.
We know that Graal doesn't yet support the compilation of lambda constructs, but we would have expected the execution to have fallen back to the Hotspot compiler/interpreter instead of simply failing.
Any workarounds for this?

public class Twelve{
   interface SAM{
      void run(int _id);
   }

   public static void For(int _count, SAM _sam){
      for (int id = 0; id<_count; id++){
         _sam.run(id);
      }
   }

   public static void main(String[] _args) {
      For(12, value ->{System.out.printf("%d * %d = %d\n", value, 12, (value*12));});
   }
}

Exception in thread "main" java.lang.ClassFormatError: This JVM does not support constant tag 18 in class file com/amd/aparapi/sample/mandel/Main
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:64)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:491)





More information about the graal-dev mailing list