1.1 --- a/src/share/vm/opto/callnode.cpp Tue Nov 25 13:14:07 2008 -0800 1.2 +++ b/src/share/vm/opto/callnode.cpp Wed Dec 03 13:41:37 2008 -0800 1.3 @@ -395,7 +395,13 @@ 1.4 OptoReg::regname(OptoReg::c_frame_pointer), 1.5 regalloc->reg2offset(box_reg)); 1.6 } 1.7 - format_helper( regalloc, st, obj, "MON-OBJ[", i, &scobjs ); 1.8 + const char* obj_msg = "MON-OBJ["; 1.9 + if (EliminateLocks) { 1.10 + while( !box->is_BoxLock() ) box = box->in(1); 1.11 + if (box->as_BoxLock()->is_eliminated()) 1.12 + obj_msg = "MON-OBJ(LOCK ELIMINATED)["; 1.13 + } 1.14 + format_helper( regalloc, st, obj, obj_msg, i, &scobjs ); 1.15 } 1.16 1.17 for (i = 0; i < (uint)scobjs.length(); i++) { 1.18 @@ -908,8 +914,9 @@ 1.19 add_req(lock->box_node()); 1.20 add_req(lock->obj_node()); 1.21 } else { 1.22 - add_req(NULL); 1.23 - add_req(NULL); 1.24 + Node* top = Compile::current()->top(); 1.25 + add_req(top); 1.26 + add_req(top); 1.27 } 1.28 jvms()->set_scloff(nextmon+MonitorEdges); 1.29 jvms()->set_endoff(req()); 1.30 @@ -1382,7 +1389,7 @@ 1.31 // 1.32 // If we are locking an unescaped object, the lock/unlock is unnecessary 1.33 // 1.34 - ConnectionGraph *cgr = Compile::current()->congraph(); 1.35 + ConnectionGraph *cgr = phase->C->congraph(); 1.36 PointsToNode::EscapeState es = PointsToNode::GlobalEscape; 1.37 if (cgr != NULL) 1.38 es = cgr->escape_state(obj_node(), phase); 1.39 @@ -1450,6 +1457,7 @@ 1.40 1.41 // Mark it eliminated to update any counters 1.42 lock->set_eliminated(); 1.43 + lock->set_coarsened(); 1.44 } 1.45 } else if (result != NULL && ctrl->is_Region() && 1.46 iter->_worklist.member(ctrl)) { 1.47 @@ -1484,7 +1492,7 @@ 1.48 // 1.49 // If we are unlocking an unescaped object, the lock/unlock is unnecessary. 1.50 // 1.51 - ConnectionGraph *cgr = Compile::current()->congraph(); 1.52 + ConnectionGraph *cgr = phase->C->congraph(); 1.53 PointsToNode::EscapeState es = PointsToNode::GlobalEscape; 1.54 if (cgr != NULL) 1.55 es = cgr->escape_state(obj_node(), phase);