Replace StackHandleScopeCollection with VariableSizedHandleScope
VariableSizedHandleScope's internal handle scopes are not pushed
directly on the thread. This means that it is safe to intermix with
other types of handle scopes.
Added test.
Test: clean-oat-host && test-art-host
Change-Id: Id2fd1155788428f394d49615d337d9134824c8f0
diff --git a/runtime/native/dalvik_system_VMDebug.cc b/runtime/native/dalvik_system_VMDebug.cc
index 31ce4c1..1852956 100644
--- a/runtime/native/dalvik_system_VMDebug.cc
+++ b/runtime/native/dalvik_system_VMDebug.cc
@@ -265,7 +265,7 @@
if (c == nullptr) {
return 0;
}
- StackHandleScopeCollection hs(soa.Self());
+ VariableSizedHandleScope hs(soa.Self());
std::vector<Handle<mirror::Class>> classes {hs.NewHandle(c)};
uint64_t count = 0;
heap->CountInstances(classes, countAssignable, &count);
@@ -284,7 +284,7 @@
if (decoded_classes == nullptr) {
return nullptr;
}
- StackHandleScopeCollection hs(soa.Self());
+ VariableSizedHandleScope hs(soa.Self());
std::vector<Handle<mirror::Class>> classes;
for (size_t i = 0, count = decoded_classes->GetLength(); i < count; ++i) {
classes.push_back(hs.NewHandle(decoded_classes->Get(i)));