Skip to content

Commit b4f3706

Browse files
committed
[GR-71015] Unset mark status of all objects in fixup phase.
PullRequest: graal/22465
2 parents 3976780 + 1f7a5d2 commit b4f3706

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/CompactingOldGeneration.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,17 @@ private void fixupReferencesBeforeCompaction(ChunkReleaser chunkReleaser, Timers
336336
oldFixupAlignedChunksTimer.stop();
337337
}
338338

339+
/*
340+
* Check each unaligned object and fix its references if the object is marked. Add the chunk
341+
* to the releaser's list in case the object is not marked and therefore won't survive.
342+
*/
343+
Timer oldFixupUnalignedChunksTimer = timers.oldFixupUnalignedChunks.start();
344+
try {
345+
fixupUnalignedChunkReferences(chunkReleaser);
346+
} finally {
347+
oldFixupUnalignedChunksTimer.stop();
348+
}
349+
339350
Timer oldFixupImageHeapTimer = timers.oldFixupImageHeap.start();
340351
try {
341352
for (ImageHeapInfo info : HeapImpl.getImageHeapInfos()) {
@@ -374,17 +385,6 @@ private void fixupReferencesBeforeCompaction(ChunkReleaser chunkReleaser, Timers
374385
oldFixupStackTimer.stop();
375386
}
376387

377-
/*
378-
* Check each unaligned object and fix its references if the object is marked. Add the chunk
379-
* to the releaser's list in case the object is not marked and therefore won't survive.
380-
*/
381-
Timer oldFixupUnalignedChunksTimer = timers.oldFixupUnalignedChunks.start();
382-
try {
383-
fixupUnalignedChunkReferences(chunkReleaser);
384-
} finally {
385-
oldFixupUnalignedChunksTimer.stop();
386-
}
387-
388388
Timer oldFixupRuntimeCodeCacheTimer = timers.oldFixupRuntimeCodeCache.start();
389389
try {
390390
if (RuntimeCompilation.isEnabled()) {

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/ReferenceObjectProcessing.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ private static boolean maybeUpdateForwardedReference(Reference<?> dr, Pointer re
246246
@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
247247
private static boolean willSurviveThisCollection(Object obj) {
248248
if (SerialGCOptions.useCompactingOldGen() && GCImpl.getGCImpl().isCompleteCollection()) {
249+
// Only for discovery, during processing for enqueuing mark status is already cleared
249250
return ObjectHeaderImpl.isMarked(obj);
250251
}
251252
HeapChunk.Header<?> chunk = HeapChunk.getEnclosingHeapChunk(obj);

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/compacting/ObjectMoveInfo.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ public static void walkObjectsForFixup(AlignedHeapChunk.AlignedHeader chunk, Obj
180180
while (p.notEqual(objSeqEnd)) {
181181
assert p.belowThan(objSeqEnd);
182182
Object obj = p.toObjectNonNull();
183+
ObjectHeaderImpl.unsetMarkedAndKeepRememberedSetBit(obj);
183184
UnsignedWord objSize = LayoutEncoding.getSizeFromObjectInlineInGC(obj);
184185

185186
/*

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/compacting/ObjectRefFixupVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private static void visitObjectReference(Pointer objRef, boolean compressed, Obj
7272
|| holderObject == null // references from CodeInfo, invalidated or weak
7373
|| holderObject instanceof Reference<?>; // cleared referent
7474

75-
Object obj = newLocation.toObjectNonNull();
75+
Object obj = newLocation.toObject();
7676
ReferenceAccess.singleton().writeObjectAt(objRef, obj, compressed);
7777
}
7878
// Note that image heap cards have already been cleaned and re-marked during the scan

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/compacting/PlanningVisitor.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ public boolean visitChunk(AlignedHeapChunk.AlignedHeader chunk) {
9999
}
100100

101101
if (ObjectHeaderImpl.isMarkedHeader(header)) {
102-
ObjectHeaderImpl.unsetMarkedAndKeepRememberedSetBit(p.toObjectNonNull());
103-
104102
/*
105103
* Adding the optional identity hash field would increase an object's size, so we
106104
* should have copied all objects that need one during marking instead.

0 commit comments

Comments
 (0)