Request for reviews (L): 7125896: Eliminate nested locks

Tom Rodriguez tom.rodriguez at oracle.com
Tue Jan 3 09:43:44 PST 2012


On Dec 30, 2011, at 11:23 AM, Vladimir Kozlov wrote:

> Christian Thalinger wrote:
>> I think the changes are good.  The only thing I don't like is the raw use of _slot:
>> +         (BoxLockNode::boxnode(lock->box_node())->_slot ==
>> +          BoxLockNode::boxnode(unlock->box_node())->_slot)) {
> 
> Agree. I changed _slot (and other BoxLock fields) to private and replaced above code with new BoxLock's method call:
> 
> BoxLockNode::same_slot(lock->box_node(), unlock->box_node())
> 
> I also did some methods renaming and updated webrev.

The new is_nested flag is kind of weird since it's only set if it's been eliminated.  It's really just a flag for the new kind of elimination, isn't it?  The sequence of flag settings suggests that maybe it should be an enum instead of individual flags. 

+         alock->set_eliminated();
+         alock->clear_coarsened();
+         alock->clear_nested();

Can you factor out some of the new code in macro.cpp.  Each piece if fairly complex but relatively independent and breaking it up would make it clearer I think.

Why can't the BoxLockNode be modified in place instead of being replaced?  They are no longer shared between lock regions.  Actually if sharing of them is disabled then you can always just modify them in place can't you?

eliminating the cloning in ciTyepFlow could have performance implications.  I assume it's rare?

tom

> 
> Thanks,
> Vladimir
> 
>> -- Chris
>> On Dec 29, 2011, at 10:20 PM, Vladimir Kozlov wrote:
>>> http://cr.openjdk.java.net/~kvn/7125896/webrev
>>> 
>>> 7125896: Eliminate nested locks
>>> 
>>> Nested locks elimination done before lock nodes expansion by looking for outer locks of the same object. Commoning (GVN) of BoxLock nodes is switched off because nested locks elimination requires separate BoxLock node for each locked region to generated correct debug info for deoptimization. As result there could be merges (and Phi nodes) of BoxLock nodes. One such merge generated by ciTypeFlow (cloning loop head) is avoided but there could be other cases so new code is added to handle it.
>>> 
>>> New code is under new product flag EliminateNestedLocks.
>>> 
>>> Also added missed KILL effect for box register in fastlock and fastunlock mach nodes definitions.
>>> 
>>> Tested with full CTW, nsk, jtreg tests, refworkload.
>>> 
>>> Thanks,
>>> Vladimir



More information about the hotspot-compiler-dev mailing list