[aarch64-port-dev ] RFR: 8189596: AArch64: implementation for Thread-local handshakes

Andrew Haley aph at redhat.com
Mon Nov 27 15:47:11 UTC 2017


On 27/11/17 15:30, Dmitry Samersov wrote:
> Andrew,
> 
>> http://cr.openjdk.java.net/~aph/8189596-2
> 
> 1. interp_masm_aarch64.cpp
> 
>  456   if (needs_thread_local_poll) {
> 
> It might be better to put the code related to needs_thread_local_poll
> into the single block for better readability.
> 
> Approx :
> 
> if (needs_thread_local_poll) {
>    NOT_PRODUCT(block_comment("Thread-local Safepoint poll"));
>    ldr(rscratch2, Address(rthread, Thread::polling_page_offset()));
>    tbz(rscratch2, exact_log2(SafepointMechanism::poll_bit()), notsafepoint);
> 
>    lea(rscratch2, ExternalAddress((address)safepoint_table));
>    ldr(rscratch2, Address(rscratch2, rscratch1, Address::uxtw(3)));
>    br(rscratch2);
> 
> }
> 
> bind(notsafepoint);

I didn't want to do that because I wanted to put the uncommon case out
of line.  In any case, I don't think it warrants a respin.

> 2. macroAssembler_aarch64.cpp
> 
> 321     safepoint_poll(slow_path);
> 
> It might be better to put global poll code to a separate function, to
> avoid double checking of SafepointMechanism::uses_thread_local_poll();

We don't need to do it for efficiency because GCC already knows how to
do that.  I can't think of any other reason we'd want to change it.

> 3. templateInterpreterGenerator_aarch64.cpp : 1382
> 
> 1382     __ safepoint_poll_acquire(L);
> 
> Do we really need acquire here?

I believe so,, for the reason discussed upthread.  We need to do it
whenever transitioning from native to Java state.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the aarch64-port-dev mailing list