@@ -12,6 +12,8 @@ struct MMTkC1UnlogBitBarrierSlowPathStub;
1212
1313const uintptr_t UNLOG_BIT_BASE_ADDRESS = GLOBAL_SIDE_METADATA_VM_BASE_ADDRESS;
1414
15+ // ////////////////// Runtime ////////////////////
16+
1517class MMTkUnlogBitBarrierSetRuntime : public MMTkBarrierSetRuntime {
1618protected:
1719 static bool is_unlog_bit_set (oop obj) {
@@ -23,6 +25,8 @@ class MMTkUnlogBitBarrierSetRuntime: public MMTkBarrierSetRuntime {
2325 }
2426};
2527
28+ // ////////////////// Assembler ////////////////////
29+
2630class MMTkUnlogBitBarrierSetAssembler : public MMTkBarrierSetAssembler {
2731protected:
2832 static void emit_check_unlog_bit_fast_path (MacroAssembler* masm, Label &done, Register obj, Register tmp1, Register tmp2);
@@ -33,15 +37,25 @@ class MMTkUnlogBitBarrierSetAssembler: public MMTkBarrierSetAssembler {
3337 void generate_c1_unlog_bit_barrier_slow_path_stub (LIR_Assembler* ce, MMTkC1UnlogBitBarrierSlowPathStub* stub) const ;
3438};
3539
40+ // ////////////////// C1 ////////////////////
41+
3642class MMTkUnlogBitBarrierSetC1 : public MMTkBarrierSetC1 {
3743protected:
3844 static void emit_check_unlog_bit_fast_path (LIRGenerator* gen, LIR_Opr addr, CodeStub* slow);
3945 static void object_reference_write_pre_or_post (LIRAccess& access, bool pre );
4046};
4147
42- // / C1 pre write barrier slow-call stub.
43- // / The default behaviour is to call `MMTkBarrierSetRuntime::object_reference_write_pre_call` and pass all the three args.
44- // / Barrier implementations may inherit from this class, and override `emit_code` to perform a specialized slow-path call.
48+ // / C1 write barrier slow path stub.
49+ // /
50+ // / This stub calls `MMTkBarrierSetRuntime::object_reference_write_{slow,pre,post}_call` depending
51+ // / on whether barrier fast paths are enabled and whether it is pre or post barrier, passing the
52+ // / `src` argument, and leaving other arguments as nullptr. This is enough for object-remembering
53+ // / barriers based on the unlog bit, including the ObjectBarrier and the SATBBarrier, because only
54+ // / the `src` argument is significant.
55+ // /
56+ // / Note that this stub cannot be generalized to field-remembering barriers as it does not pass the
57+ // / field or the old/new values. Field-remembering barriers should implement their own slow-path
58+ // / stub(s).
4559struct MMTkC1UnlogBitBarrierSlowPathStub : CodeStub {
4660 LIR_Opr src;
4761 bool pre ;
@@ -59,6 +73,8 @@ struct MMTkC1UnlogBitBarrierSlowPathStub: CodeStub {
5973 NOT_PRODUCT (virtual void print_name (outputStream* out) const { out->print (" MMTkC1PreBarrierStub" ); });
6074};
6175
76+ // ////////////////// C2 ////////////////////
77+
6278class MMTkUnlogBitBarrierSetC2 : public MMTkBarrierSetC2 {};
6379
6480#endif // MMTK_OPENJDK_BARRIERS_MMTK_UNLOG_BIT_BARRIER_HPP
0 commit comments