51
52 public:
53 SATBMarkQueue(SATBMarkQueueSet* qset, bool permanent = false);
54
55 // Process queue entries and free resources.
56 void flush();
57
58 // Apply cl to the active part of the buffer.
59 // Prerequisite: Must be at a safepoint.
60 void apply_closure_and_empty(SATBBufferClosure* cl);
61
62 // Overrides PtrQueue::should_enqueue_buffer(). See the method's
63 // definition for more information.
64 virtual bool should_enqueue_buffer();
65
66 #ifndef PRODUCT
67 // Helpful for debugging
68 void print(const char* name);
69 static void print(const char* name, void** buf, size_t index, size_t sz);
70 #endif // PRODUCT
71 };
72
73 class SATBMarkQueueSet: public PtrQueueSet {
74 SATBMarkQueue _shared_satb_queue;
75
76 #ifdef ASSERT
77 void dump_active_states(bool expected_active);
78 void verify_active_states(bool expected_active);
79 #endif // ASSERT
80
81 public:
82 SATBMarkQueueSet();
83
84 void initialize(Monitor* cbl_mon, Mutex* fl_lock,
85 int process_completed_threshold,
86 Mutex* lock);
87
88 static void handle_zero_index_for_thread(JavaThread* t);
89
90 // Apply "set_active(active)" to all SATB queues in the set. It should be
|
51
52 public:
53 SATBMarkQueue(SATBMarkQueueSet* qset, bool permanent = false);
54
55 // Process queue entries and free resources.
56 void flush();
57
58 // Apply cl to the active part of the buffer.
59 // Prerequisite: Must be at a safepoint.
60 void apply_closure_and_empty(SATBBufferClosure* cl);
61
62 // Overrides PtrQueue::should_enqueue_buffer(). See the method's
63 // definition for more information.
64 virtual bool should_enqueue_buffer();
65
66 #ifndef PRODUCT
67 // Helpful for debugging
68 void print(const char* name);
69 static void print(const char* name, void** buf, size_t index, size_t sz);
70 #endif // PRODUCT
71
72 // Compiler support.
73 static ByteSize byte_offset_of_index() {
74 return PtrQueue::byte_offset_of_index<SATBMarkQueue>();
75 }
76 using PtrQueue::byte_width_of_index;
77
78 static ByteSize byte_offset_of_buf() {
79 return PtrQueue::byte_offset_of_buf<SATBMarkQueue>();
80 }
81 using PtrQueue::byte_width_of_buf;
82
83 static ByteSize byte_offset_of_active() {
84 return PtrQueue::byte_offset_of_active<SATBMarkQueue>();
85 }
86 using PtrQueue::byte_width_of_active;
87
88 };
89
90 class SATBMarkQueueSet: public PtrQueueSet {
91 SATBMarkQueue _shared_satb_queue;
92
93 #ifdef ASSERT
94 void dump_active_states(bool expected_active);
95 void verify_active_states(bool expected_active);
96 #endif // ASSERT
97
98 public:
99 SATBMarkQueueSet();
100
101 void initialize(Monitor* cbl_mon, Mutex* fl_lock,
102 int process_completed_threshold,
103 Mutex* lock);
104
105 static void handle_zero_index_for_thread(JavaThread* t);
106
107 // Apply "set_active(active)" to all SATB queues in the set. It should be
|