8300540: Serial: Remove obsolete comments in GenMarkSweep

Reviewed-by: tschatzl
This commit is contained in:
Albert Mingkun Yang 2023-01-19 11:52:40 +00:00
parent 8f7faa631b
commit 11df6eb28a

View File

@ -236,16 +236,9 @@ void GenMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) {
void GenMarkSweep::mark_sweep_phase2() {
// Now all live objects are marked, compute the new object addresses.
// It is not required that we traverse spaces in the same order in
// phase2, phase3 and phase4, but the ValidateMarkSweep live oops
// tracking expects us to do so. See comment under phase4.
GenCollectedHeap* gch = GenCollectedHeap::heap();
GCTraceTime(Info, gc, phases) tm("Phase 2: Compute new object addresses", _gc_timer);
gch->prepare_for_compaction();
GenCollectedHeap::heap()->prepare_for_compaction();
}
class GenAdjustPointersClosure: public GenCollectedHeap::GenClosure {
@ -286,20 +279,8 @@ public:
void GenMarkSweep::mark_sweep_phase4() {
// All pointers are now adjusted, move objects accordingly
// It is imperative that we traverse perm_gen first in phase4. All
// classes must be allocated earlier than their instances, and traversing
// perm_gen first makes sure that all Klass*s have moved to their new
// location before any instance does a dispatch through it's klass!
// The ValidateMarkSweep live oops tracking expects us to traverse spaces
// in the same order in phase2, phase3 and phase4. We don't quite do that
// here (perm_gen first rather than last), so we tell the validate code
// to use a higher index (saved from phase2) when verifying perm_gen.
GenCollectedHeap* gch = GenCollectedHeap::heap();
GCTraceTime(Info, gc, phases) tm("Phase 4: Move objects", _gc_timer);
GenCompactClosure blk;
gch->generation_iterate(&blk, true);
GenCollectedHeap::heap()->generation_iterate(&blk, true);
}