src/share/vm/memory/blockOffsetTable.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/memory

src/share/vm/memory/blockOffsetTable.cpp

Print this page
rev 5732 : [mq]: comments2


 573                  addr, n));
 574   return q;
 575 }
 576 
 577 HeapWord* BlockOffsetArrayNonContigSpace::block_start_careful(
 578   const void* addr) const {
 579   assert(_array->offset_array(0) == 0, "objects can't cross covered areas");
 580 
 581   assert(_bottom <= addr && addr < _end,
 582          "addr must be covered by this Array");
 583   // Must read this exactly once because it can be modified by parallel
 584   // allocation.
 585   HeapWord* ub = _unallocated_block;
 586   if (BlockOffsetArrayUseUnallocatedBlock && addr >= ub) {
 587     assert(ub < _end, "tautology (see above)");
 588     return ub;
 589   }
 590 
 591   // Otherwise, find the block start using the table, but taking
 592   // care (cf block_start_unsafe() above) not to parse any objects/blocks
 593   // on the cards themsleves.
 594   size_t index = _array->index_for(addr);
 595   assert(_array->address_for_index(index) == addr,
 596          "arg should be start of card");
 597 
 598   HeapWord* q = (HeapWord*)addr;
 599   uint offset;
 600   do {
 601     offset = _array->offset_array(index);
 602     if (offset < N_words) {
 603       q -= offset;
 604     } else {
 605       size_t n_cards_back = entry_to_cards_back(offset);
 606       q -= (n_cards_back * N_words);
 607       index -= n_cards_back;
 608     }
 609   } while (offset >= N_words);
 610   assert(q <= addr, "block start should be to left of arg");
 611   return q;
 612 }
 613 




 573                  addr, n));
 574   return q;
 575 }
 576 
 577 HeapWord* BlockOffsetArrayNonContigSpace::block_start_careful(
 578   const void* addr) const {
 579   assert(_array->offset_array(0) == 0, "objects can't cross covered areas");
 580 
 581   assert(_bottom <= addr && addr < _end,
 582          "addr must be covered by this Array");
 583   // Must read this exactly once because it can be modified by parallel
 584   // allocation.
 585   HeapWord* ub = _unallocated_block;
 586   if (BlockOffsetArrayUseUnallocatedBlock && addr >= ub) {
 587     assert(ub < _end, "tautology (see above)");
 588     return ub;
 589   }
 590 
 591   // Otherwise, find the block start using the table, but taking
 592   // care (cf block_start_unsafe() above) not to parse any objects/blocks
 593   // on the cards themselves.
 594   size_t index = _array->index_for(addr);
 595   assert(_array->address_for_index(index) == addr,
 596          "arg should be start of card");
 597 
 598   HeapWord* q = (HeapWord*)addr;
 599   uint offset;
 600   do {
 601     offset = _array->offset_array(index);
 602     if (offset < N_words) {
 603       q -= offset;
 604     } else {
 605       size_t n_cards_back = entry_to_cards_back(offset);
 606       q -= (n_cards_back * N_words);
 607       index -= n_cards_back;
 608     }
 609   } while (offset >= N_words);
 610   assert(q <= addr, "block start should be to left of arg");
 611   return q;
 612 }
 613 


src/share/vm/memory/blockOffsetTable.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File