# HG changeset patch # Parent 6075f6799044c92941569c188efb3a3208b34236 diff -r 6075f6799044 -r 1f3e014a6d3d src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp Fri Feb 22 12:21:36 2019 +0100 +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp Wed Mar 06 10:42:31 2019 +0100 @@ -1458,16 +1458,11 @@ assert(val->bottom_type()->make_oopptr(), "need oop"); assert(val->bottom_type()->make_oopptr()->const_oop() == NULL, "expect non-constant"); - enum { _heap_stable = 1, _heap_unstable, PATH_LIMIT }; + enum { _heap_stable = 1, _not_cset, _not_equal, _evac_path, _null_path, PATH_LIMIT }; Node* region = new RegionNode(PATH_LIMIT); Node* val_phi = new PhiNode(region, uncasted_val->bottom_type()->is_oopptr()); Node* raw_mem_phi = PhiNode::make(region, raw_mem, Type::MEMORY, TypeRawPtr::BOTTOM); - enum { _not_cset = 1, _not_equal, _evac_path, _null_path, PATH_LIMIT2 }; - Node* region2 = new RegionNode(PATH_LIMIT2); - Node* val_phi2 = new PhiNode(region2, uncasted_val->bottom_type()->is_oopptr()); - Node* raw_mem_phi2 = PhiNode::make(region2, raw_mem, Type::MEMORY, TypeRawPtr::BOTTOM); - // Stable path. test_heap_stable(ctrl, raw_mem, heap_stable_ctrl, phase); IfNode* heap_stable_iff = heap_stable_ctrl->in(0)->as_If(); @@ -1482,13 +1477,13 @@ test_null(ctrl, val, null_ctrl, phase); if (null_ctrl != NULL) { reg2_ctrl = null_ctrl->in(0); - region2->init_req(_null_path, null_ctrl); - val_phi2->init_req(_null_path, uncasted_val); - raw_mem_phi2->init_req(_null_path, raw_mem); + region->init_req(_null_path, null_ctrl); + val_phi->init_req(_null_path, uncasted_val); + raw_mem_phi->init_req(_null_path, raw_mem); } else { - region2->del_req(_null_path); - val_phi2->del_req(_null_path); - raw_mem_phi2->del_req(_null_path); + region->del_req(_null_path); + val_phi->del_req(_null_path); + raw_mem_phi->del_req(_null_path); } // Test for in-cset. @@ -1497,22 +1492,14 @@ in_cset_fast_test(ctrl, not_cset_ctrl, uncasted_val, raw_mem, phase); if (not_cset_ctrl != NULL) { if (reg2_ctrl == NULL) reg2_ctrl = not_cset_ctrl->in(0); - region2->init_req(_not_cset, not_cset_ctrl); - val_phi2->init_req(_not_cset, uncasted_val); - raw_mem_phi2->init_req(_not_cset, raw_mem); + region->init_req(_not_cset, not_cset_ctrl); + val_phi->init_req(_not_cset, uncasted_val); + raw_mem_phi->init_req(_not_cset, raw_mem); } // Resolve object when orig-value is in cset. // Make the unconditional resolve for fwdptr, not the read barrier. Node* new_val = uncasted_val; - if (unc_ctrl != NULL) { - // Clone the null check in this branch to allow implicit null check - new_val = clone_null_check(ctrl, val, unc_ctrl, phase); - fix_null_check(unc, unc_ctrl, ctrl->in(0)->as_If()->proj_out(0), uses, phase); - - IfNode* iff = unc_ctrl->in(0)->as_If(); - phase->igvn().replace_input_of(iff, 1, phase->igvn().intcon(1)); - } Node* addr = new AddPNode(new_val, uncasted_val, phase->igvn().MakeConX(ShenandoahBrooksPointer::byte_offset())); phase->register_new_node(addr, ctrl); assert(val->bottom_type()->isa_oopptr(), "what else?"); @@ -1536,25 +1523,17 @@ phase->register_control(if_eq, loop, iff); // Wire up not-equal-path in slots 3. - region2->init_req(_not_equal, if_not_eq); - val_phi2->init_req(_not_equal, fwd); - raw_mem_phi2->init_req(_not_equal, raw_mem); + region->init_req(_not_equal, if_not_eq); + val_phi->init_req(_not_equal, fwd); + raw_mem_phi->init_req(_not_equal, raw_mem); // Call wb-stub and wire up that path in slots 4 Node* result_mem = NULL; ctrl = if_eq; call_lrb_stub(ctrl, fwd, result_mem, raw_mem, phase); - region2->init_req(_evac_path, ctrl); - val_phi2->init_req(_evac_path, fwd); - raw_mem_phi2->init_req(_evac_path, result_mem); - - phase->register_control(region2, loop, reg2_ctrl); - phase->register_new_node(val_phi2, region2); - phase->register_new_node(raw_mem_phi2, region2); - - region->init_req(_heap_unstable, region2); - val_phi->init_req(_heap_unstable, val_phi2); - raw_mem_phi->init_req(_heap_unstable, raw_mem_phi2); + region->init_req(_evac_path, ctrl); + val_phi->init_req(_evac_path, fwd); + raw_mem_phi->init_req(_evac_path, result_mem); phase->register_control(region, loop, heap_stable_iff); Node* out_val = val_phi;