1800 // before) are connected to this new obj (phi) but they still will not be |
1800 // before) are connected to this new obj (phi) but they still will not be |
1801 // marked for elimination since new obj has no escape information. |
1801 // marked for elimination since new obj has no escape information. |
1802 // Mark all associated (same box and obj) lock and unlock nodes for |
1802 // Mark all associated (same box and obj) lock and unlock nodes for |
1803 // elimination if some of them marked already. |
1803 // elimination if some of them marked already. |
1804 void PhaseMacroExpand::mark_eliminated_box(Node* oldbox, Node* obj) { |
1804 void PhaseMacroExpand::mark_eliminated_box(Node* oldbox, Node* obj) { |
1805 if (oldbox->is_BoxLock() && oldbox->as_BoxLock()->is_eliminated()) |
1805 if (oldbox->as_BoxLock()->is_eliminated()) |
1806 return; |
1806 return; // This BoxLock node was processed already. |
1807 |
1807 |
1808 if (oldbox->is_BoxLock() && |
1808 // New implementation (EliminateNestedLocks) has separate BoxLock |
|
1809 // node for each locked region so mark all associated locks/unlocks as |
|
1810 // eliminated even if different objects are referenced in one locked region |
|
1811 // (for example, OSR compilation of nested loop inside locked scope). |
|
1812 if (EliminateNestedLocks || |
1809 oldbox->as_BoxLock()->is_simple_lock_region(NULL, obj)) { |
1813 oldbox->as_BoxLock()->is_simple_lock_region(NULL, obj)) { |
1810 // Box is used only in one lock region. Mark this box as eliminated. |
1814 // Box is used only in one lock region. Mark this box as eliminated. |
1811 _igvn.hash_delete(oldbox); |
1815 _igvn.hash_delete(oldbox); |
1812 oldbox->as_BoxLock()->set_eliminated(); // This changes box's hash value |
1816 oldbox->as_BoxLock()->set_eliminated(); // This changes box's hash value |
1813 _igvn.hash_insert(oldbox); |
1817 _igvn.hash_insert(oldbox); |
1816 Node* u = oldbox->raw_out(i); |
1820 Node* u = oldbox->raw_out(i); |
1817 if (u->is_AbstractLock() && !u->as_AbstractLock()->is_non_esc_obj()) { |
1821 if (u->is_AbstractLock() && !u->as_AbstractLock()->is_non_esc_obj()) { |
1818 AbstractLockNode* alock = u->as_AbstractLock(); |
1822 AbstractLockNode* alock = u->as_AbstractLock(); |
1819 // Check lock's box since box could be referenced by Lock's debug info. |
1823 // Check lock's box since box could be referenced by Lock's debug info. |
1820 if (alock->box_node() == oldbox) { |
1824 if (alock->box_node() == oldbox) { |
1821 assert(alock->obj_node()->eqv_uncast(obj), ""); |
|
1822 // Mark eliminated all related locks and unlocks. |
1825 // Mark eliminated all related locks and unlocks. |
1823 alock->set_non_esc_obj(); |
1826 alock->set_non_esc_obj(); |
1824 } |
1827 } |
1825 } |
1828 } |
1826 } |
1829 } |