hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp
// We preserve the mark which should be replaced at the end and the location
// that it will go. Note that the object that this markOop belongs to isn't
// currently at that address but it will be after phase4
void MarkSweep::preserve_mark(oop obj, markOop mark) {
{- -------------------------------------------
(1) 引数で与えられた oop とその mark を記録しておく.
* もし _preserved_marks に未だ空きがあれば, PreservedMark::init() で _preserved_marks に格納する.
* 空きがなければ, _preserved_mark_stack と _preserved_oop_stack に格納しておく.
(See: PreservedMark)
---------------------------------------- -}
// We try to store preserved marks in the to space of the new generation since
// this is storage which should be available. Most of the time this should be
// sufficient space for the marks we need to preserve but if it isn't we fall
// back to using Stacks to keep track of the overflow.
if (_preserved_count < _preserved_count_max) {
_preserved_marks[_preserved_count++].init(obj, mark);
} else {
_preserved_mark_stack.push(mark);
_preserved_oop_stack.push(obj);
}
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.