hotspot/src/share/vm/runtime/safepoint.cpp
void SafepointSynchronize::deferred_initialize_stat() {
{- -------------------------------------------
(1) 既に初期化が終わっていれば, 何もする必要は無い. ここでリターン.
---------------------------------------- -}
if (init_done) return;
{- -------------------------------------------
(1) PrintSafepointStatisticsCount オプションに不正な値が指定されていたら, ここで強制終了.
---------------------------------------- -}
if (PrintSafepointStatisticsCount <= 0) {
fatal("Wrong PrintSafepointStatisticsCount");
}
{- -------------------------------------------
(1) 以下の変数の初期化を行う.
* PrintSafepointStatistics
* _safepoint_stats
* need_to_track_page_armed_status
---------------------------------------- -}
// If PrintSafepointStatisticsTimeout is specified, the statistics data will
// be printed right away, in which case, _safepoint_stats will regress to
// a single element array. Otherwise, it is a circular ring buffer with default
// size of PrintSafepointStatisticsCount.
int stats_array_size;
if (PrintSafepointStatisticsTimeout > 0) {
stats_array_size = 1;
PrintSafepointStatistics = true;
} else {
stats_array_size = PrintSafepointStatisticsCount;
}
_safepoint_stats = (SafepointStats*)os::malloc(stats_array_size
* sizeof(SafepointStats));
guarantee(_safepoint_stats != NULL,
"not enough memory for safepoint instrumentation data");
if (UseCompilerSafepoints && DeferPollingPageLoopCount >= 0) {
need_to_track_page_armed_status = true;
}
{- -------------------------------------------
(1) 初期化が終わったので, init_done を 1 にする.
---------------------------------------- -}
init_done = true;
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.