< prev index next >
src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp
Print this page
rev 55922 : 8228369: Shenandoah: Refactor LRB C1 stubs
*** 112,123 ****
LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj) {
assert(ShenandoahLoadRefBarrier, "Should be enabled");
obj = ensure_in_register(gen, obj);
assert(obj->is_register(), "must be a register at this point");
! LIR_Opr result = gen->new_register(T_OBJECT);
__ move(obj, result);
LIR_Opr thrd = gen->getThreadPointer();
LIR_Address* active_flag_addr =
new LIR_Address(thrd,
in_bytes(ShenandoahThreadLocalData::gc_state_offset()),
--- 112,125 ----
LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj) {
assert(ShenandoahLoadRefBarrier, "Should be enabled");
obj = ensure_in_register(gen, obj);
assert(obj->is_register(), "must be a register at this point");
! LIR_Opr result = gen->result_register_for(obj->value_type());
__ move(obj, result);
+ LIR_Opr tmp1 = gen->new_register(T_OBJECT);
+ LIR_Opr tmp2 = gen->new_register(T_OBJECT);
LIR_Opr thrd = gen->getThreadPointer();
LIR_Address* active_flag_addr =
new LIR_Address(thrd,
in_bytes(ShenandoahThreadLocalData::gc_state_offset()),
*** 138,148 ****
__ logical_and(flag_val, mask_reg, masked_flag);
flag_val = masked_flag;
}
__ cmp(lir_cond_notEqual, flag_val, LIR_OprFact::intConst(0));
! CodeStub* slow = new ShenandoahLoadReferenceBarrierStub(obj, result);
__ branch(lir_cond_notEqual, T_INT, slow);
__ branch_destination(slow->continuation());
return result;
}
--- 140,150 ----
__ logical_and(flag_val, mask_reg, masked_flag);
flag_val = masked_flag;
}
__ cmp(lir_cond_notEqual, flag_val, LIR_OprFact::intConst(0));
! CodeStub* slow = new ShenandoahLoadReferenceBarrierStub(obj, result, tmp1, tmp2);
__ branch(lir_cond_notEqual, T_INT, slow);
__ branch_destination(slow->continuation());
return result;
}
*** 236,250 ****
--- 238,266 ----
bs->generate_c1_pre_barrier_runtime_stub(sasm);
return NULL;
}
};
+ class C1ShenandoahLoadReferenceBarrierCodeGenClosure : public StubAssemblerCodeGenClosure {
+ virtual OopMapSet* generate_code(StubAssembler* sasm) {
+ ShenandoahBarrierSetAssembler* bs = (ShenandoahBarrierSetAssembler*)BarrierSet::barrier_set()->barrier_set_assembler();
+ bs->generate_c1_load_reference_barrier_runtime_stub(sasm);
+ return NULL;
+ }
+ };
+
void ShenandoahBarrierSetC1::generate_c1_runtime_stubs(BufferBlob* buffer_blob) {
C1ShenandoahPreBarrierCodeGenClosure pre_code_gen_cl;
_pre_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1,
"shenandoah_pre_barrier_slow",
false, &pre_code_gen_cl);
+ if (ShenandoahLoadRefBarrier) {
+ C1ShenandoahLoadReferenceBarrierCodeGenClosure lrb_code_gen_cl;
+ _load_reference_barrier_rt_code_blob = Runtime1::generate_blob(buffer_blob, -1,
+ "shenandoah_load_reference_barrier_slow",
+ false, &lrb_code_gen_cl);
+ }
}
const char* ShenandoahBarrierSetC1::rtcall_name_for_address(address entry) {
if (entry == CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_native)) {
return "ShenandoahRuntime::load_reference_barrier_native";
< prev index next >