Skip to content

Commit fbdba71

Browse files
committed
Comments
1 parent 53d68a0 commit fbdba71

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

openjdk/barriers/mmtkUnlogBitBarrier.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include "c1/c1_LIRAssembler.hpp"
66
#include "c1/c1_MacroAssembler.hpp"
77

8+
//////////////////// Assembler ////////////////////
9+
810
#define __ masm->
911

1012
void MMTkUnlogBitBarrierSetAssembler::emit_check_unlog_bit_fast_path(MacroAssembler* masm, Label &done, Register obj, Register tmp1, Register tmp2) {
@@ -84,6 +86,8 @@ void MMTkUnlogBitBarrierSetAssembler::object_reference_write_pre_or_post(MacroAs
8486

8587
#undef __
8688

89+
//////////////////// Assembler/C1 ////////////////////
90+
8791
#define __ ce->masm()->
8892

8993
void MMTkUnlogBitBarrierSetAssembler::generate_c1_unlog_bit_barrier_slow_path_stub(LIR_Assembler* ce, MMTkC1UnlogBitBarrierSlowPathStub* stub) const {
@@ -105,6 +109,8 @@ void MMTkC1UnlogBitBarrierSlowPathStub::emit_code(LIR_Assembler* ce) {
105109

106110
#undef __
107111

112+
//////////////////// C1 ////////////////////
113+
108114
#ifdef ASSERT
109115
#define __ gen->lir(__FILE__, __LINE__)->
110116
#else

openjdk/barriers/mmtkUnlogBitBarrier.hpp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ struct MMTkC1UnlogBitBarrierSlowPathStub;
1212

1313
const uintptr_t UNLOG_BIT_BASE_ADDRESS = GLOBAL_SIDE_METADATA_VM_BASE_ADDRESS;
1414

15+
//////////////////// Runtime ////////////////////
16+
1517
class MMTkUnlogBitBarrierSetRuntime: public MMTkBarrierSetRuntime {
1618
protected:
1719
static bool is_unlog_bit_set(oop obj) {
@@ -23,6 +25,8 @@ class MMTkUnlogBitBarrierSetRuntime: public MMTkBarrierSetRuntime {
2325
}
2426
};
2527

28+
//////////////////// Assembler ////////////////////
29+
2630
class MMTkUnlogBitBarrierSetAssembler: public MMTkBarrierSetAssembler {
2731
protected:
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+
3642
class MMTkUnlogBitBarrierSetC1: public MMTkBarrierSetC1 {
3743
protected:
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).
4559
struct 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+
6278
class MMTkUnlogBitBarrierSetC2: public MMTkBarrierSetC2 {};
6379

6480
#endif // MMTK_OPENJDK_BARRIERS_MMTK_UNLOG_BIT_BARRIER_HPP

0 commit comments

Comments
 (0)