hotspot/src/share/vm/prims/jvmtiExport.cpp
// Collect all the vm internally allocated objects which are visible to java world
void JvmtiExport::record_vm_internal_object_allocation(oop obj) {
{- -------------------------------------------
(1)
---------------------------------------- -}
Thread* thread = ThreadLocalStorage::thread();
if (thread != NULL && thread->is_Java_thread()) {
// Can not take safepoint here.
No_Safepoint_Verifier no_sfpt;
// Can not take safepoint here so can not use state_for to get
// jvmti thread state.
JvmtiThreadState *state = ((JavaThread*)thread)->jvmti_thread_state();
if (state != NULL ) {
// state is non NULL when VMObjectAllocEventCollector is enabled.
JvmtiVMObjectAllocEventCollector *collector;
collector = state->get_vm_object_alloc_event_collector();
if (collector != NULL && collector->is_enabled()) {
// Don't record classes as these will be notified via the ClassLoad
// event.
if (obj->klass() != SystemDictionary::Class_klass()) {
collector->record_allocation(obj);
}
}
}
}
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.