RFR (XL) 8031320: Use Intel RTM instructions for locks

Roland Westrelin roland.westrelin at oracle.com
Thu Mar 20 11:16:13 UTC 2014


Hi Vladimir,

>> src/cpu/x86/vm/macroAssembler_x86.cpp
>> 
>> 1440   movptr(tmpReg, Address(boxReg, ObjectMonitor::owner_offset_in_bytes()-2)) ;
>> 
>> Why -2?
> 
> -2 removes a bit to get correct pointer.
> For inflated locks the bit 1 is set in markword:
> monitor_value            = 2
> 
> I modified code to use next:
> 
>  // Clean monitor_value bit to get valid pointer
>  int owner_offset = ObjectMonitor::owner_offset_in_bytes() - markOopDesc::monitor_value;

Thanks.

> 
>> In MacroAssembler::fast_lock(), Moving code starting at:
>> 1608     if (UseRTMForStackLocks && use_rtm) {
>> and
>> 1715     if (use_rtm) {
>> 
>> to their own methods would be nice.
> 
> Done.

Thanks.

>> src/cpu/x86/vm/sharedRuntime_x86_32.cpp
>> src/cpu/x86/vm/sharedRuntime_x86_64.cpp
>> 
>> Comments why you need xabort would be helpful
> 
> I think to be safe. We go into runtime/native code at those points.

I meant actual comments in the code. 

http://cr.openjdk.java.net/~kvn/8031320_9/webrev.01

looks good to me.

Roland.


More information about the hotspot-dev mailing list