8263041: Shenandoah: Cleanup C1 keep alive barrier check

Reviewed-by: shade, rkennke
This commit is contained in:
Zhengyu Gu 2021-03-08 18:07:34 +00:00
parent 1f9ed9059f
commit a2b8858131
2 changed files with 14 additions and 19 deletions

View File

@ -220,27 +220,22 @@ void ShenandoahBarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result)
BarrierSetC1::load_at_resolved(access, result);
}
// 3: apply keep-alive barrier if ShenandoahSATBBarrier is set
if (ShenandoahSATBBarrier) {
bool is_weak = (decorators & ON_WEAK_OOP_REF) != 0;
bool is_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
// 3: apply keep-alive barrier for java.lang.ref.Reference if needed
if (ShenandoahBarrierSet::need_keep_alive_barrier(decorators, type)) {
bool is_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
if ((is_weak || is_phantom || is_anonymous) && keep_alive) {
// Register the value in the referent field with the pre-barrier
LabelObj *Lcont_anonymous;
if (is_anonymous) {
Lcont_anonymous = new LabelObj();
generate_referent_check(access, Lcont_anonymous);
}
pre_barrier(gen, access.access_emit_info(), decorators, LIR_OprFact::illegalOpr /* addr_opr */,
result /* pre_val */);
if (is_anonymous) {
__ branch_destination(Lcont_anonymous->label());
}
// Register the value in the referent field with the pre-barrier
LabelObj *Lcont_anonymous;
if (is_anonymous) {
Lcont_anonymous = new LabelObj();
generate_referent_check(access, Lcont_anonymous);
}
}
pre_barrier(gen, access.access_emit_info(), decorators, LIR_OprFact::illegalOpr /* addr_opr */,
result /* pre_val */);
if (is_anonymous) {
__ branch_destination(Lcont_anonymous->label());
}
}
}
class C1ShenandoahPreBarrierCodeGenClosure : public StubAssemblerCodeGenClosure {

View File

@ -551,7 +551,7 @@ Node* ShenandoahBarrierSetC2::load_at_resolved(C2Access& access, const Type* val
}
}
// 3: apply keep-alive barrier if needed
// 3: apply keep-alive barrier for java.lang.ref.Reference if needed
if (ShenandoahBarrierSet::need_keep_alive_barrier(decorators, type)) {
Node* top = Compile::current()->top();
Node* adr = access.addr().node();