248 assert(_spoolHead == _spoolTail && _firstIndex == _nextIndex,
249 "Else will undercount");
250 assert(CMSPrintPromoBlockInfo > 0, "Else unnecessary call");
251 // Count the number of blocks and slots in the free pool
252 size_t slots = 0;
253 size_t blocks = 0;
254 for (SpoolBlock* cur_spool = _spareSpool;
255 cur_spool != NULL;
256 cur_spool = cur_spool->nextSpoolBlock) {
257 // the first entry is just a self-pointer; indices 1 through
258 // bufferSize - 1 are occupied (thus, bufferSize - 1 slots).
259 assert((void*)cur_spool->displacedHdr == (void*)&cur_spool->displacedHdr,
260 "first entry of displacedHdr should be self-referential");
261 slots += cur_spool->bufferSize - 1;
262 blocks++;
263 }
264 if (_spoolHead != NULL) {
265 slots += _spoolHead->bufferSize - 1;
266 blocks++;
267 }
268 gclog_or_tty->print_cr(" [worker %d] promo_blocks = %d, promo_slots = %d ",
269 worker_id, blocks, slots);
270 }
271
272 // When _spoolTail is not NULL, then the slot <_spoolTail, _nextIndex>
273 // points to the next slot available for filling.
274 // The set of slots holding displaced headers are then all those in the
275 // right-open interval denoted by:
276 //
277 // [ <_spoolHead, _firstIndex>, <_spoolTail, _nextIndex> )
278 //
279 // When _spoolTail is NULL, then the set of slots with displaced headers
280 // is all those starting at the slot <_spoolHead, _firstIndex> and
281 // going up to the last slot of last block in the linked list.
282 // In this latter case, _splice_point points to the tail block of
283 // this linked list of blocks holding displaced headers.
284 void PromotionInfo::verify() const {
285 // Verify the following:
286 // 1. the number of displaced headers matches the number of promoted
287 // objects that have displaced headers
288 // 2. each promoted object lies in this space
|
248 assert(_spoolHead == _spoolTail && _firstIndex == _nextIndex,
249 "Else will undercount");
250 assert(CMSPrintPromoBlockInfo > 0, "Else unnecessary call");
251 // Count the number of blocks and slots in the free pool
252 size_t slots = 0;
253 size_t blocks = 0;
254 for (SpoolBlock* cur_spool = _spareSpool;
255 cur_spool != NULL;
256 cur_spool = cur_spool->nextSpoolBlock) {
257 // the first entry is just a self-pointer; indices 1 through
258 // bufferSize - 1 are occupied (thus, bufferSize - 1 slots).
259 assert((void*)cur_spool->displacedHdr == (void*)&cur_spool->displacedHdr,
260 "first entry of displacedHdr should be self-referential");
261 slots += cur_spool->bufferSize - 1;
262 blocks++;
263 }
264 if (_spoolHead != NULL) {
265 slots += _spoolHead->bufferSize - 1;
266 blocks++;
267 }
268 gclog_or_tty->print_cr(" [worker %d] promo_blocks = " SIZE_FORMAT ", promo_slots = " SIZE_FORMAT,
269 worker_id, blocks, slots);
270 }
271
272 // When _spoolTail is not NULL, then the slot <_spoolTail, _nextIndex>
273 // points to the next slot available for filling.
274 // The set of slots holding displaced headers are then all those in the
275 // right-open interval denoted by:
276 //
277 // [ <_spoolHead, _firstIndex>, <_spoolTail, _nextIndex> )
278 //
279 // When _spoolTail is NULL, then the set of slots with displaced headers
280 // is all those starting at the slot <_spoolHead, _firstIndex> and
281 // going up to the last slot of last block in the linked list.
282 // In this latter case, _splice_point points to the tail block of
283 // this linked list of blocks holding displaced headers.
284 void PromotionInfo::verify() const {
285 // Verify the following:
286 // 1. the number of displaced headers matches the number of promoted
287 // objects that have displaced headers
288 // 2. each promoted object lies in this space
|