Mercurial > hg > graal-compiler
comparison src/share/vm/opto/locknode.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 | 89d0a5d40008 |
comparison
equal
deleted
inserted
replaced
4779:c8d8e124380c | 4790:b0ff910edfc9 |
---|---|
61 const BoxLockNode &bn = (const BoxLockNode &)n; | 61 const BoxLockNode &bn = (const BoxLockNode &)n; |
62 return bn._slot == _slot && bn._is_eliminated == _is_eliminated; | 62 return bn._slot == _slot && bn._is_eliminated == _is_eliminated; |
63 } | 63 } |
64 | 64 |
65 BoxLockNode* BoxLockNode::box_node(Node* box) { | 65 BoxLockNode* BoxLockNode::box_node(Node* box) { |
66 // Chase down the BoxNode | 66 // Chase down the BoxNode after RA which may spill box nodes. |
67 while (!box->is_BoxLock()) { | 67 while (!box->is_BoxLock()) { |
68 // if (box_node->is_SpillCopy()) { | 68 // if (box_node->is_SpillCopy()) { |
69 // Node *m = box_node->in(1); | 69 // Node *m = box_node->in(1); |
70 // if (m->is_Mach() && m->as_Mach()->ideal_Opcode() == Op_StoreP) { | 70 // if (m->is_Mach() && m->as_Mach()->ideal_Opcode() == Op_StoreP) { |
71 // box_node = m->in(m->as_Mach()->operand_index(2)); | 71 // box_node = m->in(m->as_Mach()->operand_index(2)); |
82 | 82 |
83 OptoReg::Name BoxLockNode::reg(Node* box) { | 83 OptoReg::Name BoxLockNode::reg(Node* box) { |
84 return box_node(box)->in_RegMask(0).find_first_elem(); | 84 return box_node(box)->in_RegMask(0).find_first_elem(); |
85 } | 85 } |
86 | 86 |
87 bool BoxLockNode::same_slot(Node* box1, Node* box2) { | |
88 return box_node(box1)->_slot == box_node(box2)->_slot; | |
89 } | |
90 | |
91 // Is BoxLock node used for one simple lock region (same box and obj)? | 87 // Is BoxLock node used for one simple lock region (same box and obj)? |
92 bool BoxLockNode::is_simple_lock_region(LockNode** unique_lock, Node* obj) { | 88 bool BoxLockNode::is_simple_lock_region(LockNode** unique_lock, Node* obj) { |
93 LockNode* lock = NULL; | 89 LockNode* lock = NULL; |
94 bool has_one_lock = false; | 90 bool has_one_lock = false; |
95 for (uint i = 0; i < this->outcnt(); i++) { | 91 for (uint i = 0; i < this->outcnt(); i++) { |
96 Node* n = this->raw_out(i); | 92 Node* n = this->raw_out(i); |
97 if (n->is_Phi()) | 93 assert(!n->is_Phi(), "should not merge BoxLock nodes"); |
98 return false; // Merged regions | |
99 if (n->is_AbstractLock()) { | 94 if (n->is_AbstractLock()) { |
100 AbstractLockNode* alock = n->as_AbstractLock(); | 95 AbstractLockNode* alock = n->as_AbstractLock(); |
101 // Check lock's box since box could be referenced by Lock's debug info. | 96 // Check lock's box since box could be referenced by Lock's debug info. |
102 if (alock->box_node() == this) { | 97 if (alock->box_node() == this) { |
103 if (alock->obj_node()->eqv_uncast(obj)) { | 98 if (alock->obj_node()->eqv_uncast(obj)) { |
133 // Loop over monitors | 128 // Loop over monitors |
134 for (int idx = 0; idx < num_mon; idx++) { | 129 for (int idx = 0; idx < num_mon; idx++) { |
135 Node* obj_node = sfn->monitor_obj(jvms, idx); | 130 Node* obj_node = sfn->monitor_obj(jvms, idx); |
136 Node* box_node = sfn->monitor_box(jvms, idx); | 131 Node* box_node = sfn->monitor_box(jvms, idx); |
137 if (box_node == this) { | 132 if (box_node == this) { |
138 assert(obj_node->eqv_uncast(obj),""); | 133 if (!obj_node->eqv_uncast(obj)) { |
134 tty->cr(); | |
135 tty->print_cr("=====monitor info has different obj====="); | |
136 tty->print_cr("obj:"); | |
137 obj->dump(1); tty->cr(); | |
138 tty->print_cr("obj uncast:"); | |
139 obj->uncast()->dump(); tty->cr(); | |
140 tty->print_cr("obj_node:"); | |
141 obj_node->dump(1); tty->cr(); | |
142 tty->print_cr("obj_node uncast:"); | |
143 obj_node->uncast()->dump(); | |
144 } | |
145 assert(obj_node->eqv_uncast(obj),"monitor info has different obj"); | |
139 } | 146 } |
140 } | 147 } |
141 } | 148 } |
142 } | 149 } |
143 } | 150 } |