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/native/java_lang_Runtime.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'runtime/native/java_lang_Runtime.cc') diff --git a/runtime/native/java_lang_Runtime.cc b/runtime/native/java_lang_Runtime.cc index 636be5d2ab..496a1b251e 100644 --- a/runtime/native/java_lang_Runtime.cc +++ b/runtime/native/java_lang_Runtime.cc @@ -19,12 +19,13 @@ #include #include "gc/heap.h" +#include "handle_scope-inl.h" #include "jni_internal.h" #include "mirror/class_loader.h" #include "runtime.h" #include "scoped_thread_state_change.h" #include "ScopedUtfChars.h" -#include "sirt_ref-inl.h" +#include "verify_object-inl.h" namespace art { @@ -65,8 +66,9 @@ static jstring Runtime_nativeLoad(JNIEnv* env, jclass, jstring javaFilename, job std::string detail; { ScopedObjectAccess soa(env); - SirtRef classLoader(soa.Self(), - soa.Decode(javaLoader)); + StackHandleScope<1> hs(soa.Self()); + Handle classLoader( + hs.NewHandle(soa.Decode(javaLoader))); JavaVMExt* vm = Runtime::Current()->GetJavaVM(); bool success = vm->LoadNativeLibrary(filename.c_str(), classLoader, &detail); if (success) { -- cgit v1.2.3-59-g8ed1b