< prev index next >

src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp

Print this page
@@ -868,20 +868,37 @@
    assert_different_registers(tmp, addr.index());
    return tmp;
  }
  
  void ShenandoahBarrierStubC2::enter_if_gc_state(MacroAssembler& masm, const char test_state) {
-   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(t0, gc_state_fast);
-   __ test_bit(t0, t0, bit_to_check);
-   __ bnez(t0, *entry());
+   // Emit the unconditional branch in the first version of the method.
+   // Let the rest of runtime figure out how to manage it.
+   __ relocate(barrier_Relocation::spec());
+   __ j(*entry());
  
-   // Fast path falls through here when the barrier is not needed.
+ #ifdef ASSERT
+   Address gc_state_fast(xthread, in_bytes(ShenandoahThreadLocalData::gc_state_fast_offset()));
+   __ ld(t0, gc_state_fast);
+   __ beqz(t0, *continuation());
+   __ illegal_instruction(Assembler::csr::time); // Correctness bug: barrier is NOP-ed, but heap is NOT IDLE
+ #endif
    __ bind(*continuation());
  }
  
+ address ShenandoahBarrierSetAssembler::parse_stub_address(address pc) {
+   Unimplemented();
+   return nullptr;
+ }
+ 
+ void ShenandoahBarrierSetAssembler::patch_branch_to_nop(address pc) {
+   Unimplemented();
+ }
+ 
+ void ShenandoahBarrierSetAssembler::patch_nop_to_branch(address pc, address stub_addr) {
+   Unimplemented();
+ }
+ 
  #undef __
  #define __ masm->
  
  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) {

@@ -1225,9 +1242,6 @@
    }
  
    __ bind(L_done);
  }
  
- void ShenandoahBarrierStubC2::post_init(int offset) {
-   // Do nothing.
- }
  #endif // COMPILER2
< prev index next >