hotspot/src/share/vm/runtime/vmThread.cpp
void VMThread::evaluate_operation(VM_Operation* op) {
{- -------------------------------------------
(1) (変数宣言など)
---------------------------------------- -}
ResourceMark rm;
{
{- -------------------------------------------
(1) (プロファイル情報の記録) ("sun.threads.vmOperationTime") (See: PerfTraceTime)
---------------------------------------- -}
PerfTraceTime vm_op_timer(perf_accumulated_vm_operation_time());
{- -------------------------------------------
(1) (DTrace のフック点)
---------------------------------------- -}
HS_DTRACE_PROBE3(hotspot, vmops__begin, op->name(), strlen(op->name()),
op->evaluation_mode());
{- -------------------------------------------
(1) VM_Operation::evaluate() を呼び出して VM_Operation を実行する.
---------------------------------------- -}
op->evaluate();
{- -------------------------------------------
(1) (DTrace のフック点)
---------------------------------------- -}
HS_DTRACE_PROBE3(hotspot, vmops__end, op->name(), strlen(op->name()),
op->evaluation_mode());
}
{- -------------------------------------------
(1) (変数宣言など)
---------------------------------------- -}
// Last access of info in _cur_vm_operation!
bool c_heap_allocated = op->is_cheap_allocated();
{- -------------------------------------------
(1) VM_Operation の完了を待っている JavaThread がいる場合には(= VM_Operation::evaluate_concurrently() が false の場合には),
完了したことが分かるようにカウンタを増加させておく.
(See: VMThread::execute())
---------------------------------------- -}
// Mark as completed
if (!op->evaluate_concurrently()) {
op->calling_thread()->increment_vm_operation_completed_count();
}
// It is unsafe to access the _cur_vm_operation after the 'increment_vm_operation_completed_count' call,
// since if it is stack allocated the calling thread might have deallocated
{- -------------------------------------------
(1) もし VM_Operation オブジェクトが C ヒープ上に確保されたものであれば delete しておく.
---------------------------------------- -}
if (c_heap_allocated) {
delete _cur_vm_operation;
}
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.