< prev index next >

src/share/vm/gc/shenandoah/shenandoahHeap.inline.hpp

Print this page
rev 13130 : Interleave partial GCs with concurrent GCs.


 413   bool alloc_after_mark_start = addr >= top_at_mark_start;
 414   return alloc_after_mark_start;
 415 }
 416 
 417 inline bool ShenandoahHeap::allocated_after_complete_mark_start(HeapWord* addr) const {
 418   uintx index = ((uintx) addr) >> ShenandoahHeapRegion::region_size_shift();
 419   HeapWord* top_at_mark_start = _complete_top_at_mark_starts[index];
 420   bool alloc_after_mark_start = addr >= top_at_mark_start;
 421   return alloc_after_mark_start;
 422 }
 423 
 424 template<class T>
 425 inline void ShenandoahHeap::marked_object_iterate(ShenandoahHeapRegion* region, T* cl) {
 426   marked_object_iterate(region, cl, region->top());
 427 }
 428 
 429 template<class T>
 430 inline void ShenandoahHeap::marked_object_iterate(ShenandoahHeapRegion* region, T* cl, HeapWord* limit) {
 431   assert(BrooksPointer::word_offset() < 0, "skip_delta calculation below assumes the forwarding ptr is before obj");
 432 


 433   CMBitMap* mark_bit_map = _complete_mark_bit_map;
 434   HeapWord* top_at_mark_start = complete_top_at_mark_start(region->bottom());
 435 
 436   size_t skip_bitmap_delta = BrooksPointer::word_size() + 1;
 437   size_t skip_objsize_delta = BrooksPointer::word_size() /* + actual obj.size() below */;
 438   HeapWord* start = region->bottom() + BrooksPointer::word_size();
 439 
 440   HeapWord* end = MIN2(top_at_mark_start + BrooksPointer::word_size(), _ordered_regions->end());
 441   HeapWord* addr = mark_bit_map->getNextMarkedWordAddress(start, end);
 442 
 443   intx dist = ShenandoahMarkScanPrefetch;
 444   if (dist > 0) {
 445     // Batched scan that prefetches the oop data, anticipating the access to
 446     // either header, oop field, or forwarding pointer. Not that we cannot
 447     // touch anything in oop, while it still being prefetched to get enough
 448     // time for prefetch to work. This is why we try to scan the bitmap linearly,
 449     // disregarding the object size. However, since we know forwarding pointer
 450     // preceeds the object, we can skip over it. Once we cannot trust the bitmap,
 451     // there is no point for prefetching the oop contents, as oop->size() will
 452     // touch it prematurely.




 413   bool alloc_after_mark_start = addr >= top_at_mark_start;
 414   return alloc_after_mark_start;
 415 }
 416 
 417 inline bool ShenandoahHeap::allocated_after_complete_mark_start(HeapWord* addr) const {
 418   uintx index = ((uintx) addr) >> ShenandoahHeapRegion::region_size_shift();
 419   HeapWord* top_at_mark_start = _complete_top_at_mark_starts[index];
 420   bool alloc_after_mark_start = addr >= top_at_mark_start;
 421   return alloc_after_mark_start;
 422 }
 423 
 424 template<class T>
 425 inline void ShenandoahHeap::marked_object_iterate(ShenandoahHeapRegion* region, T* cl) {
 426   marked_object_iterate(region, cl, region->top());
 427 }
 428 
 429 template<class T>
 430 inline void ShenandoahHeap::marked_object_iterate(ShenandoahHeapRegion* region, T* cl, HeapWord* limit) {
 431   assert(BrooksPointer::word_offset() < 0, "skip_delta calculation below assumes the forwarding ptr is before obj");
 432 
 433   assert(! region->is_humongous_continuation(), "no humongous continuation regions here");
 434 
 435   CMBitMap* mark_bit_map = _complete_mark_bit_map;
 436   HeapWord* top_at_mark_start = complete_top_at_mark_start(region->bottom());
 437 
 438   size_t skip_bitmap_delta = BrooksPointer::word_size() + 1;
 439   size_t skip_objsize_delta = BrooksPointer::word_size() /* + actual obj.size() below */;
 440   HeapWord* start = region->bottom() + BrooksPointer::word_size();
 441 
 442   HeapWord* end = MIN2(top_at_mark_start + BrooksPointer::word_size(), _ordered_regions->end());
 443   HeapWord* addr = mark_bit_map->getNextMarkedWordAddress(start, end);
 444 
 445   intx dist = ShenandoahMarkScanPrefetch;
 446   if (dist > 0) {
 447     // Batched scan that prefetches the oop data, anticipating the access to
 448     // either header, oop field, or forwarding pointer. Not that we cannot
 449     // touch anything in oop, while it still being prefetched to get enough
 450     // time for prefetch to work. This is why we try to scan the bitmap linearly,
 451     // disregarding the object size. However, since we know forwarding pointer
 452     // preceeds the object, we can skip over it. Once we cannot trust the bitmap,
 453     // there is no point for prefetching the oop contents, as oop->size() will
 454     // touch it prematurely.


< prev index next >