hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
void PSMarkSweep::allocate_stacks() {
{- -------------------------------------------
(1) (この関数では, PreservedMark 用の領域の確保を行う.
See: PreservedMark)
---------------------------------------- -}
{- -------------------------------------------
(1) (変数宣言など)
---------------------------------------- -}
ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
PSYoungGen* young_gen = heap->young_gen();
MutableSpace* to_space = young_gen->to_space();
{- -------------------------------------------
(1) _preserved_marks フィールド(及び関連する _preserved_count フィールドと _preserved_count_max フィールド)の値を設定する.
(ここでは, To 領域内の未使用の領域(top から end まで)を PreservedMark 用の領域としている)
---------------------------------------- -}
_preserved_marks = (PreservedMark*)to_space->top();
_preserved_count = 0;
// We want to calculate the size in bytes first.
_preserved_count_max = pointer_delta(to_space->end(), to_space->top(), sizeof(jbyte));
// Now divide by the size of a PreservedMark
_preserved_count_max /= sizeof(PreservedMark);
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.