< prev index next >

src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp

Print this page
rev 56465 : [mq]: fix.patch
rev 56466 : [mq]: fix-addr.patch


1513     Node* new_val = uncasted_val;
1514     if (unc_ctrl != NULL) {
1515       // Clone the null check in this branch to allow implicit null check
1516       new_val = clone_null_check(ctrl, val, unc_ctrl, phase);
1517       fix_null_check(unc, unc_ctrl, ctrl->in(0)->as_If()->proj_out(0), uses, phase);
1518 
1519       IfNode* iff = unc_ctrl->in(0)->as_If();
1520       phase->igvn().replace_input_of(iff, 1, phase->igvn().intcon(1));
1521     }
1522 
1523     // Call lrb-stub and wire up that path in slots 4
1524     Node* result_mem = NULL;
1525     Node* fwd = new_val;
1526     Node* addr;
1527     if (ShenandoahSelfFixing) {
1528       VectorSet visited(Thread::current()->resource_area());
1529       addr = get_load_addr(phase, visited, lrb);
1530     } else {
1531       addr = phase->igvn().zerocon(T_OBJECT);
1532     }













1533     call_lrb_stub(ctrl, fwd, addr, result_mem, raw_mem, phase);
1534     region->init_req(_evac_path, ctrl);
1535     val_phi->init_req(_evac_path, fwd);
1536     raw_mem_phi->init_req(_evac_path, result_mem);
1537 
1538     phase->register_control(region, loop, heap_stable_iff);
1539     Node* out_val = val_phi;
1540     phase->register_new_node(val_phi, region);
1541     phase->register_new_node(raw_mem_phi, region);
1542 
1543     fix_ctrl(lrb, region, fixer, uses, uses_to_ignore, last, phase);
1544 
1545     ctrl = orig_ctrl;
1546 
1547     if (unc != NULL) {
1548       for (DUIterator_Fast imax, i = val->fast_outs(imax); i < imax; i++) {
1549         Node* u = val->fast_out(i);
1550         Node* c = phase->ctrl_or_self(u);
1551         if (u != lrb && (c != ctrl || is_dominator_same_ctrl(c, lrb, u, phase))) {
1552           phase->igvn().rehash_node_delayed(u);


1762       for (uint i = 1; i < in->req(); i++) {
1763         Node* addr1 = get_load_addr(phase, visited, in->in(i));
1764         if (addr == NULL) {
1765           addr = addr1;
1766         }
1767         if (addr != addr1) {
1768           return phase->igvn().zerocon(T_OBJECT);
1769         }
1770       }
1771       return addr;
1772     }
1773     case Op_ShenandoahLoadReferenceBarrier:
1774       return get_load_addr(phase, visited, in->in(ShenandoahLoadReferenceBarrierNode::ValueIn));
1775     case Op_ShenandoahEnqueueBarrier:
1776       return get_load_addr(phase, visited, in->in(1));
1777     case Op_CallDynamicJava:
1778     case Op_CallLeaf:
1779     case Op_CallStaticJava:
1780     case Op_ConN:
1781     case Op_ConP:

1782       return phase->igvn().zerocon(T_OBJECT);
1783     default:
1784 #ifdef ASSERT
1785       in->dump();
1786       ShouldNotReachHere();
1787 #endif
1788       return phase->igvn().zerocon(T_OBJECT);
1789   }
1790 
1791 }
1792 
1793 void ShenandoahBarrierC2Support::move_heap_stable_test_out_of_loop(IfNode* iff, PhaseIdealLoop* phase) {
1794   IdealLoopTree *loop = phase->get_loop(iff);
1795   Node* loop_head = loop->_head;
1796   Node* entry_c = loop_head->in(LoopNode::EntryControl);
1797 
1798   Node* bol = iff->in(1);
1799   Node* cmp = bol->in(1);
1800   Node* andi = cmp->in(1);
1801   Node* load = andi->in(1);




1513     Node* new_val = uncasted_val;
1514     if (unc_ctrl != NULL) {
1515       // Clone the null check in this branch to allow implicit null check
1516       new_val = clone_null_check(ctrl, val, unc_ctrl, phase);
1517       fix_null_check(unc, unc_ctrl, ctrl->in(0)->as_If()->proj_out(0), uses, phase);
1518 
1519       IfNode* iff = unc_ctrl->in(0)->as_If();
1520       phase->igvn().replace_input_of(iff, 1, phase->igvn().intcon(1));
1521     }
1522 
1523     // Call lrb-stub and wire up that path in slots 4
1524     Node* result_mem = NULL;
1525     Node* fwd = new_val;
1526     Node* addr;
1527     if (ShenandoahSelfFixing) {
1528       VectorSet visited(Thread::current()->resource_area());
1529       addr = get_load_addr(phase, visited, lrb);
1530     } else {
1531       addr = phase->igvn().zerocon(T_OBJECT);
1532     }
1533     if (addr->Opcode() == Op_AddP) {
1534       Node* base = addr->in(AddPNode::Base);
1535       base = new CheckCastPPNode(ctrl, base, base->bottom_type(), true);
1536       phase->register_new_node(base, ctrl);
1537       Node* address = addr->in(AddPNode::Address);
1538       address = new CheckCastPPNode(ctrl, address, address->bottom_type(), true);
1539       phase->register_new_node(address, ctrl);
1540 
1541       addr = addr->clone();
1542       addr->set_req(AddPNode::Base, base);
1543       addr->set_req(AddPNode::Address, address);
1544       phase->register_new_node(addr, ctrl);
1545     }
1546     call_lrb_stub(ctrl, fwd, addr, result_mem, raw_mem, phase);
1547     region->init_req(_evac_path, ctrl);
1548     val_phi->init_req(_evac_path, fwd);
1549     raw_mem_phi->init_req(_evac_path, result_mem);
1550 
1551     phase->register_control(region, loop, heap_stable_iff);
1552     Node* out_val = val_phi;
1553     phase->register_new_node(val_phi, region);
1554     phase->register_new_node(raw_mem_phi, region);
1555 
1556     fix_ctrl(lrb, region, fixer, uses, uses_to_ignore, last, phase);
1557 
1558     ctrl = orig_ctrl;
1559 
1560     if (unc != NULL) {
1561       for (DUIterator_Fast imax, i = val->fast_outs(imax); i < imax; i++) {
1562         Node* u = val->fast_out(i);
1563         Node* c = phase->ctrl_or_self(u);
1564         if (u != lrb && (c != ctrl || is_dominator_same_ctrl(c, lrb, u, phase))) {
1565           phase->igvn().rehash_node_delayed(u);


1775       for (uint i = 1; i < in->req(); i++) {
1776         Node* addr1 = get_load_addr(phase, visited, in->in(i));
1777         if (addr == NULL) {
1778           addr = addr1;
1779         }
1780         if (addr != addr1) {
1781           return phase->igvn().zerocon(T_OBJECT);
1782         }
1783       }
1784       return addr;
1785     }
1786     case Op_ShenandoahLoadReferenceBarrier:
1787       return get_load_addr(phase, visited, in->in(ShenandoahLoadReferenceBarrierNode::ValueIn));
1788     case Op_ShenandoahEnqueueBarrier:
1789       return get_load_addr(phase, visited, in->in(1));
1790     case Op_CallDynamicJava:
1791     case Op_CallLeaf:
1792     case Op_CallStaticJava:
1793     case Op_ConN:
1794     case Op_ConP:
1795     case Op_Parm:
1796       return phase->igvn().zerocon(T_OBJECT);
1797     default:
1798 #ifdef ASSERT
1799       in->dump();
1800       ShouldNotReachHere();
1801 #endif
1802       return phase->igvn().zerocon(T_OBJECT);
1803   }
1804 
1805 }
1806 
1807 void ShenandoahBarrierC2Support::move_heap_stable_test_out_of_loop(IfNode* iff, PhaseIdealLoop* phase) {
1808   IdealLoopTree *loop = phase->get_loop(iff);
1809   Node* loop_head = loop->_head;
1810   Node* entry_c = loop_head->in(LoopNode::EntryControl);
1811 
1812   Node* bol = iff->in(1);
1813   Node* cmp = bol->in(1);
1814   Node* andi = cmp->in(1);
1815   Node* load = andi->in(1);


< prev index next >