[aarch64-port-dev ] RFR: 8209414: AArch64: method handle invocation does not respect JVMTI interp_only mode

Nick Gasson (Arm Technology China) Nick.Gasson at arm.com
Wed Dec 19 07:31:10 UTC 2018


Hi,

This is a small patch to fix failures of the following jtreg tests on 
AArch64:
   vmTestbase/vm/mlvm/indy/stress/jdi/breakpointInCompiledCode/Test.java
   vmTestbase/vm/mlvm/meth/func/jdi/breakpoint/Test.java

Webrev: http://cr.openjdk.java.net/~njian/8209414/webrev.0/
Bug: https://bugs.openjdk.java.net/browse/JDK-8209414

In MethodHandles::jump_from_method_handle the test on the value of the 
_interp_only_mode thread field is wrong: if this is non-zero we are 
tracing or single stepping with JVMTI and should always branch to the 
interpreted entry, to ensure the JVMTI method entry/exit hooks are 
called. But in the AArch64 version we branch to the interpreted entry if 
this value is *zero*, which is backwards. The result of this is 
mismatched entry/exit callbacks when invoking a method through a 
MethodHandle while tracing, which triggers an assertion failure in debug 
builds and strange behaviour in release builds.

The ldrb -> ldrw change isn't strictly necessary necessary, but I think 
it's good for consistency to make the instructions identical to 
InterpreterMacroAssembler::jump_from_interpreted, and as 
_interp_only_mode is an int we don't have to worry about endianness, 
etc. if we load a word.

Thanks,
Nick


More information about the aarch64-port-dev mailing list