United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 7125896 Eliminate nested locks
7125896 : Eliminate nested locks

Details
Type:
Enhancement
Submit Date:
2011-12-29
Status:
Closed
Updated Date:
2012-03-29
Project Name:
JDK
Resolved Date:
2012-03-29
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
8-pool
Fixed Versions:
hs23

Related Reports
Backport:
Backport:
Relates:
Relates:
Relates:

Sub Tasks

Description
Eliminated nested locks of the same object:

    synchronized (reader) { // we synchronize on reader
    if (reader.getCount() > 0) { // calling synchronized method getCount() while already holding the lock
       reader.incrementReserveCount(1);
    }

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/e9a5e0a812c8
                                     
2012-03-22
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/e9a5e0a812c8
                                     
2012-01-18
EVALUATION

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.

Added new enum field AbstractLockNode::_kind (I tried to avoid _type name) and corresponding methods instead of boolean fields. Added new method LockNode::is_nested_lock_region() to find if it is nested. Added new method BoxLockNode::is_simple_lock_region() to check if Box node is used to lock only one object and to avoid replacing this Box with clone in macro.cpp. Added new method PhaseMacroExpand::mark_eliminated_box() to move EA eliminated marking code from mark_eliminated_locking_nodes().

Also added missed KILL effect for box register in fastlock and fastunlock mach nodes definitions.
                                     
2012-01-09
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/e9a5e0a812c8
                                     
2012-01-07



Hardware and Software, Engineered to Work Together