< 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

@@ -37,24 +37,18 @@
 #include "gc/shared/suspendibleThreadSet.hpp"
 #include "gc/shared/taskqueue.inline.hpp"
 #include "utilities/bitMap.inline.hpp"
 
 inline bool G1CMIsAliveClosure::do_object_b(oop obj) {
-  if (obj == NULL) {
-    return false;
-  }
-  assert(_g1h->is_in_reserved(obj), "Asked for liveness of oop " PTR_FORMAT " outside of reserved heap.", p2i(obj));
-  // Young regions have nTAMS == bottom(), i.e. all objects there are implicitly live,
-  // so we do not need to explicitly check for region type.
-  bool result = !_g1h->is_obj_ill(obj, _g1h->heap_region_containing(obj));
-  assert(_g1h->heap_region_containing(obj)->is_old_or_humongous() || result,
-         "Oop " PTR_FORMAT " in young region %u (%s) should be live",
-         p2i(obj), _g1h->addr_to_region((HeapWord*)obj), _g1h->heap_region_containing(obj)->get_short_type_str());
-  return result;
+  return !_g1h->is_obj_ill(obj);
 }
 
 inline bool G1CMSubjectToDiscoveryClosure::do_object_b(oop obj) {
+  // Re-check whether the passed object is null. With ReferentBasedDiscovery the
+  // mutator may have changed the referent's value (i.e. cleared it) between the
+  // time the referent was determined to be potentially alive and calling this
+  // method.
   if (obj == NULL) {
     return false;
   }
   assert(_g1h->is_in_reserved(obj), "Trying to discover obj " PTR_FORMAT " not in heap", p2i(obj));
   return _g1h->heap_region_containing(obj)->is_old_or_humongous();
< prev index next >