hotspot/src/share/vm/runtime/biasedLocking.cpp
void BiasedLocking::restore_marks() {
{- -------------------------------------------
(1) UseBiasedLocking オプションが指定されていない場合は, 何もすることはないので, ここでリターン.
---------------------------------------- -}
if (!UseBiasedLocking)
return;
{- -------------------------------------------
(1) (assert)
---------------------------------------- -}
assert(_preserved_oop_stack != NULL, "double free");
assert(_preserved_mark_stack != NULL, "double free");
{- -------------------------------------------
(1) _preserved_oop_stack 内の全ての要素について,
oopDesc::set_mark() を呼んで
mark フィールドの値を GC 前の値に戻す.
---------------------------------------- -}
int len = _preserved_oop_stack->length();
for (int i = 0; i < len; i++) {
Handle owner = _preserved_oop_stack->at(i);
markOop mark = _preserved_mark_stack->at(i);
owner->set_mark(mark);
}
{- -------------------------------------------
(1) _preserved_oop_stack と _preserved_mark_stack 用のメモリを解放する.
---------------------------------------- -}
delete _preserved_oop_stack;
_preserved_oop_stack = NULL;
delete _preserved_mark_stack;
_preserved_mark_stack = NULL;
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.