RFR: 8193260: AArch64: JVMCI: Implement trampoline calls

Andrew Dinn adinn at redhat.com
Tue Dec 12 15:27:18 UTC 2017

On 08/12/17 17:50, Andrew Haley wrote:
> AArch64 call instructions only have a 26-bit range, so if the code
> cache is greater than 128 megabytes (and it is by default)
> compilations will fail with out-of-range branches.
> C1 and C2 solve this by generating trampolines for Java calls. The
> Aarch64 JVMCI CodeInstaller doesn't ganerate trampolines, and we
> should fix it so that it does.
> Note that this webrev includes the necessary Graal changes.  Graal is
> maintained separately, so these are only included FYI: they will have
> to be reviewed after these JVMCI changes are in HotSpot.
> Also note that this includes changes to shared and x86 code, so it'll
> need a sponsor.
> http://cr.openjdk.java.net/~aph/8193260-1/
This looks ok by eyeball and OpenJDK builds and runs ok for non-Graal
runs on AArch64. So, on those grounds it is reviewed.

I also patched and built a latest checkout Graal tree in order to test
Graal, pointed it at my jdkdev/hs build (aka, for now, jdk10) using
--jdkhome /path/to/jdkdev/hs/build/... and then tried to run a few things.

This was fine when running Hello World which did nto need to load Graal
compiler code. However, it barfed when I tried running netbeans
apparently because of having to eat compiler class files with version 54
(jdk10). So, building Graal with jdk10 doesn't actually work yet:

    Caused by: java.lang.UnsupportedClassVersionError: Unsupported class
file version: 54.0

I fixed this by tweaking the offending class above, Classfile, to allow
bytecode versions up to 54 and it then successfully ran netbeans (the
relevant diff is included below).


Andrew Dinn
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander

@@ -47,7 +47,7 @@ public class Classfile {
     private final List<ClassfileBytecode> codeAttributes;

     private static final int MAJOR_VERSION_JAVA7 = 51;
-    private static final int MAJOR_VERSION_JAVA9 = 53;
+    private static final int MAJOR_VERSION_JAVA10 = 54;
     private static final int MAGIC = 0xCAFEBABE;

@@ -65,7 +65,7 @@ public class Classfile {

         int minor = stream.readUnsignedShort();
         int major = stream.readUnsignedShort();
-        if (major < MAJOR_VERSION_JAVA7 || major > MAJOR_VERSION_JAVA9) {
+        if (major < MAJOR_VERSION_JAVA7 || major > MAJOR_VERSION_JAVA10) {
             throw new UnsupportedClassVersionError("Unsupported class
file version: " + major + "." + minor);

More information about the hotspot-dev mailing list