Fix some HandleScope bugs and add corresponding checks
Some places were creating or destroying handle scopes without holding
the mutator lock. This can cause GC crashes if thread roots are being
marked or hprof dumps to also fail.
Also added checks to catch some of these errors.
Bug: 23468617
Change-Id: I1a2d615923484cfc25014967656775c445aa3f1f
diff --git a/compiler/driver/compiler_driver_test.cc b/compiler/driver/compiler_driver_test.cc
index e35d07d..a5ace0b 100644
--- a/compiler/driver/compiler_driver_test.cc
+++ b/compiler/driver/compiler_driver_test.cc
@@ -210,8 +210,8 @@
CompileAll(class_loader);
ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
- StackHandleScope<1> hs(self);
ScopedObjectAccess soa(self);
+ StackHandleScope<1> hs(self);
Handle<mirror::ClassLoader> h_loader(hs.NewHandle(
reinterpret_cast<mirror::ClassLoader*>(self->DecodeJObject(class_loader))));
mirror::Class* klass = class_linker->FindClass(self, "LStaticLeafMethods;", h_loader);