[aarch64-port-dev ] C2 code now up to date and working again

Andrew Dinn adinn at redhat.com
Wed Jul 10 03:03:39 PDT 2013


I have merged all the latest changes into the C2 branch and made all
necessary changes in order to get C2 working again. To build it you need to:

i) update your hotspot repo to branch aarch64_c2

  [adinn jdk8] hg -R hotspot update -r aarch64_c2

ii) configure for a server build -- change the releavnt configure option
in sim_compile to --with-jvm-variants=server i.e.

  sh ./configure --with-debug-level=slowdebug
--with-boot-jdk=/usr/lib/jvm/java-1.7.0-openjdk.x86_64
--with-jvm-variants=server --with-sys-root=/
--openjdk-target=aarch64-oe-linux --disable-zip-debug-info

this will give you 2 config directories under build

  build/linux-aarch64-normal-server-slowdebug
  build/linux-aarch64-normal-client-slowdebug

so, in order to choose the correct one to build you need to:

iii) change sim_compile to specify the desired CONF

  make STRIP_POLICY=no_strip LOG="debug" JOBS=4 BUILTIN_SIM=true
CONF=linux-aarch64-normal-server-slowdebug images

or alternatively:

iiib) delete the dir for the config you don't want and use the original
sim_compile script

N.B. when you run the C2 config you need to restrict what you compile to
fairly simple Java code and you have to specify a few important options

e.g. I run

  build/.../bin/java -server -XX:-TieredCompilation
-XX:CompileOnly=HelloC2.test -XX:-UseCompressedOops
-XX:+CIPrintCompileQueue -XX:+PrintIdeal -XX:+PrintOpto
-XX:+PrintOptoAssembly HelloC2

where

  -server is required

  -XX:-TieredCompilation is actually redundant as this is now off by
default (thanks to one of the changesets imported in moving hotspot up
to jdk8-b81). I have not yet tried testing with it enabled -- but will
do very soon.

  -XX:CompileOnly is used to ensure we only compile simple routines (the
argument is a comma-separated list of methods to compile possibly
including * as widlcard).

  -XX:-UseCompressedOops is required as I have not yet implemented oop
encode and decode

  -XX:+CIPrintCompileQueue -XX:+PrintIdeal -XX:+PrintOpto
-XX:+PrintOptoAssembly show you the abstract compile grap and the
generated code (but better still type 'breakbc "HelloC2.test"' into gdb
and then use simdis 0x7fff..... 10 to disassemble 10 instructions at the
breakpoint.

n.b. HelloC2.test is a simple instance method which, inter alia,
exercises dead code elimination, conditional logic and branching and an
instance method call.

    public long test(long el1, long el2)
    {
        if (this == NULL) {
            return 0;
        }
	if (el1 == 0 || el2 == 0) {
	    return 0;
	} else {
	    return mul(el1, el2);
	}
    }

Most Java ops should work including operators, field access/update,
control branching + method calls. Don't expect locking or GC to be work
nor anything to be too reliable.

regards,


Andrew Dinn
-----------



More information about the aarch64-port-dev mailing list