It seems to me that the comments and check does not make sense any more, or I missed something?
diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
index 9eebe411936..b90d18f8bb2 100644
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
@@ -178,11 +178,6 @@ void G1ParScanThreadState::do_oop_evac(T* p) {
// Reference should not be NULL here as such are never pushed to the task queue.
oop obj = RawAccess<IS_NOT_NULL>::oop_load(p);
- // Although we never intentionally push references outside of the collection
- // set, due to (benign) races in the claim mechanism during RSet scanning more
- // than one thread might claim the same card. So the same card may be
- // processed multiple times, and so we might get references into old gen here.
- // So we need to redo this check.
const G1HeapRegionAttr region_attr = _g1h->region_attr(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.
@@ -190,10 +185,7 @@ void G1ParScanThreadState::do_oop_evac(T* p) {
"Obj " PTR_FORMAT " should not refer to humongous region %u from " PTR_FORMAT,
p2i(obj), _g1h->addr_to_region(cast_from_oop<HeapWord*>(obj)), p2i(p));
- if (!region_attr.is_in_cset()) {
- // In this case somebody else already did all the work.
- return;
- }
+ assert(region_attr.is_in_cset(), "Must be!");
markWord m = obj->mark();
if (m.is_marked()) {
diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
index 9eebe411936..b90d18f8bb2 100644
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
@@ -178,11 +178,6 @@ void G1ParScanThreadState::do_oop_evac(T* p) {
// Reference should not be NULL here as such are never pushed to the task queue.
oop obj = RawAccess<IS_NOT_NULL>::oop_load(p);
- // Although we never intentionally push references outside of the collection
- // set, due to (benign) races in the claim mechanism during RSet scanning more
- // than one thread might claim the same card. So the same card may be
- // processed multiple times, and so we might get references into old gen here.
- // So we need to redo this check.
const G1HeapRegionAttr region_attr = _g1h->region_attr(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.
@@ -190,10 +185,7 @@ void G1ParScanThreadState::do_oop_evac(T* p) {
"Obj " PTR_FORMAT " should not refer to humongous region %u from " PTR_FORMAT,
p2i(obj), _g1h->addr_to_region(cast_from_oop<HeapWord*>(obj)), p2i(p));
- if (!region_attr.is_in_cset()) {
- // In this case somebody else already did all the work.
- return;
- }
+ assert(region_attr.is_in_cset(), "Must be!");
markWord m = obj->mark();
if (m.is_marked()) {
- relates to
-
JDK-8270924 G1: Investigate to avoid scanning an object in card table for multiple times
-
- Open
-