提交 876ef744 编写于 作者: K kvn

7129618: assert(obj_node->eqv_uncast(obj),"");

Summary: Relax verification and locks elimination checks for new implementation (EliminateNestedLocks).
Reviewed-by: iveresov
上级 056914ad
......@@ -118,35 +118,12 @@ bool BoxLockNode::is_simple_lock_region(LockNode** unique_lock, Node* obj) {
FastLockNode* flock = n->as_FastLock();
assert((flock->box_node() == this) && flock->obj_node()->eqv_uncast(obj),"");
}
if (n->is_SafePoint() && n->as_SafePoint()->jvms()) {
SafePointNode* sfn = n->as_SafePoint();
JVMState* youngest_jvms = sfn->jvms();
int max_depth = youngest_jvms->depth();
for (int depth = 1; depth <= max_depth; depth++) {
JVMState* jvms = youngest_jvms->of_depth(depth);
int num_mon = jvms->nof_monitors();
// Loop over monitors
for (int idx = 0; idx < num_mon; idx++) {
Node* obj_node = sfn->monitor_obj(jvms, idx);
Node* box_node = sfn->monitor_box(jvms, idx);
if (box_node == this) {
if (!obj_node->eqv_uncast(obj)) {
tty->cr();
tty->print_cr("=====monitor info has different obj=====");
tty->print_cr("obj:");
obj->dump(1); tty->cr();
tty->print_cr("obj uncast:");
obj->uncast()->dump(); tty->cr();
tty->print_cr("obj_node:");
obj_node->dump(1); tty->cr();
tty->print_cr("obj_node uncast:");
obj_node->uncast()->dump();
}
assert(obj_node->eqv_uncast(obj),"monitor info has different obj");
}
}
}
}
// Don't check monitor info in safepoints since the referenced object could
// be different from the locked object. It could be Phi node of different
// cast nodes which point to this locked object.
// We assume that no other objects could be referenced in monitor info
// associated with this BoxLock node because all associated locks and
// unlocks are reference only this one object.
}
#endif
if (unique_lock != NULL && has_one_lock) {
......
......@@ -1802,10 +1802,14 @@ void PhaseMacroExpand::expand_allocate_array(AllocateArrayNode *alloc) {
// Mark all associated (same box and obj) lock and unlock nodes for
// elimination if some of them marked already.
void PhaseMacroExpand::mark_eliminated_box(Node* oldbox, Node* obj) {
if (oldbox->is_BoxLock() && oldbox->as_BoxLock()->is_eliminated())
return;
if (oldbox->is_BoxLock() &&
if (oldbox->as_BoxLock()->is_eliminated())
return; // This BoxLock node was processed already.
// New implementation (EliminateNestedLocks) has separate BoxLock
// node for each locked region so mark all associated locks/unlocks as
// eliminated even if different objects are referenced in one locked region
// (for example, OSR compilation of nested loop inside locked scope).
if (EliminateNestedLocks ||
oldbox->as_BoxLock()->is_simple_lock_region(NULL, obj)) {
// Box is used only in one lock region. Mark this box as eliminated.
_igvn.hash_delete(oldbox);
......@@ -1818,7 +1822,6 @@ void PhaseMacroExpand::mark_eliminated_box(Node* oldbox, Node* obj) {
AbstractLockNode* alock = u->as_AbstractLock();
// Check lock's box since box could be referenced by Lock's debug info.
if (alock->box_node() == oldbox) {
assert(alock->obj_node()->eqv_uncast(obj), "");
// Mark eliminated all related locks and unlocks.
alock->set_non_esc_obj();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册