diff options
author | 2017-11-22 16:12:29 +0000 | |
---|---|---|
committer | 2017-12-01 09:10:48 +0000 | |
commit | 660be6ff67870d2512230b13effefdbc5abe43e4 (patch) | |
tree | 4a4cde728d6aeb2ea8f1ef63c7e7f82383a9acd0 /runtime/debugger.cc | |
parent | a602c56ba1a82d70eb40de35e7c716477a46ee28 (diff) |
Add VMDebug.getInstancesOfClasses API.
The API can be used to iterate over instances of a given type on the
heap.
The GetInstancesOfClassesBenchmark run on bullhead shows the run time
of the API grows linearly in the number of classes, C, to get instances
of and the number of total instances, N, allocated on the heap.
C N=~2^18 N=~2^19
1 13ms 21ms
2 26ms 43ms
4 53ms 87ms
Bug: 69729799
Test: ./test/testrunner/testrunner.py -t 099-vmdebug -b --host
Change-Id: Ied053d19760e656012e2577776f75a1cc0a14ac3
Diffstat (limited to 'runtime/debugger.cc')
-rw-r--r-- | runtime/debugger.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/debugger.cc b/runtime/debugger.cc index 1dcd935eea..13029fb958 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -963,7 +963,11 @@ JDWP::JdwpError Dbg::GetInstances(JDWP::RefTypeId class_id, int32_t max_count, } VariableSizedHandleScope hs(Thread::Current()); std::vector<Handle<mirror::Object>> raw_instances; - Runtime::Current()->GetHeap()->GetInstances(hs, hs.NewHandle(c), max_count, raw_instances); + Runtime::Current()->GetHeap()->GetInstances(hs, + hs.NewHandle(c), + /* use_is_assignable_from */ false, + max_count, + raw_instances); for (size_t i = 0; i < raw_instances.size(); ++i) { instances->push_back(gRegistry->Add(raw_instances[i].Get())); } |