From e54d992ee75c0924c9a8d4e2f77dacf44c8c651b Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Tue, 11 Oct 2016 19:55:37 -0700 Subject: ART: Add heap iteration callback Add callback support for heap iteration. Visiting of fields will be done in a follow-up. Add a test. Bug: 31385354 Test: m test-art-host-run-test-906-iterate-heap Test: m ART_TEST_GC_STRESS=true ART_TEST_GC_VERIFY=true test-art-host-run-test-906-iterate-heap Change-Id: I7bcf6751e6df4ef58756ba97701050b2ff5eb07b --- runtime/openjdkjvmti/OpenjdkJvmTi.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/openjdkjvmti/OpenjdkJvmTi.cc') diff --git a/runtime/openjdkjvmti/OpenjdkJvmTi.cc b/runtime/openjdkjvmti/OpenjdkJvmTi.cc index 36be2a0127..05da585b3a 100644 --- a/runtime/openjdkjvmti/OpenjdkJvmTi.cc +++ b/runtime/openjdkjvmti/OpenjdkJvmTi.cc @@ -39,6 +39,7 @@ #include "art_jvmti.h" #include "base/mutex.h" #include "events-inl.h" +#include "heap.h" #include "jni_env_ext-inl.h" #include "object_tagging.h" #include "obj_ptr-inl.h" @@ -276,7 +277,8 @@ class JvmtiFunctions { jclass klass, const jvmtiHeapCallbacks* callbacks, const void* user_data) { - return ERR(NOT_IMPLEMENTED); + HeapUtil heap_util(&gObjectTagTable); + return heap_util.IterateThroughHeap(env, heap_filter, klass, callbacks, user_data); } static jvmtiError GetTag(jvmtiEnv* env, jobject object, jlong* tag_ptr) { -- cgit v1.2.3-59-g8ed1b