summaryrefslogtreecommitdiffstats
path: root/runtime/handle_scope.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/handle_scope.h')
-rw-r--r--runtime/handle_scope.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/runtime/handle_scope.h b/runtime/handle_scope.h
index 13c939fc3c..beb7ee08b8 100644
--- a/runtime/handle_scope.h
+++ b/runtime/handle_scope.h
@@ -166,11 +166,11 @@ class HandleWrapper : public MutableHandle<T> {
template<size_t kNumReferences>
class PACKED(4) StackHandleScope FINAL : public HandleScope {
public:
- explicit StackHandleScope(Thread* self);
- ~StackHandleScope();
+ explicit ALWAYS_INLINE StackHandleScope(Thread* self, mirror::Object* fill_value = nullptr);
+ ALWAYS_INLINE ~StackHandleScope();
template<class T>
- MutableHandle<T> NewHandle(T* object) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ ALWAYS_INLINE MutableHandle<T> NewHandle(T* object) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
SetReference(pos_, object);
MutableHandle<T> h(GetHandle<T>(pos_));
pos_++;
@@ -178,25 +178,25 @@ class PACKED(4) StackHandleScope FINAL : public HandleScope {
}
template<class T>
- HandleWrapper<T> NewHandleWrapper(T** object) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ ALWAYS_INLINE HandleWrapper<T> NewHandleWrapper(T** object)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
SetReference(pos_, *object);
MutableHandle<T> h(GetHandle<T>(pos_));
pos_++;
return HandleWrapper<T>(object, h);
}
- private:
- template<class T>
- ALWAYS_INLINE MutableHandle<T> GetHandle(size_t i)
+ ALWAYS_INLINE void SetReference(size_t i, mirror::Object* object)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
DCHECK_LT(i, kNumReferences);
- return MutableHandle<T>(&GetReferences()[i]);
+ GetReferences()[i].Assign(object);
}
- ALWAYS_INLINE void SetReference(size_t i, mirror::Object* object)
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ private:
+ template<class T>
+ ALWAYS_INLINE MutableHandle<T> GetHandle(size_t i) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
DCHECK_LT(i, kNumReferences);
- GetReferences()[i].Assign(object);
+ return MutableHandle<T>(&GetReferences()[i]);
}
// Reference storage needs to be first as expected by the HandleScope layout.