1.1 --- a/src/share/vm/opto/escape.cpp Fri Jun 03 22:31:43 2011 -0700 1.2 +++ b/src/share/vm/opto/escape.cpp Sat Jun 04 10:36:22 2011 -0700 1.3 @@ -1747,6 +1747,25 @@ 1.4 _collecting = false; 1.5 assert(C->unique() == nodes_size(), "there should be no new ideal nodes during ConnectionGraph build"); 1.6 1.7 + if (EliminateLocks) { 1.8 + // Mark locks before changing ideal graph. 1.9 + int cnt = C->macro_count(); 1.10 + for( int i=0; i < cnt; i++ ) { 1.11 + Node *n = C->macro_node(i); 1.12 + if (n->is_AbstractLock()) { // Lock and Unlock nodes 1.13 + AbstractLockNode* alock = n->as_AbstractLock(); 1.14 + if (!alock->is_eliminated()) { 1.15 + PointsToNode::EscapeState es = escape_state(alock->obj_node()); 1.16 + assert(es != PointsToNode::UnknownEscape, "should know"); 1.17 + if (es != PointsToNode::UnknownEscape && es != PointsToNode::GlobalEscape) { 1.18 + // Mark it eliminated 1.19 + alock->set_eliminated(); 1.20 + } 1.21 + } 1.22 + } 1.23 + } 1.24 + } 1.25 + 1.26 #ifndef PRODUCT 1.27 if (PrintEscapeAnalysis) { 1.28 dump(); // Dump ConnectionGraph