summaryrefslogtreecommitdiff
path: root/runtime/handle_scope-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/handle_scope-inl.h')
-rw-r--r--runtime/handle_scope-inl.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/runtime/handle_scope-inl.h b/runtime/handle_scope-inl.h
index 2e1b8ed3a0..75a0391086 100644
--- a/runtime/handle_scope-inl.h
+++ b/runtime/handle_scope-inl.h
@@ -21,6 +21,7 @@
#include "base/mutex.h"
#include "handle.h"
+#include "obj_ptr-inl.h"
#include "thread-inl.h"
#include "verify_object-inl.h"
@@ -107,12 +108,21 @@ inline MutableHandle<T> StackHandleScope<kNumReferences>::NewHandle(T* object) {
return h;
}
+template<size_t kNumReferences> template<class MirrorType, bool kPoison>
+inline MutableHandle<MirrorType> StackHandleScope<kNumReferences>::NewHandle(
+ ObjPtr<MirrorType, kPoison> object) {
+ return NewHandle(object.Decode());
+}
+
template<size_t kNumReferences> template<class T>
inline HandleWrapper<T> StackHandleScope<kNumReferences>::NewHandleWrapper(T** object) {
- SetReference(pos_, *object);
- MutableHandle<T> h(GetHandle<T>(pos_));
- pos_++;
- return HandleWrapper<T>(object, h);
+ return HandleWrapper<T>(object, NewHandle(*object));
+}
+
+template<size_t kNumReferences> template<class T>
+inline HandleWrapperObjPtr<T> StackHandleScope<kNumReferences>::NewHandleWrapper(
+ ObjPtr<T>* object) {
+ return HandleWrapperObjPtr<T>(object, NewHandle(*object));
}
template<size_t kNumReferences>