summaryrefslogtreecommitdiff
path: root/runtime/native/java_lang_Runtime.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2014-05-07 15:43:14 -0700
committer Mathieu Chartier <mathieuc@google.com> 2014-05-13 14:45:54 -0700
commiteb8167a4f4d27fce0530f6724ab8032610cd146b (patch)
treebcfeaf13ad78f2dd68466bbd0e20c71944f7e854 /runtime/native/java_lang_Runtime.cc
parent6fb66a2bc4e1c0b7931101153e58714991237af7 (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 'runtime/native/java_lang_Runtime.cc')
-rw-r--r--runtime/native/java_lang_Runtime.cc8
1 files changed, 5 insertions, 3 deletions
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 <unistd.h>
#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<mirror::ClassLoader> classLoader(soa.Self(),
- soa.Decode<mirror::ClassLoader*>(javaLoader));
+ StackHandleScope<1> hs(soa.Self());
+ Handle<mirror::ClassLoader> classLoader(
+ hs.NewHandle(soa.Decode<mirror::ClassLoader*>(javaLoader)));
JavaVMExt* vm = Runtime::Current()->GetJavaVM();
bool success = vm->LoadNativeLibrary(filename.c_str(), classLoader, &detail);
if (success) {