Lines Matching defs:thread
39 EcmaContext::EcmaContext(JSThread *thread)
40 : thread_(thread),
41 vm_(thread->GetEcmaVM()),
48 EcmaContext *EcmaContext::Create(JSThread *thread)
51 auto context = new EcmaContext(thread);
148 void EcmaContext::ClearIcuCache(JSThread *thread)
154 deleteEntry(thread->GetEnv(), icuFormatter.icuObj, vm_);
656 // Getting the cached constpool in runtime means the ai data has not been loaded in current thread.
680 // worker thread need to create and bind the correspoding unshared constpool.
763 void EcmaContext::PrintJSErrorInfo(JSThread *thread, const JSHandle<JSTaggedValue> &exceptionInfo)
765 JSHandle<JSTaggedValue> nameKey = thread->GlobalConstants()->GetHandledNameString();
766 JSHandle<JSTaggedValue> nameValue = JSObject::GetProperty(thread, exceptionInfo, nameKey).GetValue();
767 RETURN_IF_ABRUPT_COMPLETION(thread);
768 JSHandle<EcmaString> name = JSTaggedValue::ToString(thread, nameValue);
770 if (thread->HasPendingException()) {
771 thread->ClearException();
772 name = thread->GetEcmaVM()->GetFactory()->NewFromStdString("<error>");
774 JSHandle<JSTaggedValue> msgKey = thread->GlobalConstants()->GetHandledMessageString();
775 JSHandle<JSTaggedValue> msgValue = JSObject::GetProperty(thread, exceptionInfo, msgKey).GetValue();
776 RETURN_IF_ABRUPT_COMPLETION(thread);
777 JSHandle<EcmaString> msg = JSTaggedValue::ToString(thread, msgValue);
779 if (thread->HasPendingException()) {
780 thread->ClearException();
781 msg = thread->GetEcmaVM()->GetFactory()->NewFromStdString("<error>");
783 JSHandle<JSTaggedValue> stackKey = thread->GlobalConstants()->GetHandledStackString();
784 JSHandle<JSTaggedValue> stackValue = JSObject::GetProperty(thread, exceptionInfo, stackKey).GetValue();
785 RETURN_IF_ABRUPT_COMPLETION(thread);
786 JSHandle<EcmaString> stack = JSTaggedValue::ToString(thread, stackValue);
788 if (thread->HasPendingException()) {
789 thread->ClearException();
790 stack = thread->GetEcmaVM()->GetFactory()->NewFromStdString("<error>");
862 void EcmaContext::MountContext(JSThread *thread)
864 EcmaContext *context = EcmaContext::CreateAndInitialize(thread);
865 thread->SwitchCurrentContext(context);
868 void EcmaContext::UnmountContext(JSThread *thread)
870 EcmaContext *context = thread->GetCurrentEcmaContext();
871 thread->PopContext();
875 EcmaContext *EcmaContext::CreateAndInitialize(JSThread *thread)
877 EcmaContext *context = EcmaContext::Create(thread);
878 thread->PushContext(context);
883 void EcmaContext::CheckAndDestroy(JSThread *thread, EcmaContext *context)
885 if (thread->EraseContext(context)) {