From eb8167a4f4d27fce0530f6724ab8032610cd146b Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Wed, 7 May 2014 15:43:14 -0700 Subject: 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 --- runtime/reflection_test.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'runtime/reflection_test.cc') diff --git a/runtime/reflection_test.cc b/runtime/reflection_test.cc index f7fc0202ca..3b66abee2a 100644 --- a/runtime/reflection_test.cc +++ b/runtime/reflection_test.cc @@ -87,10 +87,10 @@ class ReflectionTest : public CommonCompilerTest { const char* class_name = is_static ? "StaticLeafMethods" : "NonStaticLeafMethods"; jobject jclass_loader(LoadDex(class_name)); Thread* self = Thread::Current(); - SirtRef null_class_loader(self, nullptr); - SirtRef - class_loader(self, - ScopedObjectAccessUnchecked(self).Decode(jclass_loader)); + StackHandleScope<2> hs(self); + Handle class_loader( + hs.NewHandle( + ScopedObjectAccessUnchecked(self).Decode(jclass_loader))); if (is_static) { MakeExecutable(ScopedObjectAccessUnchecked(self).Decode(jclass_loader), class_name); @@ -485,8 +485,9 @@ TEST_F(ReflectionTest, StaticMainMethod) { TEST_DISABLED_FOR_PORTABLE(); ScopedObjectAccess soa(Thread::Current()); jobject jclass_loader = LoadDex("Main"); - SirtRef - class_loader(soa.Self(), soa.Decode(jclass_loader)); + StackHandleScope<1> hs(soa.Self()); + Handle class_loader( + hs.NewHandle(soa.Decode(jclass_loader))); CompileDirectMethod(class_loader, "Main", "main", "([Ljava/lang/String;)V"); mirror::Class* klass = class_linker_->FindClass(soa.Self(), "LMain;", class_loader); -- cgit v1.2.3