183 "SATB queues must only be processed at safepoints"); 184 if (_buf != NULL) { 185 assert(_index % sizeof(void*) == 0, "invariant"); 186 assert(_sz % sizeof(void*) == 0, "invariant"); 187 assert(_index <= _sz, "invariant"); 188 cl->do_buffer(_buf + byte_index_to_index((int)_index), 189 byte_index_to_index((int)(_sz - _index))); 190 _index = _sz; 191 } 192 } 193 194 #ifndef PRODUCT 195 // Helpful for debugging 196 197 void ObjPtrQueue::print(const char* name) { 198 print(name, _buf, _index, _sz); 199 } 200 201 void ObjPtrQueue::print(const char* name, 202 void** buf, size_t index, size_t sz) { 203 gclog_or_tty->print_cr(" SATB BUFFER [%s] buf: "PTR_FORMAT" " 204 "index: "SIZE_FORMAT" sz: "SIZE_FORMAT, 205 name, p2i(buf), index, sz); 206 } 207 #endif // PRODUCT 208 209 #ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away 210 #pragma warning( disable:4355 ) // 'this' : used in base member initializer list 211 #endif // _MSC_VER 212 213 SATBMarkQueueSet::SATBMarkQueueSet() : 214 PtrQueueSet(), 215 _shared_satb_queue(this, true /*perm*/) { } 216 217 void SATBMarkQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock, 218 int process_completed_threshold, 219 Mutex* lock) { 220 PtrQueueSet::initialize(cbl_mon, fl_lock, process_completed_threshold, -1); 221 _shared_satb_queue.set_lock(lock); 222 } 223 224 void SATBMarkQueueSet::handle_zero_index_for_thread(JavaThread* t) { | 183 "SATB queues must only be processed at safepoints"); 184 if (_buf != NULL) { 185 assert(_index % sizeof(void*) == 0, "invariant"); 186 assert(_sz % sizeof(void*) == 0, "invariant"); 187 assert(_index <= _sz, "invariant"); 188 cl->do_buffer(_buf + byte_index_to_index((int)_index), 189 byte_index_to_index((int)(_sz - _index))); 190 _index = _sz; 191 } 192 } 193 194 #ifndef PRODUCT 195 // Helpful for debugging 196 197 void ObjPtrQueue::print(const char* name) { 198 print(name, _buf, _index, _sz); 199 } 200 201 void ObjPtrQueue::print(const char* name, 202 void** buf, size_t index, size_t sz) { 203 gclog_or_tty->print_cr(" SATB BUFFER [%s] buf: " PTR_FORMAT " " 204 "index: " SIZE_FORMAT " sz: " SIZE_FORMAT, 205 name, p2i(buf), index, sz); 206 } 207 #endif // PRODUCT 208 209 #ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away 210 #pragma warning( disable:4355 ) // 'this' : used in base member initializer list 211 #endif // _MSC_VER 212 213 SATBMarkQueueSet::SATBMarkQueueSet() : 214 PtrQueueSet(), 215 _shared_satb_queue(this, true /*perm*/) { } 216 217 void SATBMarkQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock, 218 int process_completed_threshold, 219 Mutex* lock) { 220 PtrQueueSet::initialize(cbl_mon, fl_lock, process_completed_threshold, -1); 221 _shared_satb_queue.set_lock(lock); 222 } 223 224 void SATBMarkQueueSet::handle_zero_index_for_thread(JavaThread* t) { |