Skip to content

Commit

Permalink
Fixed assertion that broke SerialGC
Browse files Browse the repository at this point in the history
  • Loading branch information
petermz committed May 15, 2023
1 parent c5190e1 commit 1e02a09
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ public boolean visitObjectReferenceInline(Pointer objRef, int innerOffset, boole
counters.noteForwardedReferent();
// Update the reference to point to the forwarded Object.
Object obj = ohi.getForwardedObject(p, header);
assert ParallelGC.singleton().isInParallelPhase() || innerOffset < LayoutEncoding.getSizeFromObjectInGC(obj).rawValue();
assert ParallelGC.isEnabled() && ParallelGC.singleton().isInParallelPhase() ||
innerOffset < LayoutEncoding.getSizeFromObjectInGC(obj).rawValue();
Object offsetObj = (innerOffset == 0) ? obj : Word.objectToUntrackedPointer(obj).add(innerOffset).toObject();
ReferenceAccess.singleton().writeObjectAt(objRef, offsetObj, compressed);
RememberedSet.get().dirtyCardIfNecessary(holderObject, obj);
Expand All @@ -112,7 +113,8 @@ public boolean visitObjectReferenceInline(Pointer objRef, int innerOffset, boole
if (copy != obj) {
// ... update the reference to point to the copy, making the reference black.
counters.noteCopiedReferent();
assert ParallelGC.singleton().isInParallelPhase() || innerOffset < LayoutEncoding.getSizeFromObjectInGC(copy).rawValue();
assert ParallelGC.isEnabled() && ParallelGC.singleton().isInParallelPhase() ||
innerOffset < LayoutEncoding.getSizeFromObjectInGC(copy).rawValue();
Object offsetCopy = (innerOffset == 0) ? copy : Word.objectToUntrackedPointer(copy).add(innerOffset).toObject();
ReferenceAccess.singleton().writeObjectAt(objRef, offsetCopy, compressed);
} else {
Expand Down

0 comments on commit 1e02a09

Please sign in to comment.