提交 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) { ...@@ -118,35 +118,12 @@ bool BoxLockNode::is_simple_lock_region(LockNode** unique_lock, Node* obj) {
FastLockNode* flock = n->as_FastLock(); FastLockNode* flock = n->as_FastLock();
assert((flock->box_node() == this) && flock->obj_node()->eqv_uncast(obj),""); assert((flock->box_node() == this) && flock->obj_node()->eqv_uncast(obj),"");
} }
if (n->is_SafePoint() && n->as_SafePoint()->jvms()) { // Don't check monitor info in safepoints since the referenced object could
SafePointNode* sfn = n->as_SafePoint(); // be different from the locked object. It could be Phi node of different
JVMState* youngest_jvms = sfn->jvms(); // cast nodes which point to this locked object.
int max_depth = youngest_jvms->depth(); // We assume that no other objects could be referenced in monitor info
for (int depth = 1; depth <= max_depth; depth++) { // associated with this BoxLock node because all associated locks and
JVMState* jvms = youngest_jvms->of_depth(depth); // unlocks are reference only this one object.
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");
}
}
}
}
} }
#endif #endif
if (unique_lock != NULL && has_one_lock) { if (unique_lock != NULL && has_one_lock) {
......
...@@ -1802,10 +1802,14 @@ void PhaseMacroExpand::expand_allocate_array(AllocateArrayNode *alloc) { ...@@ -1802,10 +1802,14 @@ void PhaseMacroExpand::expand_allocate_array(AllocateArrayNode *alloc) {
// Mark all associated (same box and obj) lock and unlock nodes for // Mark all associated (same box and obj) lock and unlock nodes for
// elimination if some of them marked already. // elimination if some of them marked already.
void PhaseMacroExpand::mark_eliminated_box(Node* oldbox, Node* obj) { void PhaseMacroExpand::mark_eliminated_box(Node* oldbox, Node* obj) {
if (oldbox->is_BoxLock() && oldbox->as_BoxLock()->is_eliminated()) if (oldbox->as_BoxLock()->is_eliminated())
return; return; // This BoxLock node was processed already.
if (oldbox->is_BoxLock() && // 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)) { oldbox->as_BoxLock()->is_simple_lock_region(NULL, obj)) {
// Box is used only in one lock region. Mark this box as eliminated. // Box is used only in one lock region. Mark this box as eliminated.
_igvn.hash_delete(oldbox); _igvn.hash_delete(oldbox);
...@@ -1818,7 +1822,6 @@ void PhaseMacroExpand::mark_eliminated_box(Node* oldbox, Node* obj) { ...@@ -1818,7 +1822,6 @@ void PhaseMacroExpand::mark_eliminated_box(Node* oldbox, Node* obj) {
AbstractLockNode* alock = u->as_AbstractLock(); AbstractLockNode* alock = u->as_AbstractLock();
// Check lock's box since box could be referenced by Lock's debug info. // Check lock's box since box could be referenced by Lock's debug info.
if (alock->box_node() == oldbox) { if (alock->box_node() == oldbox) {
assert(alock->obj_node()->eqv_uncast(obj), "");
// Mark eliminated all related locks and unlocks. // Mark eliminated all related locks and unlocks.
alock->set_non_esc_obj(); alock->set_non_esc_obj();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册