--- old/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp 2018-10-16 14:29:31.212306370 +0200 +++ new/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp 2018-10-16 14:29:30.796293632 +0200 @@ -25,6 +25,7 @@ #ifndef SHARE_VM_GC_G1_G1PARSCANTHREADSTATE_INLINE_HPP #define SHARE_VM_GC_G1_G1PARSCANTHREADSTATE_INLINE_HPP +#include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1ParScanThreadState.hpp" #include "gc/g1/g1RemSet.hpp" #include "oops/access.inline.hpp" @@ -40,6 +41,12 @@ // processed multiple times, and so we might get references into old gen here. // So we need to redo this check. const InCSetState in_cset_state = _g1h->in_cset_state(obj); + // References pushed onto the work stack should never point to a humongous region + // as they are not added to the collection set due to above precondition. + assert(!in_cset_state.is_humongous(), + "Obj " PTR_FORMAT " should not refer to humongous region %u from " PTR_FORMAT, + p2i(obj), _g1h->addr_to_region((HeapWord*)obj), p2i(p)); + if (!in_cset_state.is_in_cset()) { // In this case somebody else already did all the work. return;