< prev index next > src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp
Print this page
void ShenandoahBarrierStubC2::gc_state_check_c2(MacroAssembler* masm,
Register gcstate,
const unsigned char test_state,
ShenandoahBarrierStubC2* slow_stub) {
- int bit_to_check = ShenandoahThreadLocalData::gc_state_to_fast_bit(test_state);
- Address gc_state_fast(xthread, in_bytes(ShenandoahThreadLocalData::gc_state_fast_offset()));
- __ lbu(gcstate, gc_state_fast);
- __ test_bit(gcstate, gcstate, bit_to_check);
- __ bnez(gcstate, *slow_stub->entry());
-
- // Fast path falls through here when the barrier is not needed.
- __ bind(*slow_stub->continuation());
+ if (ShenandoahGCStateCheckRemove) {
+ // Unrealistic: remove all barrier fastpath checks.
+ } else if (ShenandoahGCStateCheckHotpatch) {
+ __ nop();
+ } else {
+ int bit_to_check = ShenandoahThreadLocalData::gc_state_to_fast_bit(test_state);
+ Address gc_state_fast(xthread, in_bytes(ShenandoahThreadLocalData::gc_state_fast_offset()));
+ __ lbu(gcstate, gc_state_fast);
+ __ test_bit(gcstate, gcstate, bit_to_check);
+ __ bnez(gcstate, *slow_stub->entry());
+
+ // Fast path falls through here when the barrier is not needed.
+ __ bind(*slow_stub->continuation());
+ }
}
void ShenandoahBarrierSetAssembler::compare_and_set_c2(const MachNode* node, MacroAssembler* masm, Register res, Register addr,
Register oldval, Register newval, Register tmp, bool exchange, bool maybe_null, bool narrow, bool weak) {
const Assembler::Aqrl acquire = needs_acquiring_load_reserved(node) ? Assembler::aq : Assembler::relaxed;
ShenandoahBarrierStubC2::gc_state_check_c2(masm, t0, check, stub);
}
}
void ShenandoahBarrierSetAssembler::card_barrier_c2(const MachNode* node, MacroAssembler* masm, Address address) {
- if (!ShenandoahBarrierStubC2::needs_card_table_barrier(node)) {
+ if (ShenandoahSkipBarriers || (node->barrier_data() & ShenandoahBitCardMark) == 0) {
return;
}
assert(CardTable::dirty_card_val() == 0, "must be");
Assembler::InlineSkippedInstructionsCounter skip_counter(masm);
< prev index next >