625 #ifndef JVMTI_KERNEL |
625 #ifndef JVMTI_KERNEL |
626 static inline klassOop oop_to_klassOop(oop obj) { |
626 static inline klassOop oop_to_klassOop(oop obj) { |
627 klassOop k = obj->klass(); |
627 klassOop k = obj->klass(); |
628 |
628 |
629 // if the object is a java.lang.Class then return the java mirror |
629 // if the object is a java.lang.Class then return the java mirror |
630 if (k == SystemDictionary::class_klass()) { |
630 if (k == SystemDictionary::Class_klass()) { |
631 if (!java_lang_Class::is_primitive(obj)) { |
631 if (!java_lang_Class::is_primitive(obj)) { |
632 k = java_lang_Class::as_klassOop(obj); |
632 k = java_lang_Class::as_klassOop(obj); |
633 assert(k != NULL, "class for non-primitive mirror must exist"); |
633 assert(k != NULL, "class for non-primitive mirror must exist"); |
634 } |
634 } |
635 } |
635 } |
1894 JvmtiVMObjectAllocEventCollector *collector; |
1894 JvmtiVMObjectAllocEventCollector *collector; |
1895 collector = state->get_vm_object_alloc_event_collector(); |
1895 collector = state->get_vm_object_alloc_event_collector(); |
1896 if (collector != NULL && collector->is_enabled()) { |
1896 if (collector != NULL && collector->is_enabled()) { |
1897 // Don't record classes as these will be notified via the ClassLoad |
1897 // Don't record classes as these will be notified via the ClassLoad |
1898 // event. |
1898 // event. |
1899 if (obj->klass() != SystemDictionary::class_klass()) { |
1899 if (obj->klass() != SystemDictionary::Class_klass()) { |
1900 collector->record_allocation(obj); |
1900 collector->record_allocation(obj); |
1901 } |
1901 } |
1902 } |
1902 } |
1903 } |
1903 } |
1904 } |
1904 } |