< prev index next >
src/hotspot/share/prims/jvmtiTagMap.cpp
Print this page
*** 53,63 ****
#include "runtime/thread.inline.hpp"
#include "runtime/threadSMR.hpp"
#include "runtime/vframe.hpp"
#include "runtime/vmThread.hpp"
#include "runtime/vm_operations.hpp"
- #include "services/serviceUtil.hpp"
#include "utilities/macros.hpp"
// JvmtiTagHashmapEntry
//
// Each entry encapsulates a reference to the tagged object
--- 53,62 ----
*** 1322,1334 ****
// invoked for each object in the heap
void IterateOverHeapObjectClosure::do_object(oop o) {
// check if iteration has been halted
if (is_iteration_aborted()) return;
- // ignore any objects that aren't visible to profiler
- if (!ServiceUtil::visible_oop(o)) return;
-
// instanceof check when filtering by klass
if (klass() != NULL && !o->is_a(klass())) {
return;
}
// prepare for the calllback
--- 1321,1330 ----
*** 1405,1417 ****
// invoked for each object in the heap
void IterateThroughHeapObjectClosure::do_object(oop obj) {
// check if iteration has been halted
if (is_iteration_aborted()) return;
- // ignore any objects that aren't visible to profiler
- if (!ServiceUtil::visible_oop(obj)) return;
-
// apply class filter
if (is_filtered_by_klass_filter(obj, klass())) return;
// prepare for callback
CallbackWrapper wrapper(tag_map(), obj);
--- 1401,1410 ----
*** 1985,1996 ****
}
// invoke basic style heap root callback
inline bool CallbackInvoker::invoke_basic_heap_root_callback(jvmtiHeapRootKind root_kind, oop obj) {
- assert(ServiceUtil::visible_oop(obj), "checking");
-
// if we heap roots should be reported
jvmtiHeapRootCallback cb = basic_context()->heap_root_callback();
if (cb == NULL) {
return check_for_visit(obj);
}
--- 1978,1987 ----
*** 2014,2025 ****
jlong thread_tag,
jint depth,
jmethodID method,
int slot,
oop obj) {
- assert(ServiceUtil::visible_oop(obj), "checking");
-
// if we stack refs should be reported
jvmtiStackReferenceCallback cb = basic_context()->stack_ref_callback();
if (cb == NULL) {
return check_for_visit(obj);
}
--- 2005,2014 ----
*** 2046,2058 ****
inline bool CallbackInvoker::invoke_basic_object_reference_callback(jvmtiObjectReferenceKind ref_kind,
oop referrer,
oop referree,
jint index) {
- assert(ServiceUtil::visible_oop(referrer), "checking");
- assert(ServiceUtil::visible_oop(referree), "checking");
-
BasicHeapWalkContext* context = basic_context();
// callback requires the referrer's tag. If it's the same referrer
// as the last call then we use the cached value.
jlong referrer_tag;
--- 2035,2044 ----
*** 2090,2101 ****
}
// invoke advanced style heap root callback
inline bool CallbackInvoker::invoke_advanced_heap_root_callback(jvmtiHeapReferenceKind ref_kind,
oop obj) {
- assert(ServiceUtil::visible_oop(obj), "checking");
-
AdvancedHeapWalkContext* context = advanced_context();
// check that callback is provided
jvmtiHeapReferenceCallback cb = context->heap_reference_callback();
if (cb == NULL) {
--- 2076,2085 ----
*** 2146,2157 ****
int depth,
jmethodID method,
jlocation bci,
jint slot,
oop obj) {
- assert(ServiceUtil::visible_oop(obj), "checking");
-
AdvancedHeapWalkContext* context = advanced_context();
// check that callback is provider
jvmtiHeapReferenceCallback cb = context->heap_reference_callback();
if (cb == NULL) {
--- 2130,2139 ----
*** 2221,2233 ****
jint index)
{
// field index is only valid field in reference_info
static jvmtiHeapReferenceInfo reference_info = { 0 };
- assert(ServiceUtil::visible_oop(referrer), "checking");
- assert(ServiceUtil::visible_oop(obj), "checking");
-
AdvancedHeapWalkContext* context = advanced_context();
// check that callback is provider
jvmtiHeapReferenceCallback cb = context->heap_reference_callback();
if (cb == NULL) {
--- 2203,2212 ----
*** 2277,2287 ****
// report a "simple root"
inline bool CallbackInvoker::report_simple_root(jvmtiHeapReferenceKind kind, oop obj) {
assert(kind != JVMTI_HEAP_REFERENCE_STACK_LOCAL &&
kind != JVMTI_HEAP_REFERENCE_JNI_LOCAL, "not a simple root");
- assert(ServiceUtil::visible_oop(obj), "checking");
if (is_basic_heap_walk()) {
// map to old style root kind
jvmtiHeapRootKind root_kind = toJvmtiHeapRootKind(kind);
return invoke_basic_heap_root_callback(root_kind, obj);
--- 2256,2265 ----
*** 2602,2618 ****
if (!o->is_instance() || !InstanceKlass::cast(o->klass())->is_mirror_instance_klass()) {
kind = JVMTI_HEAP_REFERENCE_OTHER;
}
}
- // some objects are ignored - in the case of simple
- // roots it's mostly Symbol*s that we are skipping
- // here.
- if (!ServiceUtil::visible_oop(o)) {
- return;
- }
-
// invoke the callback
_continue = CallbackInvoker::report_simple_root(kind, o);
}
virtual void do_oop(narrowOop* obj_p) { ShouldNotReachHere(); }
--- 2580,2589 ----
*** 2649,2662 ****
// ignore null
if (o == NULL) {
return;
}
- if (!ServiceUtil::visible_oop(o)) {
- return;
- }
-
// invoke the callback
_continue = CallbackInvoker::report_jni_local_root(_thread_tag, _tid, _depth, _method, o);
}
virtual void do_oop(narrowOop* obj_p) { ShouldNotReachHere(); }
};
--- 2620,2629 ----
*** 2980,2990 ****
ClassFieldDescriptor* field = field_map->field_at(i);
char type = field->field_type();
if (!is_primitive_field_type(type)) {
oop fld_o = o->obj_field(field->field_offset());
// ignore any objects that aren't visible to profiler
! if (fld_o != NULL && ServiceUtil::visible_oop(fld_o)) {
assert(Universe::heap()->is_in_reserved(fld_o), "unsafe code should not "
"have references to Klass* anymore");
int slot = field->field_index();
if (!CallbackInvoker::report_field_reference(o, fld_o, slot)) {
return false;
--- 2947,2957 ----
ClassFieldDescriptor* field = field_map->field_at(i);
char type = field->field_type();
if (!is_primitive_field_type(type)) {
oop fld_o = o->obj_field(field->field_offset());
// ignore any objects that aren't visible to profiler
! if (fld_o != NULL) {
assert(Universe::heap()->is_in_reserved(fld_o), "unsafe code should not "
"have references to Klass* anymore");
int slot = field->field_index();
if (!CallbackInvoker::report_field_reference(o, fld_o, slot)) {
return false;
< prev index next >