RFR(XL): 8185640: Thread-local handshakes

Erik Österlund erik.osterlund at oracle.com
Wed Oct 25 11:45:46 UTC 2017

Hi Robbin and Andrew,

@Robbin: I think Andrew is concerned about a poll inside of the loop 
always being on if the initial load on rthread points to the trapping 
page and was loaded into a register (before a loop) that is not changed 
inside of the loop, and as a consequence gets stuck in trapping all the 
time for every poll in the loop.

By making the initial load from rthread of "raw" pointer type, this load 
will (as far as I know) not be moved outside of the loop. If it ever 
was, it would be a bug.


On 2017-10-25 13:36, Robbin Ehn wrote:
> Hi Andrew,
> The address of the polling page address is static per thread.
> The load of the polling page address is a dependent load.
> If the add of the offset to rthread is done outside loop, that is 
> perfectly fine. I do not see an issue here. If I did not understand 
> you correctly, please let me know.
> Thanks, Robbin
> On 2017-10-25 12:32, Andrew Haley wrote:
>> Do we know hat this is always correct for C2?  Could we not have
>> something like
>>      ldr r0, [rthread, #polling_page_offset]
>> loop:
>>      ldr rscratch, [r0]  {poll}
>>      cmp foo, bar
>>      bne loop
>> when C2 hoists the load of the polling page address out of a loop?
>> Or is such hoisting disable for this case?

More information about the hotspot-dev mailing list