Skip to content

Commit

Permalink
8244594: [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 7, 2020
1 parent 2f9cfb1 commit 441e4cd
Show file tree
Hide file tree
Showing 4 changed files with 285 additions and 44 deletions.
34 changes: 3 additions & 31 deletions src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp
Expand Up @@ -481,16 +481,16 @@ const TypeFunc* ShenandoahBarrierSetC2::shenandoah_clone_barrier_Type() {
return TypeFunc::make(domain, range); 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); 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 fields[TypeFunc::Parms+1] = TypeRawPtr::BOTTOM; // original load address


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


// create result type (range) // create result type (range)
fields = TypeTuple::fields(1); 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); const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+1, fields);


return TypeFunc::make(domain, range); return TypeFunc::make(domain, range);
Expand Down Expand Up @@ -1045,20 +1045,6 @@ void ShenandoahBarrierSetC2::verify_gc_barriers(Compile* compile, CompilePhase p
} }
#endif #endif


bool ShenandoahBarrierSetC2::maybe_skip_barrier(Node* n, uint i, PhaseGVN* phase) const {
PhaseIterGVN* igvn = phase->is_IterGVN();
Node* in = step_over_gc_barrier(n->in(i));
if (in != n->in(i)) {
if (igvn != NULL) {
n->set_req_X(i, in, igvn);
} else {
n->set_req(i, in);
}
return true;
}
return false;
}

Node* ShenandoahBarrierSetC2::ideal_node(PhaseGVN* phase, Node* n, bool can_reshape) const { Node* ShenandoahBarrierSetC2::ideal_node(PhaseGVN* phase, Node* n, bool can_reshape) const {
if (is_shenandoah_wb_pre_call(n)) { if (is_shenandoah_wb_pre_call(n)) {
uint cnt = ShenandoahBarrierSetC2::write_ref_field_pre_entry_Type()->domain()->cnt(); uint cnt = ShenandoahBarrierSetC2::write_ref_field_pre_entry_Type()->domain()->cnt();
Expand Down Expand Up @@ -1100,20 +1086,6 @@ Node* ShenandoahBarrierSetC2::ideal_node(PhaseGVN* phase, Node* n, bool can_resh
} }
return n; return n;
} }
} else if (n->Opcode() == Op_CallStaticJava) {
if (n->as_CallStaticJava()->uncommon_trap_request() != 0) {
// Uncommon traps don't need barriers, values are handled
// during deoptimization. It also affects optimizing null-checks
// into implicit null-checks.
PhaseIterGVN* igvn = phase->is_IterGVN();
Node* ret = NULL;
for (uint i = TypeFunc::Parms; i < n->len(); i++) {
if (maybe_skip_barrier(n, i, phase)) {
ret = n;
}
}
return ret;
}
} else if (can_reshape && } else if (can_reshape &&
n->Opcode() == Op_If && n->Opcode() == Op_If &&
ShenandoahBarrierC2Support::is_heap_stable_test(n) && ShenandoahBarrierC2Support::is_heap_stable_test(n) &&
Expand Down
Expand Up @@ -81,8 +81,6 @@ class ShenandoahBarrierSetC2 : public BarrierSetC2 {


static bool clone_needs_barrier(Node* src, PhaseGVN& gvn); static bool clone_needs_barrier(Node* src, PhaseGVN& gvn);


bool maybe_skip_barrier(Node* n, uint i, PhaseGVN* phase) const;

protected: protected:
virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const; virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const;
virtual Node* store_at_resolved(C2Access& access, C2AccessValue& val) const; virtual Node* store_at_resolved(C2Access& access, C2AccessValue& val) const;
Expand All @@ -105,7 +103,7 @@ class ShenandoahBarrierSetC2 : public BarrierSetC2 {


static const TypeFunc* write_ref_field_pre_entry_Type(); static const TypeFunc* write_ref_field_pre_entry_Type();
static const TypeFunc* shenandoah_clone_barrier_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; } virtual bool has_load_barrier_nodes() const { return true; }


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

0 comments on commit 441e4cd

Please sign in to comment.