--- old/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp 2018-05-08 09:41:02.127245522 +0200 +++ new/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp 2018-05-08 09:41:01.827236252 +0200 @@ -39,20 +39,14 @@ #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; }