< prev index next >

src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp

Print this page
rev 52719 : [mq]: 8159440-marking-of-promoted-objects-to-concurrent


  59   HeapRegion* const hr = _g1h->heap_region_containing(obj);
  60   return mark_in_next_bitmap(worker_id, hr, obj, obj_size);
  61 }
  62 
  63 inline bool G1ConcurrentMark::mark_in_next_bitmap(uint const worker_id, HeapRegion* const hr, oop const obj, size_t const obj_size) {
  64   assert(hr != NULL, "just checking");
  65   assert(hr->is_in_reserved(obj), "Attempting to mark object at " PTR_FORMAT " that is not contained in the given region %u", p2i(obj), hr->hrm_index());
  66 
  67   if (hr->obj_allocated_since_next_marking(obj)) {
  68     return false;
  69   }
  70 
  71   // Some callers may have stale objects to mark above nTAMS after humongous reclaim.
  72   // Can't assert that this is a valid object at this point, since it might be in the process of being copied by another thread.
  73   assert(!hr->is_continues_humongous(), "Should not try to mark object " PTR_FORMAT " in Humongous continues region %u above nTAMS " PTR_FORMAT, p2i(obj), hr->hrm_index(), p2i(hr->next_top_at_mark_start()));
  74 
  75   HeapWord* const obj_addr = (HeapWord*)obj;
  76 
  77   bool success = _next_mark_bitmap->par_mark(obj_addr);
  78   if (success) {
  79     add_to_liveness(worker_id, obj, obj_size == 0 ? obj->size() : obj_size);
  80   }
  81   return success;
  82 }
  83 
  84 #ifndef PRODUCT
  85 template<typename Fn>
  86 inline void G1CMMarkStack::iterate(Fn fn) const {
  87   assert_at_safepoint_on_vm_thread();
  88 
  89   size_t num_chunks = 0;
  90 
  91   TaskQueueEntryChunk* cur = _chunk_list;
  92   while (cur != NULL) {
  93     guarantee(num_chunks <= _chunks_in_chunk_list, "Found " SIZE_FORMAT " oop chunks which is more than there should be", num_chunks);
  94 
  95     for (size_t i = 0; i < EntriesPerChunk; ++i) {
  96       if (cur->data[i].is_null()) {
  97         break;
  98       }
  99       fn(cur->data[i]);




  59   HeapRegion* const hr = _g1h->heap_region_containing(obj);
  60   return mark_in_next_bitmap(worker_id, hr, obj, obj_size);
  61 }
  62 
  63 inline bool G1ConcurrentMark::mark_in_next_bitmap(uint const worker_id, HeapRegion* const hr, oop const obj, size_t const obj_size) {
  64   assert(hr != NULL, "just checking");
  65   assert(hr->is_in_reserved(obj), "Attempting to mark object at " PTR_FORMAT " that is not contained in the given region %u", p2i(obj), hr->hrm_index());
  66 
  67   if (hr->obj_allocated_since_next_marking(obj)) {
  68     return false;
  69   }
  70 
  71   // Some callers may have stale objects to mark above nTAMS after humongous reclaim.
  72   // Can't assert that this is a valid object at this point, since it might be in the process of being copied by another thread.
  73   assert(!hr->is_continues_humongous(), "Should not try to mark object " PTR_FORMAT " in Humongous continues region %u above nTAMS " PTR_FORMAT, p2i(obj), hr->hrm_index(), p2i(hr->next_top_at_mark_start()));
  74 
  75   HeapWord* const obj_addr = (HeapWord*)obj;
  76 
  77   bool success = _next_mark_bitmap->par_mark(obj_addr);
  78   if (success) {
  79     add_to_liveness(worker_id, obj, obj->size());
  80   }
  81   return success;
  82 }
  83 
  84 #ifndef PRODUCT
  85 template<typename Fn>
  86 inline void G1CMMarkStack::iterate(Fn fn) const {
  87   assert_at_safepoint_on_vm_thread();
  88 
  89   size_t num_chunks = 0;
  90 
  91   TaskQueueEntryChunk* cur = _chunk_list;
  92   while (cur != NULL) {
  93     guarantee(num_chunks <= _chunks_in_chunk_list, "Found " SIZE_FORMAT " oop chunks which is more than there should be", num_chunks);
  94 
  95     for (size_t i = 0; i < EntriesPerChunk; ++i) {
  96       if (cur->data[i].is_null()) {
  97         break;
  98       }
  99       fn(cur->data[i]);


< prev index next >