Lines Matching refs:self

75   SharedLibrary(JNIEnv* env, Thread* self, const std::string& path, void* handle,  in SharedLibrary()  argument
84 jni_on_load_thread_id_(self->GetThreadId()), in SharedLibrary()
90 Thread* self = Thread::Current(); in ~SharedLibrary() local
91 if (self != nullptr) { in ~SharedLibrary()
92 self->GetJniEnv()->DeleteWeakGlobalRef(class_loader_); in ~SharedLibrary()
120 Thread* self = Thread::Current(); in CheckOnLoadResult() local
123 MutexLock mu(self, jni_on_load_lock_); in CheckOnLoadResult()
125 if (jni_on_load_thread_id_ == self->GetThreadId()) { in CheckOnLoadResult()
128 LOG(INFO) << *self << " recursive attempt to load library " << "\"" << path_ << "\""; in CheckOnLoadResult()
132 VLOG(jni) << "[" << *self << " waiting for \"" << path_ << "\" " << "JNI_OnLoad...]"; in CheckOnLoadResult()
133 jni_on_load_cond_.Wait(self); in CheckOnLoadResult()
145 Thread* self = Thread::Current(); in SetResult() local
146 MutexLock mu(self, jni_on_load_lock_); in SetResult()
152 jni_on_load_cond_.Broadcast(self); in SetResult()
273 void* FindNativeMethod(Thread* self, ArtMethod* m, std::string& detail) in FindNativeMethod() argument
288 ScopedThreadSuspension sts(self, kNative); in FindNativeMethod()
289 void* native_code = FindNativeMethodInternal(self, in FindNativeMethod()
304 void* FindNativeMethodInternal(Thread* self, in FindNativeMethodInternal() argument
311 MutexLock mu(self, *Locks::jni_libraries_lock_); in FindNativeMethodInternal()
338 Thread* const self = Thread::Current(); in UnloadNativeLibraries() local
341 MutexLock mu(self, *Locks::jni_libraries_lock_); in UnloadNativeLibraries()
348 if (class_loader != nullptr && self->IsJWeakCleared(class_loader)) { in UnloadNativeLibraries()
356 ScopedThreadSuspension sts(self, kNative); in UnloadNativeLibraries()
358 UnloadLibraries(self->GetJniEnv()->GetVm(), unload_libraries); in UnloadNativeLibraries()
440 Thread* self = Thread::Current(); in AttachCurrentThreadInternal() local
441 if (self != nullptr) { in AttachCurrentThreadInternal()
442 *p_env = self->GetJniEnv(); in AttachCurrentThreadInternal()
559 Thread* self = Thread::Current(); in JniAbort() local
560 ScopedObjectAccess soa(self); in JniAbort()
561 ArtMethod* current_method = self->GetCurrentMethod(nullptr); in JniAbort()
578 ScopedThreadSuspension sts(self, kNative); in JniAbort()
663 jobject JavaVMExt::AddGlobalRef(Thread* self, ObjPtr<mirror::Object> obj) { in AddGlobalRef() argument
671 WriterMutexLock mu(self, *Locks::jni_globals_lock_); in AddGlobalRef()
682 jweak JavaVMExt::AddWeakGlobalRef(Thread* self, ObjPtr<mirror::Object> obj) { in AddWeakGlobalRef() argument
686 MutexLock mu(self, *Locks::jni_weak_globals_lock_); in AddWeakGlobalRef()
690 while (!kUseReadBarrier && UNLIKELY(!MayAccessWeakGlobals(self))) { in AddWeakGlobalRef()
693 self->CheckEmptyCheckpointFromWeakRefAccess(Locks::jni_weak_globals_lock_); in AddWeakGlobalRef()
694 weak_globals_add_condition_.WaitHoldingLocks(self); in AddWeakGlobalRef()
705 void JavaVMExt::DeleteGlobalRef(Thread* self, jobject obj) { in DeleteGlobalRef() argument
710 WriterMutexLock mu(self, *Locks::jni_globals_lock_); in DeleteGlobalRef()
719 void JavaVMExt::DeleteWeakGlobalRef(Thread* self, jweak obj) { in DeleteWeakGlobalRef() argument
723 MutexLock mu(self, *Locks::jni_weak_globals_lock_); in DeleteWeakGlobalRef()
749 Thread* self = Thread::Current(); in DumpForSigQuit() local
751 ReaderMutexLock mu(self, *Locks::jni_globals_lock_); in DumpForSigQuit()
755 MutexLock mu(self, *Locks::jni_weak_globals_lock_); in DumpForSigQuit()
763 MutexLock mu(self, *Locks::jni_libraries_lock_); in DumpForSigQuit()
770 Thread* const self = Thread::Current(); in DisallowNewWeakGlobals() local
771 MutexLock mu(self, *Locks::jni_weak_globals_lock_); in DisallowNewWeakGlobals()
775 Locks::mutator_lock_->AssertExclusiveHeld(self); in DisallowNewWeakGlobals()
781 Thread* self = Thread::Current(); in AllowNewWeakGlobals() local
782 MutexLock mu(self, *Locks::jni_weak_globals_lock_); in AllowNewWeakGlobals()
784 weak_globals_add_condition_.Broadcast(self); in AllowNewWeakGlobals()
788 Thread* self = Thread::Current(); in BroadcastForNewWeakGlobals() local
789 MutexLock mu(self, *Locks::jni_weak_globals_lock_); in BroadcastForNewWeakGlobals()
790 weak_globals_add_condition_.Broadcast(self); in BroadcastForNewWeakGlobals()
797 void JavaVMExt::UpdateGlobal(Thread* self, IndirectRef ref, ObjPtr<mirror::Object> result) { in UpdateGlobal() argument
798 WriterMutexLock mu(self, *Locks::jni_globals_lock_); in UpdateGlobal()
802 inline bool JavaVMExt::MayAccessWeakGlobals(Thread* self) const { in MayAccessWeakGlobals()
803 return MayAccessWeakGlobalsUnlocked(self); in MayAccessWeakGlobals()
806 inline bool JavaVMExt::MayAccessWeakGlobalsUnlocked(Thread* self) const { in MayAccessWeakGlobalsUnlocked()
807 DCHECK(self != nullptr); in MayAccessWeakGlobalsUnlocked()
809 self->GetWeakRefAccessEnabled() : in MayAccessWeakGlobalsUnlocked()
813 ObjPtr<mirror::Object> JavaVMExt::DecodeWeakGlobal(Thread* self, IndirectRef ref) { in DecodeWeakGlobal() argument
821 if (LIKELY(MayAccessWeakGlobalsUnlocked(self))) { in DecodeWeakGlobal()
824 MutexLock mu(self, *Locks::jni_weak_globals_lock_); in DecodeWeakGlobal()
825 return DecodeWeakGlobalLocked(self, ref); in DecodeWeakGlobal()
828 ObjPtr<mirror::Object> JavaVMExt::DecodeWeakGlobalLocked(Thread* self, IndirectRef ref) { in DecodeWeakGlobalLocked() argument
830 Locks::jni_weak_globals_lock_->AssertHeld(self); in DecodeWeakGlobalLocked()
832 while (UNLIKELY(!MayAccessWeakGlobals(self))) { in DecodeWeakGlobalLocked()
835 self->CheckEmptyCheckpointFromWeakRefAccess(Locks::jni_weak_globals_lock_); in DecodeWeakGlobalLocked()
836 weak_globals_add_condition_.WaitHoldingLocks(self); in DecodeWeakGlobalLocked()
841 ObjPtr<mirror::Object> JavaVMExt::DecodeWeakGlobalDuringShutdown(Thread* self, IndirectRef ref) { in DecodeWeakGlobalDuringShutdown() argument
843 DCHECK(Runtime::Current()->IsShuttingDown(self)); in DecodeWeakGlobalDuringShutdown()
844 if (self != nullptr) { in DecodeWeakGlobalDuringShutdown()
845 return DecodeWeakGlobal(self, ref); in DecodeWeakGlobalDuringShutdown()
854 bool JavaVMExt::IsWeakGlobalCleared(Thread* self, IndirectRef ref) { in IsWeakGlobalCleared() argument
856 MutexLock mu(self, *Locks::jni_weak_globals_lock_); in IsWeakGlobalCleared()
857 while (UNLIKELY(!MayAccessWeakGlobals(self))) { in IsWeakGlobalCleared()
860 self->CheckEmptyCheckpointFromWeakRefAccess(Locks::jni_weak_globals_lock_); in IsWeakGlobalCleared()
861 weak_globals_add_condition_.WaitHoldingLocks(self); in IsWeakGlobalCleared()
870 void JavaVMExt::UpdateWeakGlobal(Thread* self, IndirectRef ref, ObjPtr<mirror::Object> result) { in UpdateWeakGlobal() argument
871 MutexLock mu(self, *Locks::jni_weak_globals_lock_); in UpdateWeakGlobal()
876 Thread* self = Thread::Current(); in DumpReferenceTables() local
878 ReaderMutexLock mu(self, *Locks::jni_globals_lock_); in DumpReferenceTables()
882 MutexLock mu(self, *Locks::jni_weak_globals_lock_); in DumpReferenceTables()
907 Thread* self = Thread::Current(); in LoadNativeLibrary() local
910 MutexLock mu(self, *Locks::jni_libraries_lock_); in LoadNativeLibrary()
1010 Locks::mutator_lock_->AssertNotHeld(self); in LoadNativeLibrary()
1044 self, in LoadNativeLibrary()
1051 MutexLock mu(self, *Locks::jni_libraries_lock_); in LoadNativeLibrary()
1076 ScopedLocalRef<jobject> old_class_loader(env, env->NewLocalRef(self->GetClassLoaderOverride())); in LoadNativeLibrary()
1077 self->SetClassLoaderOverride(class_loader); in LoadNativeLibrary()
1089 self->SetClassLoaderOverride(old_class_loader.get()); in LoadNativeLibrary()
1139 Thread* const self = Thread::Current(); in FindCodeForNativeMethod() local
1140 void* native_method = libraries_->FindNativeMethod(self, m, detail); in FindCodeForNativeMethod()
1149 self->ThrowNewException("Ljava/lang/UnsatisfiedLinkError;", detail.c_str()); in FindCodeForNativeMethod()
1177 Thread* self = Thread::Current(); in VisitRoots() local
1178 ReaderMutexLock mu(self, *Locks::jni_globals_lock_); in VisitRoots()