Add Handle/HandleScope and delete SirtRef.
Delete SirtRef and replaced it with Handle. Handles are value types
which wrap around StackReference*.
Renamed StackIndirectReferenceTable to HandleScope.
Added a scoped handle wrapper which wraps around an Object** and
restores it in its destructor.
Renamed Handle::get -> Get.
Bug: 8473721
Change-Id: Idbfebd4f35af629f0f43931b7c5184b334822c7a
diff --git a/runtime/exception_test.cc b/runtime/exception_test.cc
index feb2331..91a0176 100644
--- a/runtime/exception_test.cc
+++ b/runtime/exception_test.cc
@@ -25,7 +25,7 @@
#include "mirror/stack_trace_element.h"
#include "runtime.h"
#include "scoped_thread_state_change.h"
-#include "sirt_ref.h"
+#include "handle_scope-inl.h"
#include "thread.h"
#include "UniquePtr.h"
#include "vmap_table.h"
@@ -38,13 +38,14 @@
CommonRuntimeTest::SetUp();
ScopedObjectAccess soa(Thread::Current());
- SirtRef<mirror::ClassLoader> class_loader(
- soa.Self(), soa.Decode<mirror::ClassLoader*>(LoadDex("ExceptionHandle")));
+ StackHandleScope<2> hs(soa.Self());
+ Handle<mirror::ClassLoader> class_loader(
+ hs.NewHandle(soa.Decode<mirror::ClassLoader*>(LoadDex("ExceptionHandle"))));
my_klass_ = class_linker_->FindClass(soa.Self(), "LExceptionHandle;", class_loader);
ASSERT_TRUE(my_klass_ != NULL);
- SirtRef<mirror::Class> sirt_klass(soa.Self(), my_klass_);
- class_linker_->EnsureInitialized(sirt_klass, true, true);
- my_klass_ = sirt_klass.get();
+ Handle<mirror::Class> klass(hs.NewHandle(my_klass_));
+ class_linker_->EnsureInitialized(klass, true, true);
+ my_klass_ = klass.Get();
dex_ = my_klass_->GetDexCache()->GetDexFile();