Lines Matching refs:self

128 extern "C" NO_RETURN void artDeoptimize(Thread* self);
593 Thread* self = reinterpret_cast<Thread*>(arg); in CreateCallback() local
596 LOG(ERROR) << "Thread attaching to non-existent runtime: " << *self; in CreateCallback()
610 CHECK(self->Init(runtime->GetThreadList(), runtime->GetJavaVM(), self->tlsPtr_.tmp_jni_env)); in CreateCallback()
611 self->tlsPtr_.tmp_jni_env = nullptr; in CreateCallback()
615 ScopedObjectAccess soa(self); in CreateCallback()
616 self->InitStringEntryPoints(); in CreateCallback()
619 CHECK(self->tlsPtr_.jpeer != nullptr); in CreateCallback()
620 self->tlsPtr_.opeer = soa.Decode<mirror::Object>(self->tlsPtr_.jpeer).Ptr(); in CreateCallback()
622 self->DeleteJPeer(self->GetJniEnv()); in CreateCallback()
623 self->SetThreadName(self->GetThreadName()->ToModifiedUtf8().c_str()); in CreateCallback()
626 self->SetNativePriority(priorityField->GetInt(self->tlsPtr_.opeer)); in CreateCallback()
628 runtime->GetRuntimeCallbacks()->ThreadStart(self); in CreateCallback()
641 should_unpark = unparkedField->GetBoolean(self->tlsPtr_.opeer) == JNI_TRUE; in CreateCallback()
644 self->Unpark(); in CreateCallback()
647 ObjPtr<mirror::Object> receiver = self->tlsPtr_.opeer; in CreateCallback()
653 Runtime::Current()->GetThreadList()->Unregister(self); in CreateCallback()
818 Thread* self = static_cast<JNIEnvExt*>(env)->GetSelf(); in CreateNativeThread() local
834 self->Dump(LOG_STREAM(INFO)); in CreateNativeThread()
842 MutexLock mu(self, *Locks::runtime_shutdown_lock_); in CreateNativeThread()
898 MutexLock mu(self, *Locks::runtime_shutdown_lock_); in CreateNativeThread()
983 Thread* self; in Attach() local
993 self = new Thread(as_daemon); in Attach()
994 bool init_success = self->Init(runtime->GetThreadList(), runtime->GetJavaVM()); in Attach()
997 delete self; in Attach()
1003 self->InitStringEntryPoints(); in Attach()
1005 CHECK_NE(self->GetState(), kRunnable); in Attach()
1006 self->SetState(kNative); in Attach()
1009 if (!peer_action(self)) { in Attach()
1010 runtime->GetThreadList()->Unregister(self); in Attach()
1021 ScopedObjectAccess soa(self); in Attach()
1022 self->Dump(LOG_STREAM(INFO)); in Attach()
1026 ScopedObjectAccess soa(self); in Attach()
1027 runtime->GetRuntimeCallbacks()->ThreadStart(self); in Attach()
1030 return self; in Attach()
1037 auto create_peer_action = [&](Thread* self) { in Attach() argument
1043 self->CreatePeer(thread_name, as_daemon, thread_group); in Attach()
1044 if (self->IsExceptionPending()) { in Attach()
1048 ScopedObjectAccess soa(self); in Attach()
1050 LOG(ERROR) << self->GetException()->Dump(); in Attach()
1051 self->ClearException(); in Attach()
1058 self->tlsPtr_.name->assign(thread_name); in Attach()
1060 } else if (self->GetJniEnv()->IsCheckJniEnabled()) { in Attach()
1070 auto set_peer_action = [&](Thread* self) { in Attach() argument
1073 DCHECK(self == Thread::Current()); in Attach()
1074 ScopedObjectAccess soa(self); in Attach()
1075 self->tlsPtr_.opeer = soa.Decode<mirror::Object>(thread_peer).Ptr(); in Attach()
1077 self->GetJniEnv()->SetLongField(thread_peer, in Attach()
1079 reinterpret_cast64<jlong>(self)); in Attach()
1119 Thread* self = this; in CreatePeer() local
1120 DCHECK_EQ(self, Thread::Current()); in CreatePeer()
1123 reinterpret_cast64<jlong>(self)); in CreatePeer()
1125 ScopedObjectAccess soa(self); in CreatePeer()
1126 StackHandleScope<1> hs(self); in CreatePeer()
1390 static void UnsafeLogFatalForSuspendCount(Thread* self, Thread* thread) NO_THREAD_SAFETY_ANALYSIS { in UnsafeLogFatalForSuspendCount() argument
1392 Locks::thread_suspend_count_lock_->Unlock(self); in UnsafeLogFatalForSuspendCount()
1393 if (!Locks::mutator_lock_->IsSharedHeld(self)) { in UnsafeLogFatalForSuspendCount()
1394 Locks::mutator_lock_->SharedTryLock(self); in UnsafeLogFatalForSuspendCount()
1395 if (!Locks::mutator_lock_->IsSharedHeld(self)) { in UnsafeLogFatalForSuspendCount()
1399 if (!Locks::thread_list_lock_->IsExclusiveHeld(self)) { in UnsafeLogFatalForSuspendCount()
1400 Locks::thread_list_lock_->TryLock(self); in UnsafeLogFatalForSuspendCount()
1401 if (!Locks::thread_list_lock_->IsExclusiveHeld(self)) { in UnsafeLogFatalForSuspendCount()
1410 bool Thread::ModifySuspendCountInternal(Thread* self, in ModifySuspendCountInternal() argument
1417 Locks::thread_suspend_count_lock_->AssertHeld(self); in ModifySuspendCountInternal()
1418 if (this != self && !IsSuspended()) { in ModifySuspendCountInternal()
1419 Locks::thread_list_lock_->AssertHeld(self); in ModifySuspendCountInternal()
1425 Locks::user_code_suspension_lock_->AssertHeld(self); in ModifySuspendCountInternal()
1432 UnsafeLogFatalForSuspendCount(self, this); in ModifySuspendCountInternal()
1436 if (kUseReadBarrier && delta > 0 && this != self && tlsPtr_.flip_function != nullptr) { in ModifySuspendCountInternal()
1478 bool Thread::PassActiveSuspendBarriers(Thread* self) { in PassActiveSuspendBarriers() argument
1485 MutexLock mu(self, *Locks::thread_suspend_count_lock_); in PassActiveSuspendBarriers()
1625 void Run(Thread* self) override { in Run() argument
1626 wrapped_->Run(self); in Run()
1627 barrier_.Pass(self); in Run()
1630 void Wait(Thread* self, ThreadState suspend_state) { in Wait() argument
1632 barrier_.Increment<Barrier::kDisallowHoldingLocks>(self, 1); in Wait()
1634 barrier_.Increment<Barrier::kAllowHoldingLocks>(self, 1); in Wait()
1645 Thread* self = Thread::Current(); in RequestSynchronousCheckpoint() local
1647 Locks::thread_list_lock_->AssertExclusiveHeld(self); in RequestSynchronousCheckpoint()
1649 Locks::thread_list_lock_->ExclusiveUnlock(self); in RequestSynchronousCheckpoint()
1658 Locks::thread_list_lock_->ExclusiveUnlock(self); in RequestSynchronousCheckpoint()
1678 Locks::thread_list_lock_->AssertExclusiveHeld(self); in RequestSynchronousCheckpoint()
1685 MutexLock mu(self, *Locks::thread_suspend_count_lock_); in RequestSynchronousCheckpoint()
1691 Locks::thread_list_lock_->ExclusiveUnlock(self); in RequestSynchronousCheckpoint()
1692 ScopedThreadStateChange sts(self, suspend_state); in RequestSynchronousCheckpoint()
1693 barrier_closure.Wait(self, suspend_state); in RequestSynchronousCheckpoint()
1703 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in RequestSynchronousCheckpoint()
1705 if (!ModifySuspendCount(self, +1, nullptr, SuspendReason::kInternal)) { in RequestSynchronousCheckpoint()
1715 ScopedThreadListLockUnlock stllu(self); in RequestSynchronousCheckpoint()
1717 ScopedThreadStateChange sts(self, suspend_state); in RequestSynchronousCheckpoint()
1729 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in RequestSynchronousCheckpoint()
1732 bool updated = ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal); in RequestSynchronousCheckpoint()
1739 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in RequestSynchronousCheckpoint()
1740 Thread::resume_cond_->Broadcast(self); in RequestSynchronousCheckpoint()
1744 Locks::thread_list_lock_->ExclusiveUnlock(self); in RequestSynchronousCheckpoint()
1809 Thread* self = Thread::Current(); in DumpState() local
1817 ScopedObjectAccessUnchecked soa(self); in DumpState()
1827 if (gAborting == 0 && self != nullptr && thread != nullptr && thread->tlsPtr_.opeer != nullptr) { in DumpState()
1828 ScopedObjectAccessUnchecked soa(self); in DumpState()
1884 if (Locks::thread_suspend_count_lock_->IsExclusiveHeld(self)) { in DumpState()
1885 Locks::thread_suspend_count_lock_->AssertExclusiveHeld(self); // For annotalysis. in DumpState()
1888 MutexLock mu(self, *Locks::thread_suspend_count_lock_); in DumpState()
2194 Thread* self = reinterpret_cast<Thread*>(arg); in ThreadExitCallback() local
2195 if (self->tls32_.thread_exit_check_count == 0) { in ThreadExitCallback()
2197 "going to use a pthread_key_create destructor?): " << *self; in ThreadExitCallback()
2200 __get_tls()[TLS_SLOT_ART_THREAD_SELF] = self; in ThreadExitCallback()
2202 CHECK_PTHREAD_CALL(pthread_setspecific, (Thread::pthread_key_self_, self), "reattach self"); in ThreadExitCallback()
2203 Thread::self_tls_ = self; in ThreadExitCallback()
2205 self->tls32_.thread_exit_check_count = 1; in ThreadExitCallback()
2207 LOG(FATAL) << "Native thread exited without calling DetachCurrentThread: " << *self; in ThreadExitCallback()
2369 explicit MonitorExitVisitor(Thread* self) : self_(self) { } in MonitorExitVisitor() argument
2388 Thread* self = this; in Destroy() local
2389 DCHECK_EQ(self, Thread::Current()); in Destroy()
2393 ScopedObjectAccess soa(self); in Destroy()
2394 MonitorExitVisitor visitor(self); in Destroy()
2411 ScopedObjectAccess soa(self); in Destroy()
2417 runtime->GetRuntimeCallbacks()->ThreadDeath(self); in Destroy()
2435 StackHandleScope<1> hs(self); in Destroy()
2437 ObjectLock<mirror::Object> locker(self, h_obj); in Destroy()
2444 ScopedObjectAccess soa(self); in Destroy()
2622 void Thread::Interrupt(Thread* self) { in Interrupt() argument
2624 MutexLock mu(self, *wait_mutex_); in Interrupt()
2629 NotifyLocked(self); in Interrupt()
2635 Thread* self = Thread::Current(); in Notify() local
2636 MutexLock mu(self, *wait_mutex_); in Notify()
2637 NotifyLocked(self); in Notify()
2640 void Thread::NotifyLocked(Thread* self) { in NotifyLocked() argument
2642 wait_cond_->Signal(self); in NotifyLocked()
2709 BuildInternalStackTraceVisitor(Thread* self, Thread* thread, int skip_depth) in BuildInternalStackTraceVisitor() argument
2711 self_(self), in BuildInternalStackTraceVisitor()
2989 Thread* self, in CreateAnnotatedStackTrace() argument
2991 : MonitorObjectsStackVisitor(self, context), in CreateAnnotatedStackTrace()
3182 static ObjPtr<mirror::ClassLoader> GetCurrentClassLoader(Thread* self) in GetCurrentClassLoader() argument
3184 ArtMethod* method = self->GetCurrentMethod(nullptr); in GetCurrentClassLoader()
4327 ScopedExceptionStorage::ScopedExceptionStorage(art::Thread* self) in ScopedExceptionStorage() argument
4328 : self_(self), hs_(self_), excp_(hs_.NewHandle<art::mirror::Throwable>(self_->GetException())) { in ScopedExceptionStorage()