Skip to content

Commit c601849

Browse files
author
Thomas Schatzl
committed
8256038: G1: Improve comment about mark word handling of displaced mark words
Reviewed-by: sjohanss, kbarrett
1 parent a38dd53 commit c601849

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/hotspot/share/gc/g1/g1ParScanThreadState.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,11 @@ oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const regio
490490
age++;
491491
}
492492
if (old_mark.has_displaced_mark_helper()) {
493-
// In this case, we have to install the mark word first,
494-
// otherwise obj looks to be forwarded (the old mark word,
495-
// which contains the forward pointer, was copied)
496-
obj->set_mark(old_mark);
493+
// In this case, we have to install the old mark word containing the
494+
// displacement tag, and update the age in the displaced mark word.
497495
markWord new_mark = old_mark.displaced_mark_helper().set_age(age);
498496
old_mark.set_displaced_mark_helper(new_mark);
497+
obj->set_mark(old_mark);
499498
} else {
500499
obj->set_mark(old_mark.set_age(age));
501500
}

0 commit comments

Comments
 (0)