Lines Matching full:vm
88 … bool StartDebug(const std::string& componentName, void* vm, bool isDebugMode, int32_t instanceId,
250 void JSNApi::TriggerGC(const EcmaVM *vm, TRIGGER_GC_TYPE gcType) in TriggerGC() argument
252 if (vm->GetJSThread() != nullptr && vm->IsInitialized()) { in TriggerGC()
255 vm->CollectGarbage(ecmascript::TriggerGCType::YOUNG_GC); in TriggerGC()
258 vm->CollectGarbage(ecmascript::TriggerGCType::OLD_GC); in TriggerGC()
261 vm->CollectGarbage(ecmascript::TriggerGCType::FULL_GC); in TriggerGC()
269 void JSNApi::ThrowException(const EcmaVM *vm, Local<JSValueRef> error) in ThrowException() argument
271 auto thread = vm->GetJSThread(); in ThrowException()
277 bool JSNApi::StartDebugger(const char *libraryPath, EcmaVM *vm, bool isDebugMode, int32_t instanceI… in StartDebugger() argument
280 const auto &handler = vm->GetJsDebuggerManager()->GetDebugLibraryHandle(); in StartDebugger()
298 …bool ret = reinterpret_cast<StartDebugger>(sym.Value())("PandaDebugger", vm, isDebugMode, instance… in StartDebugger()
301 vm->GetJsDebuggerManager()->SetDebugMode(isDebugMode); in StartDebugger()
302 vm->GetJsDebuggerManager()->SetDebugLibraryHandle(std::move(handle.Value())); in StartDebugger()
307 bool JSNApi::StopDebugger(EcmaVM *vm) in StopDebugger() argument
309 if (vm == nullptr) { in StopDebugger()
312 const auto &handle = vm->GetJsDebuggerManager()->GetDebugLibraryHandle(); in StopDebugger()
323 vm->GetJsDebuggerManager()->SetDebugMode(false); in StopDebugger()
327 bool JSNApi::StartDebugger(EcmaVM *vm, bool isDebugMode, int32_t instanceId, const DebuggerPostTask… in StartDebugger() argument
329 …bool ret = OHOS::ArkCompiler::Toolchain::StartDebug(DEBUGGER_NAME, vm, isDebugMode, instanceId, de… in StartDebugger()
331 vm->GetJsDebuggerManager()->SetDebugMode(isDebugMode); in StartDebugger()
336 bool JSNApi::StopDebugger(EcmaVM *vm) in StopDebugger() argument
338 if (vm == nullptr) { in StopDebugger()
343 vm->GetJsDebuggerManager()->SetDebugMode(false); in StopDebugger()
348 bool JSNApi::IsMixedDebugEnabled(const EcmaVM *vm) in IsMixedDebugEnabled() argument
350 return vm->GetJsDebuggerManager()->IsMixedDebugEnabled(); in IsMixedDebugEnabled()
353 void JSNApi::NotifyNativeCalling(const EcmaVM *vm, const void *nativeAddress) in NotifyNativeCalling() argument
355 vm->GetJsDebuggerManager()->GetNotificationManager()->NativeCallingEvent(nativeAddress); in NotifyNativeCalling()
359 void JSNApi::LoadAotFile(EcmaVM *vm, const std::string &hapPath) in LoadAotFile() argument
367 vm->LoadAOTFiles(aotFileName); in LoadAotFile()
370 bool JSNApi::Execute(EcmaVM *vm, const std::string &fileName, const std::string &entry, bool needUp… in Execute() argument
373 JSThread *thread = vm->GetAssociatedJSThread(); in Execute()
382 bool JSNApi::Execute(EcmaVM *vm, const uint8_t *data, int32_t size, const std::string &entry, in Execute() argument
386 JSThread *thread = vm->GetAssociatedJSThread(); in Execute()
396 bool JSNApi::ExecuteModuleBuffer(EcmaVM *vm, const uint8_t *data, int32_t size, const std::string &… in ExecuteModuleBuffer() argument
400 JSThread *thread = vm->GetAssociatedJSThread(); in ExecuteModuleBuffer()
408 void JSNApi::PreFork(EcmaVM *vm) in PreFork() argument
410 vm->PreFork(); in PreFork()
413 void JSNApi::PostFork(EcmaVM *vm, const RuntimeOption &option) in PostFork() argument
415 JSRuntimeOptions &jsOption = vm->GetJSOptions(); in PostFork()
420 vm->ResetPGOProfiler(); in PostFork()
427 vm->PostFork(); in PostFork()
445 Local<ObjectRef> JSNApi::GetUncaughtException(const EcmaVM *vm) in GetUncaughtException() argument
447 return JSNApiHelper::ToLocal<ObjectRef>(vm->GetEcmaUncaughtException()); in GetUncaughtException()
450 Local<ObjectRef> JSNApi::GetAndClearUncaughtException(const EcmaVM *vm) in GetAndClearUncaughtException() argument
452 return JSNApiHelper::ToLocal<ObjectRef>(vm->GetAndClearEcmaUncaughtException()); in GetAndClearUncaughtException()
455 bool JSNApi::HasPendingException(const EcmaVM *vm) in HasPendingException() argument
457 return vm->GetJSThread()->HasPendingException(); in HasPendingException()
460 void JSNApi::EnableUserUncaughtErrorHandler(EcmaVM *vm) in EnableUserUncaughtErrorHandler() argument
462 return vm->EnableUserUncaughtErrorHandler(); in EnableUserUncaughtErrorHandler()
465 Local<ObjectRef> JSNApi::GetGlobalObject(const EcmaVM *vm) in GetGlobalObject() argument
467 JSHandle<GlobalEnv> globalEnv = vm->GetGlobalEnv(); in GetGlobalObject()
468 JSHandle<JSTaggedValue> global(vm->GetJSThread(), globalEnv->GetGlobalObject()); in GetGlobalObject()
472 void JSNApi::ExecutePendingJob(const EcmaVM *vm) in ExecutePendingJob() argument
474 EcmaVM::ConstCast(vm)->ExecutePromisePendingJob(); in ExecutePendingJob()
477 uintptr_t JSNApi::GetHandleAddr(const EcmaVM *vm, uintptr_t localAddress) in GetHandleAddr() argument
483 return ecmascript::EcmaHandleScope::NewHandle(vm->GetJSThread(), value); in GetHandleAddr()
486 uintptr_t JSNApi::GetGlobalHandleAddr(const EcmaVM *vm, uintptr_t localAddress) in GetGlobalHandleAddr() argument
492 return vm->GetJSThread()->NewGlobalHandle(value); in GetGlobalHandleAddr()
495 uintptr_t JSNApi::SetWeak(const EcmaVM *vm, uintptr_t localAddress) in SetWeak() argument
500 return vm->GetJSThread()->SetWeak(localAddress); in SetWeak()
503 uintptr_t JSNApi::SetWeakCallback(const EcmaVM *vm, uintptr_t localAddress, void *ref, in SetWeakCallback() argument
509 return vm->GetJSThread()->SetWeak(localAddress, ref, firstCallback, secondCallback); in SetWeakCallback()
512 uintptr_t JSNApi::ClearWeak(const EcmaVM *vm, uintptr_t localAddress) in ClearWeak() argument
522 return vm->GetJSThread()->ClearWeak(localAddress); in ClearWeak()
525 bool JSNApi::IsWeak(const EcmaVM *vm, uintptr_t localAddress) in IsWeak() argument
530 return vm->GetJSThread()->IsWeak(localAddress); in IsWeak()
533 void JSNApi::DisposeGlobalHandleAddr(const EcmaVM *vm, uintptr_t addr) in DisposeGlobalHandleAddr() argument
538 vm->GetJSThread()->DisposeGlobalHandle(addr); in DisposeGlobalHandleAddr()
541 void *JSNApi::SerializeValue(const EcmaVM *vm, Local<JSValueRef> value, Local<JSValueRef> transfer) in SerializeValue() argument
543 ecmascript::JSThread *thread = vm->GetJSThread(); in SerializeValue()
558 Local<JSValueRef> JSNApi::DeserializeValue(const EcmaVM *vm, void *recoder, void *hint) in DeserializeValue() argument
560 ecmascript::JSThread *thread = vm->GetJSThread(); in DeserializeValue()
574 void HostPromiseRejectionTracker(const EcmaVM *vm, in HostPromiseRejectionTracker() argument
580 ecmascript::PromiseRejectCallback promiseRejectCallback = vm->GetPromiseRejectCallback(); in HostPromiseRejectionTracker()
589 void JSNApi::SetHostPromiseRejectionTracker(EcmaVM *vm, void *cb, void* data) in SetHostPromiseRejectionTracker() argument
591 vm->SetHostPromiseRejectionTracker(HostPromiseRejectionTracker); in SetHostPromiseRejectionTracker()
592 vm->SetPromiseRejectCallback(reinterpret_cast<ecmascript::PromiseRejectCallback>(cb)); in SetHostPromiseRejectionTracker()
593 vm->SetData(data); in SetHostPromiseRejectionTracker()
596 void JSNApi::SetHostResolveBufferTracker(EcmaVM *vm, in SetHostResolveBufferTracker() argument
599 vm->SetResolveBufferCallback(cb); in SetHostResolveBufferTracker()
602 void JSNApi::SetNativePtrGetter(EcmaVM *vm, void* cb) in SetNativePtrGetter() argument
604 vm->SetNativePtrGetter(reinterpret_cast<ecmascript::NativePtrGetter>(cb)); in SetNativePtrGetter()
607 void JSNApi::SetHostEnqueueJob(const EcmaVM *vm, Local<JSValueRef> cb) in SetHostEnqueueJob() argument
610 JSHandle<TaggedArray> array = vm->GetFactory()->EmptyArray(); in SetHostEnqueueJob()
611 JSHandle<MicroJobQueue> job = vm->GetMicroJobQueue(); in SetHostEnqueueJob()
612 MicroJobQueue::EnqueueJob(vm->GetJSThread(), job, QueueType::QUEUE_PROMISE, fun, array); in SetHostEnqueueJob()
639 bool JSNApi::ExecuteModuleFromBuffer(EcmaVM *vm, const void *data, int32_t size, const std::string … in ExecuteModuleFromBuffer() argument
641 JSThread *thread = vm->GetAssociatedJSThread(); in ExecuteModuleFromBuffer()
649 Local<ObjectRef> JSNApi::GetExportObject(EcmaVM *vm, const std::string &file, const std::string &ke… in GetExportObject() argument
652 JSThread *thread = vm->GetJSThread(); in GetExportObject()
653 ecmascript::CString name = vm->GetAssetPath(); in GetExportObject()
654 if (!vm->IsBundlePack()) { in GetExportObject()
655 entry = PathHelper::ParseOhmUrl(vm, entry, name); in GetExportObject()
666 ecmascript::ModuleManager *moduleManager = vm->GetModuleManager(); in GetExportObject()
669 int index = ecmascript::ModuleManager::GetExportObjectIndex(vm, ecmaModule, key); in GetExportObject()
674 ObjectFactory *factory = vm->GetFactory(); in GetExportObject()
682 Local<ObjectRef> JSNApi::GetExportObjectFromBuffer(EcmaVM *vm, const std::string &file, in GetExportObjectFromBuffer() argument
685 ecmascript::ModuleManager *moduleManager = vm->GetModuleManager(); in GetExportObjectFromBuffer()
686 JSThread *thread = vm->GetJSThread(); in GetExportObjectFromBuffer()
690 int index = ecmascript::ModuleManager::GetExportObjectIndex(vm, ecmaModule, key); in GetExportObjectFromBuffer()
696 ObjectFactory *factory = vm->GetFactory(); in GetExportObjectFromBuffer()
746 LocalScope::LocalScope(const EcmaVM *vm) : thread_(vm->GetJSThread()) in LocalScope() argument
755 LocalScope::LocalScope(const EcmaVM *vm, JSTaggedType value) : thread_(vm->GetJSThread()) in LocalScope() argument
777 EscapeLocalScope::EscapeLocalScope(const EcmaVM *vm) : LocalScope(vm, JSTaggedValue::Undefined().Ge… in EscapeLocalScope() argument
779 auto thread = vm->GetJSThread(); in EscapeLocalScope()
785 Local<JSValueRef> PrimitiveRef::GetValue(const EcmaVM *vm) in GetValue() argument
790 JSHandle<JSTaggedValue> value = JSHandle<JSTaggedValue>(vm->GetJSThread(), primitiveValue); in GetValue()
797 Local<NumberRef> NumberRef::New(const EcmaVM *vm, double input) in New() argument
799 JSThread *thread = vm->GetJSThread(); in New()
807 Local<NumberRef> NumberRef::New(const EcmaVM *vm, int32_t input) in New() argument
809 JSThread *thread = vm->GetJSThread(); in New()
814 Local<NumberRef> NumberRef::New(const EcmaVM *vm, uint32_t input) in New() argument
816 JSThread *thread = vm->GetJSThread(); in New()
821 Local<NumberRef> NumberRef::New(const EcmaVM *vm, int64_t input) in New() argument
823 JSThread *thread = vm->GetJSThread(); in New()
834 Local<BigIntRef> BigIntRef::New(const EcmaVM *vm, uint64_t input) in New() argument
836 JSThread *thread = vm->GetJSThread(); in New()
842 Local<BigIntRef> BigIntRef::New(const EcmaVM *vm, int64_t input) in New() argument
844 JSThread *thread = vm->GetJSThread(); in New()
850 Local<JSValueRef> BigIntRef::CreateBigWords(const EcmaVM *vm, bool sign, uint32_t size, const uint6… in CreateBigWords() argument
852 JSThread *thread = vm->GetJSThread(); in CreateBigWords()
858 void BigIntRef::BigIntToInt64(const EcmaVM *vm, int64_t *cValue, bool *lossless) in BigIntToInt64() argument
860 JSThread *thread = vm->GetJSThread(); in BigIntToInt64()
865 void BigIntRef::BigIntToUint64(const EcmaVM *vm, uint64_t *cValue, bool *lossless) in BigIntToUint64() argument
867 JSThread *thread = vm->GetJSThread(); in BigIntToUint64()
899 Local<BooleanRef> BooleanRef::New(const EcmaVM *vm, bool input) in New() argument
901 JSThread *thread = vm->GetJSThread(); in New()
912 Local<IntegerRef> IntegerRef::New(const EcmaVM *vm, int input) in New() argument
914 JSThread *thread = vm->GetJSThread(); in New()
919 Local<IntegerRef> IntegerRef::NewFromUnsigned(const EcmaVM *vm, unsigned int input) in NewFromUnsigned() argument
921 JSThread *thread = vm->GetJSThread(); in NewFromUnsigned()
932 Local<StringRef> StringRef::NewFromUtf8(const EcmaVM *vm, const char *utf8, int length) in NewFromUtf8() argument
934 ObjectFactory *factory = vm->GetFactory(); in NewFromUtf8()
964 Local<StringRef> StringRef::GetNapiWrapperString(const EcmaVM *vm) in GetNapiWrapperString() argument
966 …JSHandle<JSTaggedValue> napiWapperString = vm->GetJSThread()->GlobalConstants()->GetHandledNapiWra… in GetNapiWrapperString()
971 Local<SymbolRef> SymbolRef::New(const EcmaVM *vm, Local<StringRef> description) in New() argument
973 ObjectFactory *factory = vm->GetFactory(); in New()
976 symbol->SetDescription(vm->GetJSThread(), desc); in New()
980 Local<StringRef> SymbolRef::GetDescription(const EcmaVM *vm) in GetDescription() argument
984 auto constants = vm->GetJSThread()->GlobalConstants(); in GetDescription()
987 JSHandle<JSTaggedValue> descriptionHandle(vm->GetJSThread(), description); in GetDescription()
992 Local<NativePointerRef> NativePointerRef::New(const EcmaVM *vm, void *nativePointer, size_t nativeB… in New() argument
994 ObjectFactory *factory = vm->GetFactory(); in New()
1001 …const EcmaVM *vm, void *nativePointer, NativePointerCallback callBack, void *data, size_t nativeBi… in New() argument
1003 ObjectFactory *factory = vm->GetFactory(); in New()
1016 Local<ObjectRef> ObjectRef::New(const EcmaVM *vm) in New() argument
1018 ObjectFactory *factory = vm->GetFactory(); in New()
1019 JSHandle<GlobalEnv> globalEnv = vm->GetGlobalEnv(); in New()
1025 Local<ObjectRef> ObjectRef::New(const EcmaVM *vm, void *detach, void *attach) in New() argument
1027 ObjectFactory *factory = vm->GetFactory(); in New()
1028 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in New()
1033 … JSHandle<JSTaggedValue> detachValue = JSNApiHelper::ToJSHandle(NativePointerRef::New(vm, detach)); in New()
1034 … JSHandle<JSTaggedValue> attachValue = JSNApiHelper::ToJSHandle(NativePointerRef::New(vm, attach)); in New()
1035 JSTaggedValue::SetProperty(vm->GetJSThread(), object, detachKey, detachValue); in New()
1036 JSTaggedValue::SetProperty(vm->GetJSThread(), object, attachKey, attachValue); in New()
1037 RETURN_VALUE_IF_ABRUPT(vm->GetJSThread(), JSValueRef::Undefined(vm)); in New()
1041 bool ObjectRef::Set(const EcmaVM *vm, void *detach, void *attach) in Set() argument
1043 [[maybe_unused]] LocalScope scope(vm); in Set()
1044 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in Set()
1048 … JSHandle<JSTaggedValue> detachValue = JSNApiHelper::ToJSHandle(NativePointerRef::New(vm, detach)); in Set()
1049 … JSHandle<JSTaggedValue> attachValue = JSNApiHelper::ToJSHandle(NativePointerRef::New(vm, attach)); in Set()
1050 … bool detachResult = JSTaggedValue::SetProperty(vm->GetJSThread(), object, detachKey, detachValue); in Set()
1051 … bool attachResult = JSTaggedValue::SetProperty(vm->GetJSThread(), object, attachKey, attachValue); in Set()
1052 RETURN_VALUE_IF_ABRUPT(vm->GetJSThread(), false); in Set()
1056 bool ObjectRef::Set(const EcmaVM *vm, Local<JSValueRef> key, Local<JSValueRef> value) in Set() argument
1058 [[maybe_unused]] LocalScope scope(vm); in Set()
1062 bool result = JSTaggedValue::SetProperty(vm->GetJSThread(), obj, keyValue, valueValue); in Set()
1063 RETURN_VALUE_IF_ABRUPT(vm->GetJSThread(), false); in Set()
1067 bool ObjectRef::Set(const EcmaVM *vm, uint32_t key, Local<JSValueRef> value) in Set() argument
1069 [[maybe_unused]] LocalScope scope(vm); in Set()
1070 Local<JSValueRef> keyValue = NumberRef::New(vm, key); in Set()
1071 return Set(vm, keyValue, value); in Set()
1074 bool ObjectRef::SetAccessorProperty(const EcmaVM *vm, Local<JSValueRef> key, Local<FunctionRef> get… in SetAccessorProperty() argument
1077 [[maybe_unused]] LocalScope scope(vm); in SetAccessorProperty()
1078 JSThread *thread = vm->GetJSThread(); in SetAccessorProperty()
1082 desc.SetValue(JSNApiHelper::ToJSHandle(attribute.GetValue(vm))); in SetAccessorProperty()
1092 Local<JSValueRef> ObjectRef::Get(const EcmaVM *vm, Local<JSValueRef> key) in Get() argument
1094 EscapeLocalScope scope(vm); in Get()
1095 JSThread *thread = vm->GetJSThread(); in Get()
1099 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Get()
1101 return JSValueRef::Undefined(vm); in Get()
1106 Local<JSValueRef> ObjectRef::Get(const EcmaVM *vm, int32_t key) in Get() argument
1108 Local<JSValueRef> keyValue = IntegerRef::New(vm, key); in Get()
1109 return Get(vm, keyValue); in Get()
1112 bool ObjectRef::GetOwnProperty(const EcmaVM *vm, Local<JSValueRef> key, PropertyAttribute &property) in GetOwnProperty() argument
1114 JSThread *thread = vm->GetJSThread(); in GetOwnProperty()
1142 Local<ArrayRef> ObjectRef::GetOwnPropertyNames(const EcmaVM *vm) in GetOwnPropertyNames() argument
1144 JSThread *thread = vm->GetJSThread(); in GetOwnPropertyNames()
1148 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in GetOwnPropertyNames()
1152 Local<ArrayRef> ObjectRef::GetOwnEnumerablePropertyNames(const EcmaVM *vm) in GetOwnEnumerablePropertyNames() argument
1154 JSThread *thread = vm->GetJSThread(); in GetOwnEnumerablePropertyNames()
1158 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in GetOwnEnumerablePropertyNames()
1162 Local<JSValueRef> ObjectRef::GetPrototype(const EcmaVM *vm) in GetPrototype() argument
1164 JSThread *thread = vm->GetJSThread(); in GetPrototype()
1167 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in GetPrototype()
1171 bool ObjectRef::DefineProperty(const EcmaVM *vm, Local<JSValueRef> key, PropertyAttribute attribute) in DefineProperty() argument
1173 JSThread *thread = vm->GetJSThread(); in DefineProperty()
1177 desc.SetValue(JSNApiHelper::ToJSHandle(attribute.GetValue(vm))); in DefineProperty()
1183 bool ObjectRef::Has(const EcmaVM *vm, Local<JSValueRef> key) in Has() argument
1185 JSThread *thread = vm->GetJSThread(); in Has()
1193 bool ObjectRef::Has(const EcmaVM *vm, uint32_t key) in Has() argument
1195 JSThread *thread = vm->GetJSThread(); in Has()
1202 bool ObjectRef::Delete(const EcmaVM *vm, Local<JSValueRef> key) in Delete() argument
1204 JSThread *thread = vm->GetJSThread(); in Delete()
1212 bool ObjectRef::Delete(const EcmaVM *vm, uint32_t key) in Delete() argument
1214 JSThread *thread = vm->GetJSThread(); in Delete()
1248 Local<FunctionRef> FunctionRef::New(EcmaVM *vm, FunctionCallback nativeFunc, in New() argument
1251 JSThread *thread = vm->GetJSThread(); in New()
1252 ObjectFactory *factory = vm->GetFactory(); in New()
1253 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in New()
1260 Local<FunctionRef> FunctionRef::NewClassFunction(EcmaVM *vm, FunctionCallback nativeFunc, in NewClassFunction() argument
1263 EscapeLocalScope scope(vm); in NewClassFunction()
1264 JSThread *thread = vm->GetJSThread(); in NewClassFunction()
1265 ObjectFactory *factory = vm->GetFactory(); in NewClassFunction()
1266 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in NewClassFunction()
1291 Local<JSValueRef> FunctionRef::Call(const EcmaVM *vm, Local<JSValueRef> thisObj, in Call() argument
1295 EscapeLocalScope scope(vm); in Call()
1296 JSThread *thread = vm->GetJSThread(); in Call()
1298 return JSValueRef::Undefined(vm); in Call()
1300 vm->GetJsDebuggerManager()->ClearSingleStepper(); in Call()
1306 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Call()
1312 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Call()
1315 EcmaVM::ConstCast(vm)->ExecutePromisePendingJob(); in Call()
1316 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Call()
1317 vm->GetHeap()->ClearKeptObjects(); in Call()
1322 Local<JSValueRef> FunctionRef::Constructor(const EcmaVM *vm, in Constructor() argument
1326 JSThread *thread = vm->GetJSThread(); in Constructor()
1328 return JSValueRef::Undefined(vm); in Constructor()
1335 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Constructor()
1342 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Constructor()
1347 Local<JSValueRef> FunctionRef::GetFunctionPrototype(const EcmaVM *vm) in GetFunctionPrototype() argument
1349 JSThread *thread = vm->GetJSThread(); in GetFunctionPrototype()
1355 bool FunctionRef::Inherit(const EcmaVM *vm, Local<FunctionRef> parent) in Inherit() argument
1357 [[maybe_unused]] LocalScope scope(vm); in Inherit()
1358 JSThread *thread = vm->GetJSThread(); in Inherit()
1373 void FunctionRef::SetName(const EcmaVM *vm, Local<StringRef> name) in SetName() argument
1375 [[maybe_unused]] LocalScope scope(vm); in SetName()
1376 JSThread *thread = vm->GetJSThread(); in SetName()
1382 Local<StringRef> FunctionRef::GetName(const EcmaVM *vm) in GetName() argument
1384 EscapeLocalScope scope(vm); in GetName()
1385 JSThread *thread = vm->GetJSThread(); in GetName()
1388 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in GetName()
1392 Local<StringRef> FunctionRef::GetSourceCode(const EcmaVM *vm, int lineNumber) in GetSourceCode() argument
1394 EscapeLocalScope scope(vm); in GetSourceCode()
1395 JSThread *thread = vm->GetJSThread(); in GetSourceCode()
1428 bool FunctionRef::IsNative(const EcmaVM *vm) in IsNative() argument
1430 JSThread *thread = vm->GetJSThread(); in IsNative()
1437 Local<ArrayRef> ArrayRef::New(const EcmaVM *vm, uint32_t length) in New() argument
1439 JSThread *thread = vm->GetJSThread(); in New()
1442 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in New()
1446 int32_t ArrayRef::Length([[maybe_unused]] const EcmaVM *vm) in Length() argument
1452 Local<JSValueRef> ArrayRef::GetValueAt(const EcmaVM *vm, Local<JSValueRef> obj, uint32_t index) in GetValueAt() argument
1454 JSThread *thread = vm->GetJSThread(); in GetValueAt()
1460 bool ArrayRef::SetValueAt(const EcmaVM *vm, Local<JSValueRef> obj, uint32_t index, Local<JSValueRef… in SetValueAt() argument
1462 JSThread *thread = vm->GetJSThread(); in SetValueAt()
1468 Local<PromiseCapabilityRef> PromiseCapabilityRef::New(const EcmaVM *vm) in New() argument
1470 JSThread *thread = vm->GetJSThread(); in New()
1471 JSHandle<GlobalEnv> globalEnv = vm->GetGlobalEnv(); in New()
1477 Local<PromiseRef> PromiseCapabilityRef::GetPromise(const EcmaVM *vm) in GetPromise() argument
1479 JSThread *thread = vm->GetJSThread(); in GetPromise()
1484 bool PromiseCapabilityRef::Resolve(const EcmaVM *vm, Local<JSValueRef> value) in Resolve() argument
1486 JSThread *thread = vm->GetJSThread(); in Resolve()
1500 EcmaVM::ConstCast(vm)->ExecutePromisePendingJob(); in Resolve()
1502 vm->GetHeap()->ClearKeptObjects(); in Resolve()
1506 bool PromiseCapabilityRef::Reject(const EcmaVM *vm, Local<JSValueRef> reason) in Reject() argument
1508 JSThread *thread = vm->GetJSThread(); in Reject()
1523 EcmaVM::ConstCast(vm)->ExecutePromisePendingJob(); in Reject()
1525 vm->GetHeap()->ClearKeptObjects(); in Reject()
1529 Local<PromiseRef> PromiseRef::Catch(const EcmaVM *vm, Local<FunctionRef> handler) in Catch() argument
1531 JSThread *thread = vm->GetJSThread(); in Catch()
1540 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Catch()
1544 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Catch()
1548 Local<PromiseRef> PromiseRef::Finally(const EcmaVM *vm, Local<FunctionRef> handler) in Finally() argument
1550 JSThread *thread = vm->GetJSThread(); in Finally()
1559 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Finally()
1563 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Finally()
1567 Local<PromiseRef> PromiseRef::Then(const EcmaVM *vm, Local<FunctionRef> handler) in Then() argument
1569 JSThread *thread = vm->GetJSThread(); in Then()
1578 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Then()
1582 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Then()
1586 Local<PromiseRef> PromiseRef::Then(const EcmaVM *vm, Local<FunctionRef> onFulfilled, Local<Function… in Then() argument
1588 JSThread *thread = vm->GetJSThread(); in Then()
1598 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Then()
1602 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Then()
1608 Local<ArrayBufferRef> ArrayBufferRef::New(const EcmaVM *vm, int32_t length) in New() argument
1610 ObjectFactory *factory = vm->GetFactory(); in New()
1616 const EcmaVM *vm, void *buffer, int32_t length, const Deleter &deleter, void *data) in New() argument
1618 ObjectFactory *factory = vm->GetFactory(); in New()
1624 int32_t ArrayBufferRef::ByteLength([[maybe_unused]] const EcmaVM *vm) in ByteLength() argument
1643 const EcmaVM *vm, Local<ArrayBufferRef> arrayBuffer, uint32_t byteOffset, uint32_t byteLength) in New() argument
1645 JSThread *thread = vm->GetJSThread(); in New()
1646 ObjectFactory *factory = vm->GetFactory(); in New()
1650 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in New()
1666 Local<ArrayBufferRef> DataViewRef::GetArrayBuffer(const EcmaVM *vm) in GetArrayBuffer() argument
1668 JSThread *thread = vm->GetJSThread(); in GetArrayBuffer()
1676 uint32_t TypedArrayRef::ByteLength([[maybe_unused]] const EcmaVM *vm) in ByteLength() argument
1682 uint32_t TypedArrayRef::ByteOffset([[maybe_unused]] const EcmaVM *vm) in ByteOffset() argument
1688 uint32_t TypedArrayRef::ArrayLength([[maybe_unused]] const EcmaVM *vm) in ArrayLength() argument
1694 Local<ArrayBufferRef> TypedArrayRef::GetArrayBuffer(const EcmaVM *vm) in GetArrayBuffer() argument
1696 JSThread *thread = vm->GetJSThread(); in GetArrayBuffer()
1705 … const EcmaVM *vm, Local<ArrayBufferRef> buffer, int32_t byteOffset, int32_t length) \
1707 … JSThread *thread = vm->GetJSThread(); \
1708 … JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); \
1716 … RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); \
1719 … RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); \
1732 Local<JSValueRef> Exception::name(const EcmaVM *vm, Local<StringRef> message) \
1734 JSThread *thread = vm->GetJSThread(); \
1738 ObjectFactory *factory = vm->GetFactory(); \
1751 Local<JSValueRef> JSON::Parse(const EcmaVM *vm, Local<StringRef> string) in EXCEPTION_ERROR_ALL()
1753 JSThread *thread = vm->GetJSThread(); in EXCEPTION_ERROR_ALL()
1763 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in EXCEPTION_ERROR_ALL()
1767 Local<JSValueRef> JSON::Stringify(const EcmaVM *vm, Local<JSValueRef> json) in Stringify() argument
1769 JSThread *thread = vm->GetJSThread(); in Stringify()
1774 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Stringify()
1778 Local<StringRef> RegExpRef::GetOriginalSource(const EcmaVM *vm) in GetOriginalSource() argument
1780 JSThread *thread = vm->GetJSThread(); in GetOriginalSource()
1819 Local<JSValueRef> RegExpRef::IsGlobal(const EcmaVM *vm) in IsGlobal() argument
1824 Local<JSValueRef> jsValue = BooleanRef::New(vm, result); in IsGlobal()
1828 Local<JSValueRef> RegExpRef::IsIgnoreCase(const EcmaVM *vm) in IsIgnoreCase() argument
1833 Local<JSValueRef> jsValue = BooleanRef::New(vm, result); in IsIgnoreCase()
1837 Local<JSValueRef> RegExpRef::IsMultiline(const EcmaVM *vm) in IsMultiline() argument
1842 Local<JSValueRef> jsValue = BooleanRef::New(vm, result); in IsMultiline()
1846 Local<JSValueRef> RegExpRef::IsDotAll(const EcmaVM *vm) in IsDotAll() argument
1851 Local<JSValueRef> jsValue = BooleanRef::New(vm, result); in IsDotAll()
1855 Local<JSValueRef> RegExpRef::IsUtf16(const EcmaVM *vm) in IsUtf16() argument
1860 Local<JSValueRef> jsValue = BooleanRef::New(vm, result); in IsUtf16()
1864 Local<JSValueRef> RegExpRef::IsStick(const EcmaVM *vm) in IsStick() argument
1869 Local<JSValueRef> jsValue = BooleanRef::New(vm, result); in IsStick()
1873 Local<DateRef> DateRef::New(const EcmaVM *vm, double time) in New() argument
1875 JSThread *thread = vm->GetJSThread(); in New()
1876 ObjectFactory *factory = vm->GetFactory(); in New()
1877 JSHandle<GlobalEnv> globalEnv = vm->GetGlobalEnv(); in New()
1884 Local<StringRef> DateRef::ToString(const EcmaVM *vm) in ToString() argument
1886 JSThread *thread = vm->GetJSThread(); in ToString()
1906 Local<JSValueRef> MapRef::Get(const EcmaVM *vm, Local<JSValueRef> key) in Get() argument
1909 return JSNApiHelper::ToLocal<JSValueRef>(JSHandle<JSTaggedValue>(vm->GetJSThread(), in Get()
1913 void MapRef::Set(const EcmaVM *vm, Local<JSValueRef> key, Local<JSValueRef> value) in Set() argument
1916 …JSMap::Set(vm->GetJSThread(), map, JSNApiHelper::ToJSHandle(key), JSNApiHelper::ToJSHandle(value)); in Set()
1919 Local<MapRef> MapRef::New(const EcmaVM *vm) in New() argument
1921 JSThread *thread = vm->GetJSThread(); in New()
1945 Local<JSValueRef> MapRef::GetKey(const EcmaVM *vm, int entry) in GetKey() argument
1948 JSThread *thread = vm->GetJSThread(); in GetKey()
1952 Local<JSValueRef> MapRef::GetValue(const EcmaVM *vm, int entry) in GetValue() argument
1955 JSThread *thread = vm->GetJSThread(); in GetValue()
1971 Local<JSValueRef> SetRef::GetValue(const EcmaVM *vm, int entry) in GetValue() argument
1974 JSThread *thread = vm->GetJSThread(); in GetValue()
1984 Local<JSValueRef> MapIteratorRef::GetKind(const EcmaVM *vm) in GetKind() argument
1991 result = StringRef::NewFromUtf8(vm, "keys"); in GetKind()
1994 result = StringRef::NewFromUtf8(vm, "values"); in GetKind()
1997 result = StringRef::NewFromUtf8(vm, "entries"); in GetKind()
2011 Local<JSValueRef> SetIteratorRef::GetKind(const EcmaVM *vm) in GetKind() argument
2018 result = StringRef::NewFromUtf8(vm, "keys"); in GetKind()
2021 result = StringRef::NewFromUtf8(vm, "values"); in GetKind()
2024 result = StringRef::NewFromUtf8(vm, "entries"); in GetKind()
2037 Local<JSValueRef> GeneratorObjectRef::GetGeneratorState(const EcmaVM *vm) in GetGeneratorState() argument
2041 return StringRef::NewFromUtf8(vm, "closed"); in GetGeneratorState()
2043 return StringRef::NewFromUtf8(vm, "suspended"); in GetGeneratorState()
2046 Local<JSValueRef> GeneratorObjectRef::GetGeneratorFunction(const EcmaVM *vm) in GetGeneratorFunction() argument
2048 JSThread *thread = vm->GetJSThread(); in GetGeneratorFunction()
2055 Local<JSValueRef> GeneratorObjectRef::GetGeneratorReceiver(const EcmaVM *vm) in GetGeneratorReceiver() argument
2057 JSThread *thread = vm->GetJSThread(); in GetGeneratorReceiver()
2064 Local<JSValueRef> CollatorRef::GetCompareFunction(const EcmaVM *vm) in GetCompareFunction() argument
2066 JSThread *thread = vm->GetJSThread(); in GetCompareFunction()
2072 Local<JSValueRef> DataTimeFormatRef::GetFormatFunction(const EcmaVM *vm) in GetFormatFunction() argument
2074 JSThread *thread = vm->GetJSThread(); in GetFormatFunction()
2080 Local<JSValueRef> NumberFormatRef::GetFormatFunction(const EcmaVM *vm) in GetFormatFunction() argument
2082 JSThread *thread = vm->GetJSThread(); in GetFormatFunction()
2123 JSExecutionScope::JSExecutionScope(const EcmaVM *vm) in JSExecutionScope() argument
2125 (void)vm; in JSExecutionScope()
2135 Local<PrimitiveRef> JSValueRef::Undefined(const EcmaVM *vm) in Undefined() argument
2137 JSThread *thread = vm->GetJSThread(); in Undefined()
2142 Local<PrimitiveRef> JSValueRef::Null(const EcmaVM *vm) in Null() argument
2144 …return JSNApiHelper::ToLocal<PrimitiveRef>(JSHandle<JSTaggedValue>(vm->GetJSThread(), JSTaggedValu… in Null()
2147 Local<PrimitiveRef> JSValueRef::True(const EcmaVM *vm) in True() argument
2149 …return JSNApiHelper::ToLocal<PrimitiveRef>(JSHandle<JSTaggedValue>(vm->GetJSThread(), JSTaggedValu… in True()
2152 Local<PrimitiveRef> JSValueRef::False(const EcmaVM *vm) in False() argument
2154 …return JSNApiHelper::ToLocal<PrimitiveRef>(JSHandle<JSTaggedValue>(vm->GetJSThread(), JSTaggedValu… in False()
2157 Local<ObjectRef> JSValueRef::ToObject(const EcmaVM *vm) in ToObject() argument
2159 JSThread *thread = vm->GetJSThread(); in ToObject()
2161 return Undefined(vm); in ToObject()
2164 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in ToObject()
2168 Local<StringRef> JSValueRef::ToString(const EcmaVM *vm) in ToString() argument
2170 JSThread *thread = vm->GetJSThread(); in ToString()
2174 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in ToString()
2179 Local<NativePointerRef> JSValueRef::ToNativePointer(const EcmaVM *vm) in ToNativePointer() argument
2181 JSThread *thread = vm->GetJSThread(); in ToNativePointer()
2183 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in ToNativePointer()
2192 int64_t JSValueRef::IntegerValue(const EcmaVM *vm) in IntegerValue() argument
2194 JSThread *thread = vm->GetJSThread(); in IntegerValue()
2208 uint32_t JSValueRef::Uint32Value(const EcmaVM *vm) in Uint32Value() argument
2210 JSThread *thread = vm->GetJSThread(); in Uint32Value()
2216 int32_t JSValueRef::Int32Value(const EcmaVM *vm) in Int32Value() argument
2218 JSThread *thread = vm->GetJSThread(); in Int32Value()
2224 Local<BooleanRef> JSValueRef::ToBoolean(const EcmaVM *vm) in ToBoolean() argument
2226 JSThread *thread = vm->GetJSThread(); in ToBoolean()
2232 Local<NumberRef> JSValueRef::ToNumber(const EcmaVM *vm) in ToNumber() argument
2234 JSThread *thread = vm->GetJSThread(); in ToNumber()
2237 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in ToNumber()
2241 bool JSValueRef::IsStrictEquals(const EcmaVM *vm, Local<JSValueRef> value) in IsStrictEquals() argument
2243 JSThread *thread = vm->GetJSThread(); in IsStrictEquals()
2249 Local<StringRef> JSValueRef::Typeof(const EcmaVM *vm) in Typeof() argument
2251 JSThread *thread = vm->GetJSThread(); in Typeof()
2256 bool JSValueRef::InstanceOf(const EcmaVM *vm, Local<JSValueRef> value) in InstanceOf() argument
2258 JSThread *thread = vm->GetJSThread(); in InstanceOf()
2331 bool JSValueRef::IsArray(const EcmaVM *vm) in IsArray() argument
2333 JSThread *thread = vm->GetJSThread(); in IsArray()
2637 bool JSNApi::LoadPatch(EcmaVM *vm, const std::string &patchFileName, const std::string &baseFileNam… in LoadPatch() argument
2639 ecmascript::QuickFixManager *quickFixManager = vm->GetQuickFixManager(); in LoadPatch()
2640 JSThread *thread = vm->GetJSThread(); in LoadPatch()
2644 bool JSNApi::LoadPatch(EcmaVM *vm, const std::string &patchFileName, const void *patchBuffer, size_… in LoadPatch() argument
2647 ecmascript::QuickFixManager *quickFixManager = vm->GetQuickFixManager(); in LoadPatch()
2648 JSThread *thread = vm->GetJSThread(); in LoadPatch()
2652 bool JSNApi::UnloadPatch(EcmaVM *vm, const std::string &patchFileName) in UnloadPatch() argument
2654 ecmascript::QuickFixManager *quickFixManager = vm->GetQuickFixManager(); in UnloadPatch()
2655 JSThread *thread = vm->GetJSThread(); in UnloadPatch()
2662 bool JSNApi::IsQuickFixCausedException(EcmaVM *vm, Local<ObjectRef> exception, const std::string &p… in IsQuickFixCausedException() argument
2667 ecmascript::QuickFixManager *quickFixManager = vm->GetQuickFixManager(); in IsQuickFixCausedException()
2668 JSThread *thread = vm->GetJSThread(); in IsQuickFixCausedException()
2676 void JSNApi::RegisterQuickFixQueryFunc(EcmaVM *vm, QuickFixQueryCallBack callBack) in RegisterQuickFixQueryFunc() argument
2678 ecmascript::QuickFixManager *quickFixManager = vm->GetQuickFixManager(); in RegisterQuickFixQueryFunc()
2682 bool JSNApi::IsBundle(EcmaVM *vm) in IsBundle() argument
2684 return vm->IsBundlePack(); in IsBundle()
2687 void JSNApi::SetBundle(EcmaVM *vm, bool value) in SetBundle() argument
2689 vm->SetIsBundlePack(value); in SetBundle()
2693 void JSNApi::SetAssetPath(EcmaVM *vm, const std::string &assetPath) in SetAssetPath() argument
2696 vm->SetAssetPath(path); in SetAssetPath()
2699 std::string JSNApi::GetAssetPath(EcmaVM *vm) in GetAssetPath() argument
2701 return vm->GetAssetPath().c_str(); in GetAssetPath()
2704 void JSNApi::SetBundleName(EcmaVM *vm, std::string bundleName) in SetBundleName() argument
2707 vm->SetBundleName(name); in SetBundleName()
2710 std::string JSNApi::GetBundleName(EcmaVM *vm) in GetBundleName() argument
2712 return vm->GetBundleName().c_str(); in GetBundleName()
2715 void JSNApi::SetModuleName(EcmaVM *vm, std::string moduleName) in SetModuleName() argument
2718 vm->SetModuleName(name); in SetModuleName()
2721 std::string JSNApi::GetModuleName(EcmaVM *vm) in GetModuleName() argument
2723 return vm->GetModuleName().c_str(); in GetModuleName()
2726 void JSNApi::SetLoop(EcmaVM *vm, void *loop) in SetLoop() argument
2728 vm->SetLoop(loop); in SetLoop()
2731 bool JSNApi::InitForConcurrentThread(EcmaVM *vm, ConcurrentCallback cb, void *data) in InitForConcurrentThread() argument
2733 vm->SetConcurrentCallback(cb, data); in InitForConcurrentThread()
2738 bool JSNApi::InitForConcurrentFunction(EcmaVM *vm, Local<JSValueRef> function) in InitForConcurrentFunction() argument
2740 [[maybe_unused]] LocalScope scope(vm); in InitForConcurrentFunction()
2746 ecmascript::JSThread *thread = vm->GetJSThread(); in InitForConcurrentFunction()
2757 auto *notificationMgr = vm->GetJsDebuggerManager()->GetNotificationManager(); in InitForConcurrentFunction()
2762 ecmascript::ModuleManager *moduleManager = vm->GetModuleManager(); in InitForConcurrentFunction()
2769 vm->GetAOTFileManager()->LoadAiFile(jsPandaFile); in InitForConcurrentFunction()
2775 vm->HandleUncaughtException(exception.GetTaggedObject()); in InitForConcurrentFunction()