1.1 --- a/src/share/vm/opto/locknode.cpp Fri Jan 13 00:51:43 2012 -0800 1.2 +++ b/src/share/vm/opto/locknode.cpp Fri Jan 13 12:58:26 2012 -0800 1.3 @@ -118,35 +118,12 @@ 1.4 FastLockNode* flock = n->as_FastLock(); 1.5 assert((flock->box_node() == this) && flock->obj_node()->eqv_uncast(obj),""); 1.6 } 1.7 - if (n->is_SafePoint() && n->as_SafePoint()->jvms()) { 1.8 - SafePointNode* sfn = n->as_SafePoint(); 1.9 - JVMState* youngest_jvms = sfn->jvms(); 1.10 - int max_depth = youngest_jvms->depth(); 1.11 - for (int depth = 1; depth <= max_depth; depth++) { 1.12 - JVMState* jvms = youngest_jvms->of_depth(depth); 1.13 - int num_mon = jvms->nof_monitors(); 1.14 - // Loop over monitors 1.15 - for (int idx = 0; idx < num_mon; idx++) { 1.16 - Node* obj_node = sfn->monitor_obj(jvms, idx); 1.17 - Node* box_node = sfn->monitor_box(jvms, idx); 1.18 - if (box_node == this) { 1.19 - if (!obj_node->eqv_uncast(obj)) { 1.20 - tty->cr(); 1.21 - tty->print_cr("=====monitor info has different obj====="); 1.22 - tty->print_cr("obj:"); 1.23 - obj->dump(1); tty->cr(); 1.24 - tty->print_cr("obj uncast:"); 1.25 - obj->uncast()->dump(); tty->cr(); 1.26 - tty->print_cr("obj_node:"); 1.27 - obj_node->dump(1); tty->cr(); 1.28 - tty->print_cr("obj_node uncast:"); 1.29 - obj_node->uncast()->dump(); 1.30 - } 1.31 - assert(obj_node->eqv_uncast(obj),"monitor info has different obj"); 1.32 - } 1.33 - } 1.34 - } 1.35 - } 1.36 + // Don't check monitor info in safepoints since the referenced object could 1.37 + // be different from the locked object. It could be Phi node of different 1.38 + // cast nodes which point to this locked object. 1.39 + // We assume that no other objects could be referenced in monitor info 1.40 + // associated with this BoxLock node because all associated locks and 1.41 + // unlocks are reference only this one object. 1.42 } 1.43 #endif 1.44 if (unique_lock != NULL && has_one_lock) {