comparison src/share/vm/opto/callnode.cpp @ 460:424f9bfe6b96

6775880: EA +DeoptimizeALot: assert(mon_info->owner()->is_locked(),"object must be locked now") Summary: Create new "eliminated" BoxLock node for monitor debug info when corresponding locks are eliminated. Reviewed-by: never
author kvn
date Wed, 03 Dec 2008 13:41:37 -0800
parents a1980da045cc
children 523ded093c31
comparison
equal deleted inserted replaced
459:3a86a8dcf27c 460:424f9bfe6b96
393 st->print(" MON-BOX%d=%s+%d", 393 st->print(" MON-BOX%d=%s+%d",
394 i, 394 i,
395 OptoReg::regname(OptoReg::c_frame_pointer), 395 OptoReg::regname(OptoReg::c_frame_pointer),
396 regalloc->reg2offset(box_reg)); 396 regalloc->reg2offset(box_reg));
397 } 397 }
398 format_helper( regalloc, st, obj, "MON-OBJ[", i, &scobjs ); 398 const char* obj_msg = "MON-OBJ[";
399 if (EliminateLocks) {
400 while( !box->is_BoxLock() ) box = box->in(1);
401 if (box->as_BoxLock()->is_eliminated())
402 obj_msg = "MON-OBJ(LOCK ELIMINATED)[";
403 }
404 format_helper( regalloc, st, obj, obj_msg, i, &scobjs );
399 } 405 }
400 406
401 for (i = 0; i < (uint)scobjs.length(); i++) { 407 for (i = 0; i < (uint)scobjs.length(); i++) {
402 // Scalar replaced objects. 408 // Scalar replaced objects.
403 st->print_cr(""); 409 st->print_cr("");
906 int nextmon = jvms()->scloff(); 912 int nextmon = jvms()->scloff();
907 if (GenerateSynchronizationCode) { 913 if (GenerateSynchronizationCode) {
908 add_req(lock->box_node()); 914 add_req(lock->box_node());
909 add_req(lock->obj_node()); 915 add_req(lock->obj_node());
910 } else { 916 } else {
911 add_req(NULL); 917 Node* top = Compile::current()->top();
912 add_req(NULL); 918 add_req(top);
919 add_req(top);
913 } 920 }
914 jvms()->set_scloff(nextmon+MonitorEdges); 921 jvms()->set_scloff(nextmon+MonitorEdges);
915 jvms()->set_endoff(req()); 922 jvms()->set_endoff(req());
916 } 923 }
917 924
1380 // one computed above. 1387 // one computed above.
1381 if (result == NULL && can_reshape && EliminateLocks && !is_eliminated()) { 1388 if (result == NULL && can_reshape && EliminateLocks && !is_eliminated()) {
1382 // 1389 //
1383 // If we are locking an unescaped object, the lock/unlock is unnecessary 1390 // If we are locking an unescaped object, the lock/unlock is unnecessary
1384 // 1391 //
1385 ConnectionGraph *cgr = Compile::current()->congraph(); 1392 ConnectionGraph *cgr = phase->C->congraph();
1386 PointsToNode::EscapeState es = PointsToNode::GlobalEscape; 1393 PointsToNode::EscapeState es = PointsToNode::GlobalEscape;
1387 if (cgr != NULL) 1394 if (cgr != NULL)
1388 es = cgr->escape_state(obj_node(), phase); 1395 es = cgr->escape_state(obj_node(), phase);
1389 if (es != PointsToNode::UnknownEscape && es != PointsToNode::GlobalEscape) { 1396 if (es != PointsToNode::UnknownEscape && es != PointsToNode::GlobalEscape) {
1390 // Mark it eliminated to update any counters 1397 // Mark it eliminated to update any counters
1448 for (int i = 0; i < lock_ops.length(); i++) { 1455 for (int i = 0; i < lock_ops.length(); i++) {
1449 AbstractLockNode* lock = lock_ops.at(i); 1456 AbstractLockNode* lock = lock_ops.at(i);
1450 1457
1451 // Mark it eliminated to update any counters 1458 // Mark it eliminated to update any counters
1452 lock->set_eliminated(); 1459 lock->set_eliminated();
1460 lock->set_coarsened();
1453 } 1461 }
1454 } else if (result != NULL && ctrl->is_Region() && 1462 } else if (result != NULL && ctrl->is_Region() &&
1455 iter->_worklist.member(ctrl)) { 1463 iter->_worklist.member(ctrl)) {
1456 // We weren't able to find any opportunities but the region this 1464 // We weren't able to find any opportunities but the region this
1457 // lock is control dependent on hasn't been processed yet so put 1465 // lock is control dependent on hasn't been processed yet so put
1482 // Escape state is defined after Parse phase. 1490 // Escape state is defined after Parse phase.
1483 if (result == NULL && can_reshape && EliminateLocks && !is_eliminated()) { 1491 if (result == NULL && can_reshape && EliminateLocks && !is_eliminated()) {
1484 // 1492 //
1485 // If we are unlocking an unescaped object, the lock/unlock is unnecessary. 1493 // If we are unlocking an unescaped object, the lock/unlock is unnecessary.
1486 // 1494 //
1487 ConnectionGraph *cgr = Compile::current()->congraph(); 1495 ConnectionGraph *cgr = phase->C->congraph();
1488 PointsToNode::EscapeState es = PointsToNode::GlobalEscape; 1496 PointsToNode::EscapeState es = PointsToNode::GlobalEscape;
1489 if (cgr != NULL) 1497 if (cgr != NULL)
1490 es = cgr->escape_state(obj_node(), phase); 1498 es = cgr->escape_state(obj_node(), phase);
1491 if (es != PointsToNode::UnknownEscape && es != PointsToNode::GlobalEscape) { 1499 if (es != PointsToNode::UnknownEscape && es != PointsToNode::GlobalEscape) {
1492 // Mark it eliminated to update any counters 1500 // Mark it eliminated to update any counters