The StackReference<> pointer held by a Handle<> can be used
without holding the mutator lock. We already do that when
we copy Handle<>s around. Only accessing the actual content
of the pointed-to StackReference<> needs to be done while
holding the mutator lock.
Change-Id: I5f93bd7e277383192f1f16dff6883ecb26387414
static ReferenceTypeInfo CreateInvalid() { return ReferenceTypeInfo(); }
- static bool IsValidHandle(TypeHandle handle) SHARED_REQUIRES(Locks::mutator_lock_) {
+ static bool IsValidHandle(TypeHandle handle) {
return handle.GetReference() != nullptr;
}
void FinalizeHandleScope(Thread* self) SHARED_REQUIRES(Locks::mutator_lock_);
- StackReference<mirror::Object>* GetFirstHandleScopeEntry()
- SHARED_REQUIRES(Locks::mutator_lock_) {
+ StackReference<mirror::Object>* GetFirstHandleScopeEntry() {
return handle_scope_->GetHandle(0).GetReference();
}
return reinterpret_cast<jobject>(reference_);
}
- ALWAYS_INLINE StackReference<mirror::Object>* GetReference()
- SHARED_REQUIRES(Locks::mutator_lock_) {
+ ALWAYS_INLINE StackReference<mirror::Object>* GetReference() {
return reference_;
}
ALWAYS_INLINE mirror::Object* GetReference(size_t i) const
SHARED_REQUIRES(Locks::mutator_lock_);
- ALWAYS_INLINE Handle<mirror::Object> GetHandle(size_t i)
- SHARED_REQUIRES(Locks::mutator_lock_);
+ ALWAYS_INLINE Handle<mirror::Object> GetHandle(size_t i);
ALWAYS_INLINE MutableHandle<mirror::Object> GetMutableHandle(size_t i)
SHARED_REQUIRES(Locks::mutator_lock_);