[8u] RFR: nativeInstruction atomicity and correctness of patching

Alex Kashchenko akashche at redhat.com
Fri Apr 1 12:23:42 UTC 2016


Hi,

On 03/30/2016 02:00 PM, Anton Kozlov wrote:
> Hi, All!
>
> Could you review a patch that should fix nativeInst in several aspects?
>
> * macroassembler trampoline_call generates code, which loads call
> target from memory just after trampoline. That constant could be
> patched atomically and in mt_safe way. NativeTrampolineCall class was
> introduced.
>
> * NativeGeneralJump not falls to undefined behavior conditions now,
> only imm branches swapped with imm branches. It used only by C1
> patching facultiles, so there should be no harm that the implementation
> depends on C1 implementation. It is a part of C1 patching that triggers
> deoptimisation on aarch64, http://mail.openjdk.java.net/pipermail/aarch
> 64-port-dev/2013-September/000273.html. Note, that quote about
> concurrent modification and execution in discussion applies to aarch32
> as well.
>
> * Atomic::store, Atomic::load for jlongs made really atomic.
>
> Sorry for missing testcase.

Small addition for jdk9, this bit in nativeInst_aarch32.hpp:

#ifdef ASSERT
   StaticAssert<(int) NativeTrampolineCall::instruction_size <= (int) 
instruction_size> dummy1;
   StaticAssert<NativeMovConstReg::movw_movt_pair_sz
       + NativeRegCall::instruction_size <= (int) instruction_size> dummy2;
#endif

compiles fine in jdk8u, but should be changed for jdk9 due to 
JDK-8067306 changes:

#ifdef ASSERT
   STATIC_ASSERT_FAILURE<(int) NativeTrampolineCall::instruction_size <= 
(int) instruction_size> dummy1;
   STATIC_ASSERT_FAILURE<NativeMovConstReg::movw_movt_pair_sz
       + NativeRegCall::instruction_size <= (int) instruction_size> dummy2;
#endif


-- 
-Alex


More information about the aarch32-port-dev mailing list