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

Andrew Dinn adinn at redhat.com
Wed Dec 19 09:25:37 UTC 2018


Hi Nick,

On 19/12/2018 07:31, Nick Gasson (Arm Technology China) wrote:
> 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.
Yes, nice catch and I agree about the use of ldrw over ldrb. Reviewed.

regards,


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


More information about the aarch64-port-dev mailing list