< prev index next >

src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp

Print this page

 51     }
 52     assert(_collector->live_words(region_index) > _collector->scope()->region_compaction_threshold() ||
 53          !r->is_starts_humongous() ||
 54          _collector->mark_bitmap()->is_marked(cast_to_oop(r->bottom())),
 55          "must be, otherwise reclaimed earlier");
 56     r->reset_skip_compacting_after_full_gc();
 57     return false;
 58   }
 59 };
 60 
 61 size_t G1FullGCCompactTask::G1CompactRegionClosure::apply(oop obj) {
 62   size_t size = obj->size();
 63   HeapWord* destination = cast_from_oop<HeapWord*>(obj->forwardee());
 64   if (destination == NULL) {
 65     // Object not moving
 66     return size;
 67   }
 68 
 69   // copy object and reinit its mark
 70   HeapWord* obj_addr = cast_from_oop<HeapWord*>(obj);
 71   assert(obj_addr != destination, "everything in this pass should be moving");
 72   Copy::aligned_conjoint_words(obj_addr, destination, size);

 73   cast_to_oop(destination)->init_mark();
 74   assert(cast_to_oop(destination)->klass() != NULL, "should have a class");
 75 
 76   return size;
 77 }
 78 
 79 void G1FullGCCompactTask::compact_region(HeapRegion* hr) {
 80   assert(!hr->is_pinned(), "Should be no pinned region in compaction queue");
 81   assert(!hr->is_humongous(), "Should be no humongous regions in compaction queue");
 82 
 83   if (!collector()->is_free(hr->hrm_index())) {
 84     G1CompactRegionClosure compact(collector()->mark_bitmap());
 85     hr->apply_to_marked_objects(collector()->mark_bitmap(), &compact);
 86     // Clear the liveness information for this region if necessary i.e. if we actually look at it
 87     // for bitmap verification. Otherwise it is sufficient that we move the TAMS to bottom().
 88     if (G1VerifyBitmaps) {
 89       collector()->mark_bitmap()->clear_region(hr);
 90     }
 91   }
 92 

 51     }
 52     assert(_collector->live_words(region_index) > _collector->scope()->region_compaction_threshold() ||
 53          !r->is_starts_humongous() ||
 54          _collector->mark_bitmap()->is_marked(cast_to_oop(r->bottom())),
 55          "must be, otherwise reclaimed earlier");
 56     r->reset_skip_compacting_after_full_gc();
 57     return false;
 58   }
 59 };
 60 
 61 size_t G1FullGCCompactTask::G1CompactRegionClosure::apply(oop obj) {
 62   size_t size = obj->size();
 63   HeapWord* destination = cast_from_oop<HeapWord*>(obj->forwardee());
 64   if (destination == NULL) {
 65     // Object not moving
 66     return size;
 67   }
 68 
 69   // copy object and reinit its mark
 70   HeapWord* obj_addr = cast_from_oop<HeapWord*>(obj);
 71   assert(size <= INT_MAX, "sanity check");
 72   assert(obj_addr != destination || size > (size_t)obj->compact_size((int)(uint)size), "everything in this pass should be moving or compressed in place");
 73   obj->copy_conjoint_compact(destination); // TODO LOOM: see G1FullGCCompactionPoint::forward; Might want to reconsider compacting here.
 74   cast_to_oop(destination)->init_mark();
 75   assert(cast_to_oop(destination)->klass() != NULL, "should have a class");
 76 
 77   return size;
 78 }
 79 
 80 void G1FullGCCompactTask::compact_region(HeapRegion* hr) {
 81   assert(!hr->is_pinned(), "Should be no pinned region in compaction queue");
 82   assert(!hr->is_humongous(), "Should be no humongous regions in compaction queue");
 83 
 84   if (!collector()->is_free(hr->hrm_index())) {
 85     G1CompactRegionClosure compact(collector()->mark_bitmap());
 86     hr->apply_to_marked_objects(collector()->mark_bitmap(), &compact);
 87     // Clear the liveness information for this region if necessary i.e. if we actually look at it
 88     // for bitmap verification. Otherwise it is sufficient that we move the TAMS to bottom().
 89     if (G1VerifyBitmaps) {
 90       collector()->mark_bitmap()->clear_region(hr);
 91     }
 92   }
 93 
< prev index next >