Skip to content

Commit 5537ce9

Browse files
committed
Unset mark status of all objects in fixup phase.
1 parent 951d307 commit 5537ce9

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
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/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)