[aarch64-port-dev ] RFR: 8189596: AArch64: implementation for Thread-local handshakes
Dmitry Samersov
dmitry.samersoff at bell-sw.com
Wed Nov 29 14:32:09 UTC 2017
Andrew,
Thank you for the explanation.
-Dmitry
On 27.11.2017 18:47, Andrew Haley wrote:
> 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.
>
More information about the aarch64-port-dev
mailing list