Mercurial > hg > truffle
comparison src/share/vm/opto/callnode.cpp @ 4790:b0ff910edfc9
7128355: assert(!nocreate) failed: Cannot build a phi for a block already parsed
Summary: Do not common BoxLock nodes and avoid creating phis of boxes.
Reviewed-by: never
author | kvn |
---|---|
date | Thu, 12 Jan 2012 14:45:04 -0800 |
parents | 35acf8f0a2e4 |
children | ee138854b3a6 |
comparison
equal
deleted
inserted
replaced
4779:c8d8e124380c | 4790:b0ff910edfc9 |
---|---|
1623 return result; | 1623 return result; |
1624 } | 1624 } |
1625 | 1625 |
1626 //============================================================================= | 1626 //============================================================================= |
1627 bool LockNode::is_nested_lock_region() { | 1627 bool LockNode::is_nested_lock_region() { |
1628 Node* box = box_node(); | 1628 BoxLockNode* box = box_node()->as_BoxLock(); |
1629 if (!box->is_BoxLock() || box->as_BoxLock()->stack_slot() <= 0) | 1629 int stk_slot = box->stack_slot(); |
1630 if (stk_slot <= 0) | |
1630 return false; // External lock or it is not Box (Phi node). | 1631 return false; // External lock or it is not Box (Phi node). |
1631 | 1632 |
1632 // Ignore complex cases: merged locks or multiple locks. | 1633 // Ignore complex cases: merged locks or multiple locks. |
1633 BoxLockNode* box_lock = box->as_BoxLock(); | |
1634 Node* obj = obj_node(); | 1634 Node* obj = obj_node(); |
1635 LockNode* unique_lock = NULL; | 1635 LockNode* unique_lock = NULL; |
1636 if (!box_lock->is_simple_lock_region(&unique_lock, obj) || | 1636 if (!box->is_simple_lock_region(&unique_lock, obj) || |
1637 (unique_lock != this)) { | 1637 (unique_lock != this)) { |
1638 return false; | 1638 return false; |
1639 } | 1639 } |
1640 | 1640 |
1641 // Look for external lock for the same object. | 1641 // Look for external lock for the same object. |
1642 int stk_slot = box_lock->stack_slot(); | |
1643 SafePointNode* sfn = this->as_SafePoint(); | 1642 SafePointNode* sfn = this->as_SafePoint(); |
1644 JVMState* youngest_jvms = sfn->jvms(); | 1643 JVMState* youngest_jvms = sfn->jvms(); |
1645 int max_depth = youngest_jvms->depth(); | 1644 int max_depth = youngest_jvms->depth(); |
1646 for (int depth = 1; depth <= max_depth; depth++) { | 1645 for (int depth = 1; depth <= max_depth; depth++) { |
1647 JVMState* jvms = youngest_jvms->of_depth(depth); | 1646 JVMState* jvms = youngest_jvms->of_depth(depth); |
1648 int num_mon = jvms->nof_monitors(); | 1647 int num_mon = jvms->nof_monitors(); |
1649 // Loop over monitors | 1648 // Loop over monitors |
1650 for (int idx = 0; idx < num_mon; idx++) { | 1649 for (int idx = 0; idx < num_mon; idx++) { |
1651 Node* obj_node = sfn->monitor_obj(jvms, idx); | 1650 Node* obj_node = sfn->monitor_obj(jvms, idx); |
1652 BoxLockNode* box_node = BoxLockNode::box_node(sfn->monitor_box(jvms, idx)); | 1651 BoxLockNode* box_node = sfn->monitor_box(jvms, idx)->as_BoxLock(); |
1653 if ((box_node->stack_slot() < stk_slot) && obj_node->eqv_uncast(obj)) { | 1652 if ((box_node->stack_slot() < stk_slot) && obj_node->eqv_uncast(obj)) { |
1654 return true; | 1653 return true; |
1655 } | 1654 } |
1656 } | 1655 } |
1657 } | 1656 } |