Skip to content

Commit

Permalink
8244813: [BACKOUT] 8244523: Shenandoah: Remove null-handling in LRB e…
Browse files Browse the repository at this point in the history
…xpansion

Reviewed-by: shade
  • Loading branch information
rkennke committed May 12, 2020
1 parent 25dcb1f commit ba59fe9
Show file tree
Hide file tree
Showing 4 changed files with 316 additions and 23 deletions.
41 changes: 34 additions & 7 deletions src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,16 +481,16 @@ const TypeFunc* ShenandoahBarrierSetC2::shenandoah_clone_barrier_Type() {
return TypeFunc::make(domain, range);
}

const TypeFunc* ShenandoahBarrierSetC2::shenandoah_load_reference_barrier_Type(const Type* value_type) {
const TypeFunc* ShenandoahBarrierSetC2::shenandoah_load_reference_barrier_Type() {
const Type **fields = TypeTuple::fields(2);
fields[TypeFunc::Parms+0] = value_type; // original field value
fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL; // original field value
fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM; // original load address

const TypeTuple *domain = TypeTuple::make(TypeFunc::Parms+2, fields);

// create result type (range)
fields = TypeTuple::fields(1);
fields[TypeFunc::Parms+0] = value_type;
fields[TypeFunc::Parms+0] = TypeInstPtr::NOTNULL;
const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+1, fields);

return TypeFunc::make(domain, range);
Expand Down Expand Up @@ -1059,10 +1059,37 @@ Node* ShenandoahBarrierSetC2::ideal_node(PhaseGVN* phase, Node* n, bool can_resh
}
}
}
if (can_reshape &&
n->Opcode() == Op_If &&
ShenandoahBarrierC2Support::is_heap_stable_test(n) &&
n->in(0) != NULL) {
if (n->Opcode() == Op_CmpP) {
Node* in1 = n->in(1);
Node* in2 = n->in(2);
if (in1->bottom_type() == TypePtr::NULL_PTR) {
in2 = step_over_gc_barrier(in2);
}
if (in2->bottom_type() == TypePtr::NULL_PTR) {
in1 = step_over_gc_barrier(in1);
}
PhaseIterGVN* igvn = phase->is_IterGVN();
if (in1 != n->in(1)) {
if (igvn != NULL) {
n->set_req_X(1, in1, igvn);
} else {
n->set_req(1, in1);
}
assert(in2 == n->in(2), "only one change");
return n;
}
if (in2 != n->in(2)) {
if (igvn != NULL) {
n->set_req_X(2, in2, igvn);
} else {
n->set_req(2, in2);
}
return n;
}
} else if (can_reshape &&
n->Opcode() == Op_If &&
ShenandoahBarrierC2Support::is_heap_stable_test(n) &&
n->in(0) != NULL) {
Node* dom = n->in(0);
Node* prev_dom = n;
int op = n->Opcode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class ShenandoahBarrierSetC2 : public BarrierSetC2 {

static const TypeFunc* write_ref_field_pre_entry_Type();
static const TypeFunc* shenandoah_clone_barrier_Type();
static const TypeFunc* shenandoah_load_reference_barrier_Type(const Type* value_type);
static const TypeFunc* shenandoah_load_reference_barrier_Type();
virtual bool has_load_barrier_nodes() const { return true; }

// This is the entry-point for the backend to perform accesses through the Access API.
Expand Down
Loading

0 comments on commit ba59fe9

Please sign in to comment.