hotspot/src/share/vm/prims/jvmtiCodeBlobEvents.cpp
// called for each CodeBlob in the CodeCache
//
// This function filters out nmethods as it is only interested in
// other CodeBlobs. This function also filters out CodeBlobs that have
// a duplicate starting address as previous blobs. This is needed to
// handle the case where multiple stubs are generated into a single
// BufferBlob.
void CodeBlobCollector::do_blob(CodeBlob* cb) {
{- -------------------------------------------
(1) nmethod だった場合は, 情報の収集対象としないのですぐにリターン
---------------------------------------- -}
// ignore nmethods
if (cb->is_nmethod()) {
return;
}
{- -------------------------------------------
(1) 既に同じ start address のものが登録済みであれば登録しない (ここでリターン)
(関数の docstring コメントに書いてあるが,
複数の stub が一つの BufferBlob に生成されたようなケースで, 重複して登録はしないようにしている模様)
---------------------------------------- -}
// check if this starting address has been seen already - the
// assumption is that stubs are inserted into the list before the
// enclosing BufferBlobs.
address addr = cb->code_begin();
for (int i=0; i<_global_code_blobs->length(); i++) {
JvmtiCodeBlobDesc* scb = _global_code_blobs->at(i);
if (addr == scb->code_begin()) {
return;
}
}
{- -------------------------------------------
(1) 新しい JvmtiCodeBlobDesc を作り, 配列内に追加する.
---------------------------------------- -}
// record the CodeBlob details as a JvmtiCodeBlobDesc
JvmtiCodeBlobDesc* scb = new JvmtiCodeBlobDesc(cb->name(), cb->code_begin(), cb->code_end());
_global_code_blobs->append(scb);
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.