< prev index next >

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

Print this page
rev 49944 : imported patch 8201492-properly-implement-non-contiguous-reference-processing
rev 49945 : imported patch 8201492-stefanj-review


  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP
  26 #define SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP
  27 
  28 #include "gc/g1/g1CollectedHeap.inline.hpp"
  29 #include "gc/g1/g1ConcurrentMark.hpp"
  30 #include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
  31 #include "gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp"
  32 #include "gc/g1/g1Policy.hpp"
  33 #include "gc/g1/g1RegionMarkStatsCache.inline.hpp"
  34 #include "gc/g1/g1RemSetTrackingPolicy.hpp"
  35 #include "gc/g1/heapRegionRemSet.hpp"
  36 #include "gc/g1/heapRegion.hpp"
  37 #include "gc/shared/suspendibleThreadSet.hpp"
  38 #include "gc/shared/taskqueue.inline.hpp"
  39 #include "utilities/bitMap.inline.hpp"
  40 
















  41 inline bool G1ConcurrentMark::mark_in_next_bitmap(uint const worker_id, oop const obj, size_t const obj_size) {
  42   HeapRegion* const hr = _g1h->heap_region_containing(obj);
  43   return mark_in_next_bitmap(worker_id, hr, obj, obj_size);
  44 }
  45 
  46 inline bool G1ConcurrentMark::mark_in_next_bitmap(uint const worker_id, HeapRegion* const hr, oop const obj, size_t const obj_size) {
  47   assert(hr != NULL, "just checking");
  48   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());
  49 
  50   if (hr->obj_allocated_since_next_marking(obj)) {
  51     return false;
  52   }
  53 
  54   // Some callers may have stale objects to mark above nTAMS after humongous reclaim.
  55   // 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.
  56   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()));
  57 
  58   HeapWord* const obj_addr = (HeapWord*)obj;
  59 
  60   bool success = _next_mark_bitmap->par_mark(obj_addr);




  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP
  26 #define SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP
  27 
  28 #include "gc/g1/g1CollectedHeap.inline.hpp"
  29 #include "gc/g1/g1ConcurrentMark.hpp"
  30 #include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
  31 #include "gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp"
  32 #include "gc/g1/g1Policy.hpp"
  33 #include "gc/g1/g1RegionMarkStatsCache.inline.hpp"
  34 #include "gc/g1/g1RemSetTrackingPolicy.hpp"
  35 #include "gc/g1/heapRegionRemSet.hpp"
  36 #include "gc/g1/heapRegion.hpp"
  37 #include "gc/shared/suspendibleThreadSet.hpp"
  38 #include "gc/shared/taskqueue.inline.hpp"
  39 #include "utilities/bitMap.inline.hpp"
  40 
  41 inline bool G1CMIsAliveClosure::do_object_b(oop obj) {
  42   return !_g1h->is_obj_ill(obj);
  43 }
  44 
  45 inline bool G1CMSubjectToDiscoveryClosure::do_object_b(oop obj) {
  46   // Re-check whether the passed object is null. With ReferentBasedDiscovery the
  47   // mutator may have changed the referent's value (i.e. cleared it) between the
  48   // time the referent was determined to be potentially alive and calling this
  49   // method.
  50   if (obj == NULL) {
  51     return false;
  52   }
  53   assert(_g1h->is_in_reserved(obj), "Trying to discover obj " PTR_FORMAT " not in heap", p2i(obj));
  54   return _g1h->heap_region_containing(obj)->is_old_or_humongous();
  55 }
  56 
  57 inline bool G1ConcurrentMark::mark_in_next_bitmap(uint const worker_id, oop const obj, size_t const obj_size) {
  58   HeapRegion* const hr = _g1h->heap_region_containing(obj);
  59   return mark_in_next_bitmap(worker_id, hr, obj, obj_size);
  60 }
  61 
  62 inline bool G1ConcurrentMark::mark_in_next_bitmap(uint const worker_id, HeapRegion* const hr, oop const obj, size_t const obj_size) {
  63   assert(hr != NULL, "just checking");
  64   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());
  65 
  66   if (hr->obj_allocated_since_next_marking(obj)) {
  67     return false;
  68   }
  69 
  70   // Some callers may have stale objects to mark above nTAMS after humongous reclaim.
  71   // 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.
  72   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()));
  73 
  74   HeapWord* const obj_addr = (HeapWord*)obj;
  75 
  76   bool success = _next_mark_bitmap->par_mark(obj_addr);


< prev index next >