Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8254320: Shenandoah: C2 native LRB should activate for non-cset objects
Reviewed-by: roland, shade
  • Loading branch information
rkennke committed Oct 12, 2020
1 parent 295a44a commit dfe8ba6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp
Expand Up @@ -1325,7 +1325,7 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) {
assert(val->bottom_type()->make_oopptr(), "need oop");
assert(val->bottom_type()->make_oopptr()->const_oop() == NULL, "expect non-constant");

enum { _heap_stable = 1, _not_cset, _evac_path, PATH_LIMIT };
enum { _heap_stable = 1, _evac_path, _not_cset, PATH_LIMIT };
Node* region = new RegionNode(PATH_LIMIT);
Node* val_phi = new PhiNode(region, val->bottom_type()->is_oopptr());
Node* raw_mem_phi = PhiNode::make(region, raw_mem, Type::MEMORY, TypeRawPtr::BOTTOM);
Expand All @@ -1339,14 +1339,21 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) {
val_phi->init_req(_heap_stable, val);
raw_mem_phi->init_req(_heap_stable, raw_mem);

// Test for in-cset.
// Test for in-cset, unless it's a native-LRB. Native LRBs need to return NULL
// even for non-cset objects to prevent ressurrection of such objects.
// Wires !in_cset(obj) to slot 2 of region and phis
Node* not_cset_ctrl = NULL;
test_in_cset(ctrl, not_cset_ctrl, val, raw_mem, phase);
if (!lrb->is_native()) {
test_in_cset(ctrl, not_cset_ctrl, val, raw_mem, phase);
}
if (not_cset_ctrl != NULL) {
region->init_req(_not_cset, not_cset_ctrl);
val_phi->init_req(_not_cset, val);
raw_mem_phi->init_req(_not_cset, raw_mem);
} else {
region->del_req(_not_cset);
val_phi->del_req(_not_cset);
raw_mem_phi->del_req(_not_cset);
}

// Resolve object when orig-value is in cset.
Expand Down

1 comment on commit dfe8ba6

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on dfe8ba6 Oct 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.