diff options
| author | 2014-05-07 15:43:14 -0700 | |
|---|---|---|
| committer | 2014-05-13 14:45:54 -0700 | |
| commit | eb8167a4f4d27fce0530f6724ab8032610cd146b (patch) | |
| tree | bcfeaf13ad78f2dd68466bbd0e20c71944f7e854 /compiler/jni/jni_compiler_test.cc | |
| parent | 6fb66a2bc4e1c0b7931101153e58714991237af7 (diff) | |
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
Diffstat (limited to 'compiler/jni/jni_compiler_test.cc')
| -rw-r--r-- | compiler/jni/jni_compiler_test.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/compiler/jni/jni_compiler_test.cc b/compiler/jni/jni_compiler_test.cc index 6b5e55efa8..6035689f88 100644 --- a/compiler/jni/jni_compiler_test.cc +++ b/compiler/jni/jni_compiler_test.cc @@ -48,7 +48,9 @@ class JniCompilerTest : public CommonCompilerTest { void CompileForTest(jobject class_loader, bool direct, const char* method_name, const char* method_sig) { ScopedObjectAccess soa(Thread::Current()); - SirtRef<mirror::ClassLoader> loader(soa.Self(), soa.Decode<mirror::ClassLoader*>(class_loader)); + StackHandleScope<1> hs(soa.Self()); + Handle<mirror::ClassLoader> loader( + hs.NewHandle(soa.Decode<mirror::ClassLoader*>(class_loader))); // Compile the native method before starting the runtime mirror::Class* c = class_linker_->FindClass(soa.Self(), "LMyClassNatives;", loader); mirror::ArtMethod* method; @@ -153,8 +155,9 @@ TEST_F(JniCompilerTest, CompileAndRunIntMethodThroughStub) { ScopedObjectAccess soa(Thread::Current()); std::string reason; - SirtRef<mirror::ClassLoader> class_loader(soa.Self(), - soa.Decode<mirror::ClassLoader*>(class_loader_)); + StackHandleScope<1> hs(soa.Self()); + Handle<mirror::ClassLoader> class_loader( + hs.NewHandle(soa.Decode<mirror::ClassLoader*>(class_loader_))); ASSERT_TRUE( Runtime::Current()->GetJavaVM()->LoadNativeLibrary("", class_loader, &reason)) << reason; @@ -169,8 +172,9 @@ TEST_F(JniCompilerTest, CompileAndRunStaticIntMethodThroughStub) { ScopedObjectAccess soa(Thread::Current()); std::string reason; - SirtRef<mirror::ClassLoader> class_loader(soa.Self(), - soa.Decode<mirror::ClassLoader*>(class_loader_)); + StackHandleScope<1> hs(soa.Self()); + Handle<mirror::ClassLoader> class_loader( + hs.NewHandle(soa.Decode<mirror::ClassLoader*>(class_loader_))); ASSERT_TRUE( Runtime::Current()->GetJavaVM()->LoadNativeLibrary("", class_loader, &reason)) << reason; |