ARM: JSR 292 MethodHandle support

Andrew Dinn adinn at redhat.com
Wed Apr 11 05:16:22 PDT 2012


Hi,

Better late than never, included below is a review of Andrew's patch.

regards,


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

Summary:
--------

  * A code walkthrough generated a few minor comments and 1 edit but 
found no serious problems.

  * Building the patched release encountered 1 build problem in the 
patched code which was subsequently resolved by Andrew. There were a 
couple of other patches required to the latest icedtea7-forest-2.1 build 
system.

  * The patched build successfully executes some of the invokedynamic 
test code but throws a lot of 'not yet implemented' errors.

Detailed comments:
------------------

Code Walkthrough
----------------

  * cppInterpreter_arm.S line 3141 (of patched file)

     ldr     r0, [r8, #ISTATE_THREAD]

should be

     ldr     r0, [istate, #ISTATE_THREAD]

  * cppInterpreter_arm.S line 3099 (of patched file)

     bl      _ZN14CppInterpreter21process_method_handleEP7oopDescP6Thread

this is not strictly an API method of CppInterpreter but it is unlikely 
to disappear so it is probably ok to co-opt it

  * cppInterpreter_arm.S line 3155 (of patched file)

     // Common code for fast_aldc_w and fast_aldc_w

this should read

     // Common code for fast_aldc and fast_aldc_w

  * thumb2.cpp line 6587 (of patched file)

the JITted code for invokedynamic just calls out to the interpreter

   Thumb2_Exit(jinfo, H_EXIT_TO_INTERPRETER, bci, stackdepth)

This means the VM interprets the current method from this point on. so 
it might be worth revising this later to do the work in JITted code and 
allow JIT execution to continue.

Build Problems
--------------

  * cppInterpreter_arm.S line 3087 (of patched file)

This line was originally provided as

     bl     _ZN25java_lang_invoke_CallSite22target_offset_in_bytesEv

However, this failed to compile -- I think because 
java_lang_invoke_CallSite::target_offset_in_bytes() is defined inline in 
a header file and the compiler did not generate an out of line callable 
function.

This was fixed by Andrew Haley by defining a wrapper function 
Helper_target_offset_in_bytes in asm_helper.c and calling the wrapper 
from the asm

    bl      Helper_target_offset_in_bytes


  * jdk/make/common/shared/Compiler-gcc.gmk

This was setting

   SHARED_LIBRARY_FLAG = -shared -mimpure-text

but the second flag is invalid for arm (or indeed anything other than 
SPARC according to the gcc manual). So it needs to be removed.

  * jdk/make/jdk_generic_profile.sh

This script needs an entry for arm in the case switch at line 283 i.e.

    # ZERO_ENDIANNESS is the endianness of the processor
    case "${ZERO_LIBARCH}" in
-    i386|amd64|ia64)
+    i386|amd64|ia64|arm)

and also another case at line 310 i.e.

      s390)
        ZERO_ARCHFLAG="-m31"
        ;;
+    arm)
+      ZERO_ARCHFLAG="-D_LITTLE_ENDIAN"
+      ;;
      *)



More information about the distro-pkg-dev mailing list