Lines Matching refs:ecmaVm
58 uint32_t DebuggerApi::GetStackDepth(const EcmaVM *ecmaVm)
61 FrameHandler frameHandler(ecmaVm->GetJSThread());
71 std::shared_ptr<FrameHandler> DebuggerApi::NewFrameHandler(const EcmaVM *ecmaVm)
73 return std::make_shared<FrameHandler>(ecmaVm->GetJSThread());
76 bool DebuggerApi::StackWalker(const EcmaVM *ecmaVm, std::function<StackState(const FrameHandler *)> func)
78 FrameHandler frameHandler(ecmaVm->GetJSThread());
95 uint32_t DebuggerApi::GetStackDepthOverBuiltin(const EcmaVM *ecmaVm)
98 FrameHandler frameHandler(ecmaVm->GetJSThread());
114 uint32_t DebuggerApi::GetBytecodeOffset(const EcmaVM *ecmaVm)
116 return FrameHandler(ecmaVm->GetJSThread()).GetBytecodeOffset();
119 std::unique_ptr<PtMethod> DebuggerApi::GetMethod(const EcmaVM *ecmaVm)
121 FrameHandler frameHandler(ecmaVm->GetJSThread());
143 bool DebuggerApi::IsNativeMethod(const EcmaVM *ecmaVm)
145 FrameHandler frameHandler(ecmaVm->GetJSThread());
158 JSPandaFile *DebuggerApi::GetJSPandaFile(const EcmaVM *ecmaVm)
160 Method *method = FrameHandler(ecmaVm->GetJSThread()).GetMethod();
209 Local<JSValueRef> DebuggerApi::GetVRegValue(const EcmaVM *ecmaVm,
213 JSHandle<JSTaggedValue> handledValue(ecmaVm->GetJSThread(), value);
218 Local<JSValueRef> DebuggerApi::GetAndClearException(const EcmaVM *ecmaVm)
220 auto exception = ecmaVm->GetJSThread()->GetException();
221 JSHandle<JSTaggedValue> handledException(ecmaVm->GetJSThread(), exception);
222 ecmaVm->GetJSThread()->ClearException();
226 void DebuggerApi::SetException(const EcmaVM *ecmaVm, Local<JSValueRef> exception)
228 ecmaVm->GetJSThread()->SetException(JSNApiHelper::ToJSTaggedValue(*exception));
231 void DebuggerApi::ClearException(const EcmaVM *ecmaVm)
233 return ecmaVm->GetJSThread()->ClearException();
243 JSDebugger *DebuggerApi::CreateJSDebugger(const EcmaVM *ecmaVm)
245 return new JSDebugger(ecmaVm);
329 Local<JSValueRef> DebuggerApi::GetProperties(const EcmaVM *ecmaVm, const FrameHandler *frameHandler,
339 JSHandle<JSTaggedValue> handledValue(ecmaVm->GetJSThread(), value);
343 void DebuggerApi::SetProperties(const EcmaVM *ecmaVm, const FrameHandler *frameHandler,
353 LexicalEnv::Cast(env.GetTaggedObject())->SetProperties(ecmaVm->GetJSThread(), slot, target);
378 Local<JSValueRef> DebuggerApi::GetGlobalValue(const EcmaVM *ecmaVm, Local<StringRef> name)
381 JSTaggedValue globalObj = ecmaVm->GetGlobalEnv()->GetGlobalObject();
382 JSThread *thread = ecmaVm->GetJSThread();
403 bool DebuggerApi::SetGlobalValue(const EcmaVM *ecmaVm, Local<StringRef> name, Local<JSValueRef> value)
406 JSTaggedValue globalObj = ecmaVm->GetGlobalEnv()->GetGlobalObject();
407 JSThread *thread = ecmaVm->GetJSThread();
426 JSTaggedValue DebuggerApi::GetCurrentModule(const EcmaVM *ecmaVm)
428 JSThread *thread = ecmaVm->GetJSThread();
449 JSHandle<JSTaggedValue> DebuggerApi::GetImportModule(const EcmaVM *ecmaVm,
452 JSThread *thread = ecmaVm->GetJSThread();
491 int32_t DebuggerApi::GetModuleVariableIndex(const EcmaVM *ecmaVm, const JSHandle<JSTaggedValue> ¤tModule,
502 JSThread *thread = ecmaVm->GetJSThread();
526 int32_t DebuggerApi::GetRequestModuleIndex(const EcmaVM *ecmaVm, JSTaggedValue moduleRequest,
532 JSThread *thread = ecmaVm->GetJSThread();
547 Local<JSValueRef> DebuggerApi::GetExportVariableValue(const EcmaVM *ecmaVm,
554 int32_t index = GetModuleVariableIndex(ecmaVm, currentModule, name);
564 JSThread *thread = ecmaVm->GetJSThread();
574 bool DebuggerApi::SetExportVariableValue(const EcmaVM *ecmaVm, const JSHandle<JSTaggedValue> ¤tModule,
580 int32_t index = GetModuleVariableIndex(ecmaVm, currentModule, name);
590 JSThread *thread = ecmaVm->GetJSThread();
600 Local<JSValueRef> DebuggerApi::GetModuleValue(const EcmaVM *ecmaVm, const JSHandle<JSTaggedValue> ¤tModule,
608 result = GetExportVariableValue(ecmaVm, currentModule, name);
613 JSHandle<JSTaggedValue> importModule = GetImportModule(ecmaVm, currentModule, name);
614 result = GetExportVariableValue(ecmaVm, importModule, name);
618 bool DebuggerApi::SetModuleValue(const EcmaVM *ecmaVm, const JSHandle<JSTaggedValue> ¤tModule,
626 result = SetExportVariableValue(ecmaVm, currentModule, name, value);
631 JSHandle<JSTaggedValue> importModule = GetImportModule(ecmaVm, currentModule, name);
632 result = SetExportVariableValue(ecmaVm, importModule, name, value);
639 void DebuggerApi::InitializeExportVariables(const EcmaVM *ecmaVm, Local<ObjectRef> &moduleObj,
651 JSThread *thread = ecmaVm->GetJSThread();
667 moduleObj->DefineProperty(ecmaVm, variableName, descriptor);
672 void DebuggerApi::GetLocalExportVariables(const EcmaVM *ecmaVm, Local<ObjectRef> &moduleObj,
680 InitializeExportVariables(ecmaVm, moduleObj, currentModule);
684 JSThread *thread = ecmaVm->GetJSThread();
718 moduleObj->DefineProperty(ecmaVm, variableName, descriptor);
724 void DebuggerApi::GetIndirectExportVariables(const EcmaVM *ecmaVm, Local<ObjectRef> &moduleObj,
736 JSThread *thread = ecmaVm->GetJSThread();
758 Local<JSValueRef> value = GetModuleValue(ecmaVm, importModule, importName);
760 moduleObj->DefineProperty(ecmaVm, variableName, descriptor);
765 void DebuggerApi::GetImportVariables(const EcmaVM *ecmaVm, Local<ObjectRef> &moduleObj,
776 JSThread *thread = ecmaVm->GetJSThread();
798 Local<ObjectRef> importModuleObj = ObjectRef::New(ecmaVm);
799 GetLocalExportVariables(ecmaVm, importModuleObj, importModule, true);
802 moduleObj->DefineProperty(ecmaVm, variableName, descriptor);
810 moduleObj->DefineProperty(ecmaVm, variableName, descriptor);
814 void DebuggerApi::HandleUncaughtException(const EcmaVM *ecmaVm, std::string &message)
816 JSThread *thread = ecmaVm->GetJSThread();
834 Local<FunctionRef> DebuggerApi::GenerateFuncFromBuffer(const EcmaVM *ecmaVm, const void *buffer,
839 mgr->LoadJSPandaFile(ecmaVm->GetJSThread(), "", entryPoint, buffer, size);
841 return JSValueRef::Undefined(ecmaVm);
844 JSHandle<Program> program = mgr->GenerateProgram(const_cast<EcmaVM *>(ecmaVm), jsPandaFile.get(), entryPoint);
846 return JSNApiHelper::ToLocal<FunctionRef>(JSHandle<JSTaggedValue>(ecmaVm->GetJSThread(), func));
849 Local<JSValueRef> DebuggerApi::EvaluateViaFuncCall(EcmaVM *ecmaVm, Local<FunctionRef> funcRef,
852 JSNApi::EnableUserUncaughtErrorHandler(ecmaVm);
854 JsDebuggerManager *mgr = ecmaVm->GetJsDebuggerManager();
858 ecmaVm->GetJSThread()->CheckSwitchDebuggerBCStub();
860 auto result = funcRef->Call(ecmaVm, JSValueRef::Undefined(ecmaVm), args.data(), args.size());
862 ecmaVm->GetJSThread()->CheckSwitchDebuggerBCStub();
868 Local<JSValueRef> DebuggerApi::CallFunctionOnCall(EcmaVM *ecmaVm, Local<FunctionRef> funcRef,
871 JSNApi::EnableUserUncaughtErrorHandler(ecmaVm);
873 JsDebuggerManager *mgr = ecmaVm->GetJsDebuggerManager();
877 ecmaVm->GetJSThread()->CheckSwitchDebuggerBCStub();
879 auto result = funcRef->Call(ecmaVm, JSValueRef::Undefined(ecmaVm), args.data(), args.size());
881 ecmaVm->GetJSThread()->CheckSwitchDebuggerBCStub();
887 bool DebuggerApi::IsExceptionCaught(const EcmaVM *ecmaVm)
889 FrameHandler frameHandler(ecmaVm->GetJSThread());
902 std::vector<DebugInfoExtractor *> DebuggerApi::GetPatchExtractors(const EcmaVM *ecmaVm, const std::string &url)
904 const auto *hotReloadManager = ecmaVm->GetJsDebuggerManager()->GetHotReloadManager();
908 const JSPandaFile *DebuggerApi::GetBaseJSPandaFile(const EcmaVM *ecmaVm, const JSPandaFile *jsPandaFile)
910 const auto *hotReloadManager = ecmaVm->GetJsDebuggerManager()->GetHotReloadManager();
914 std::vector<void *> DebuggerApi::GetNativePointer(const EcmaVM *ecmaVm)
918 JSThread *thread = ecmaVm->GetJSThread();
934 auto cb = ecmaVm->GetNativePtrGetter();
947 uint32_t DebuggerApi::GetContainerLength(const EcmaVM *ecmaVm, Local<JSValueRef> value)
949 uint32_t length = Local<ArrayRef>(value)->Length(ecmaVm);
953 void DebuggerApi::AddInternalProperties(const EcmaVM *ecmaVm, Local<ObjectRef> object,
959 internalObjects->Set(ecmaVm, object, NumberRef::New(ecmaVm, static_cast<int32_t>(type)));
962 Local<JSValueRef> DebuggerApi::GetArrayListValue(const EcmaVM *ecmaVm, Local<JSValueRef> value,
967 Local<JSValueRef> jsValueRef = ArrayRef::New(ecmaVm, size);
968 JSThread *thread = ecmaVm->GetJSThread();
973 ArrayRef::SetValueAt(ecmaVm, jsValueRef, index++, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
975 AddInternalProperties(ecmaVm, jsValueRef, ArkInternalValueType::Entry, internalObjects);
979 Local<JSValueRef> DebuggerApi::GetDequeValue(const EcmaVM *ecmaVm, Local<JSValueRef> value,
984 Local<JSValueRef> jsValueRef = ArrayRef::New(ecmaVm, size);
985 JSThread *thread = ecmaVm->GetJSThread();
990 ArrayRef::SetValueAt(ecmaVm, jsValueRef, index++, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
992 AddInternalProperties(ecmaVm, jsValueRef, ArkInternalValueType::Entry, internalObjects);
996 Local<JSValueRef> DebuggerApi::GetHashMapValue(const EcmaVM *ecmaVm, Local<JSValueRef> value,
1000 JSThread *thread = ecmaVm->GetJSThread();
1004 Local<JSValueRef> jsValueRef = ArrayRef::New(ecmaVm, size);
1010 Local<JSValueRef> jsKey = StringRef::NewFromUtf8(ecmaVm, "key");
1011 Local<JSValueRef> jsValue = StringRef::NewFromUtf8(ecmaVm, "value");
1019 Local<ObjectRef> objRef = ObjectRef::New(ecmaVm);
1020 objRef->Set(ecmaVm, jsKey, JSNApiHelper::ToLocal<JSValueRef>(currentKey));
1021 objRef->Set(ecmaVm, jsValue, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
1022 AddInternalProperties(ecmaVm, objRef, ArkInternalValueType::Entry, internalObjects);
1023 ArrayRef::SetValueAt(ecmaVm, jsValueRef, pos++, objRef);
1026 AddInternalProperties(ecmaVm, jsValueRef, ArkInternalValueType::Entry, internalObjects);
1030 Local<JSValueRef> DebuggerApi::GetHashSetValue(const EcmaVM *ecmaVm, Local<JSValueRef> value,
1034 JSThread *thread = ecmaVm->GetJSThread();
1038 Local<JSValueRef> jsValueRef = ArrayRef::New(ecmaVm, size);
1043 Local<JSValueRef> jsValue = StringRef::NewFromUtf8(ecmaVm, "value");
1051 Local<ObjectRef> objRef = ObjectRef::New(ecmaVm);
1052 objRef->Set(ecmaVm, jsValue, JSNApiHelper::ToLocal<JSValueRef>(currentKey));
1053 AddInternalProperties(ecmaVm, objRef, ArkInternalValueType::Entry, internalObjects);
1054 ArrayRef::SetValueAt(ecmaVm, jsValueRef, pos++, objRef);
1056 ArrayRef::SetValueAt(ecmaVm, jsValueRef, pos++, JSNApiHelper::ToLocal<JSValueRef>(currentKey));
1060 AddInternalProperties(ecmaVm, jsValueRef, ArkInternalValueType::Entry, internalObjects);
1064 Local<JSValueRef> DebuggerApi::GetLightWeightMapValue(const EcmaVM *ecmaVm, Local<JSValueRef> value,
1069 Local<JSValueRef> jsValueRef = ArrayRef::New(ecmaVm, size);
1070 JSThread *thread = ecmaVm->GetJSThread();
1075 Local<JSValueRef> jsKey = StringRef::NewFromUtf8(ecmaVm, "key");
1076 Local<JSValueRef> jsValue = StringRef::NewFromUtf8(ecmaVm, "value");
1081 Local<ObjectRef> objRef = ObjectRef::New(ecmaVm);
1082 objRef->Set(ecmaVm, jsKey, JSNApiHelper::ToLocal<JSValueRef>(currentKey));
1083 objRef->Set(ecmaVm, jsValue, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
1084 AddInternalProperties(ecmaVm, objRef, ArkInternalValueType::Entry, internalObjects);
1085 ArrayRef::SetValueAt(ecmaVm, jsValueRef, index++, objRef);
1087 AddInternalProperties(ecmaVm, jsValueRef, ArkInternalValueType::Entry, internalObjects);
1091 Local<JSValueRef> DebuggerApi::GetLightWeightSetValue(const EcmaVM *ecmaVm, Local<JSValueRef> value,
1096 Local<JSValueRef> jsValueRef = ArrayRef::New(ecmaVm, size);
1097 JSThread *thread = ecmaVm->GetJSThread();
1099 Local<JSValueRef> jsValue = StringRef::NewFromUtf8(ecmaVm, "value");
1104 Local<ObjectRef> objRef = ObjectRef::New(ecmaVm);
1105 objRef->Set(ecmaVm, jsValue, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
1106 AddInternalProperties(ecmaVm, objRef, ArkInternalValueType::Entry, internalObjects);
1107 ArrayRef::SetValueAt(ecmaVm, jsValueRef, index++, objRef);
1109 ArrayRef::SetValueAt(ecmaVm, jsValueRef, index++, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
1112 AddInternalProperties(ecmaVm, jsValueRef, ArkInternalValueType::Entry, internalObjects);
1116 Local<JSValueRef> DebuggerApi::GetLinkedListValue(const EcmaVM *ecmaVm, Local<JSValueRef> value,
1120 JSThread *thread = ecmaVm->GetJSThread();
1123 Local<JSValueRef> jsValueRef = ArrayRef::New(ecmaVm, size);
1130 ArrayRef::SetValueAt(ecmaVm, jsValueRef, index++, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
1132 AddInternalProperties(ecmaVm, jsValueRef, ArkInternalValueType::Entry, internalObjects);
1136 Local<JSValueRef> DebuggerApi::GetListValue(const EcmaVM *ecmaVm, Local<JSValueRef> value,
1140 JSThread *thread = ecmaVm->GetJSThread();
1143 Local<JSValueRef> jsValueRef = ArrayRef::New(ecmaVm, size);
1150 ArrayRef::SetValueAt(ecmaVm, jsValueRef, index++, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
1152 AddInternalProperties(ecmaVm, jsValueRef, ArkInternalValueType::Entry, internalObjects);
1156 Local<JSValueRef> DebuggerApi::GetPlainArrayValue(const EcmaVM *ecmaVm, Local<JSValueRef> value,
1161 Local<JSValueRef> jsValueRef = ArrayRef::New(ecmaVm, size);
1162 JSThread *thread = ecmaVm->GetJSThread();
1167 Local<JSValueRef> jsKey = StringRef::NewFromUtf8(ecmaVm, "key");
1168 Local<JSValueRef> jsValue = StringRef::NewFromUtf8(ecmaVm, "value");
1173 Local<ObjectRef> objRef = ObjectRef::New(ecmaVm);
1174 objRef->Set(ecmaVm, jsKey, JSNApiHelper::ToLocal<JSValueRef>(currentKey));
1175 objRef->Set(ecmaVm, jsValue, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
1176 AddInternalProperties(ecmaVm, objRef, ArkInternalValueType::Entry, internalObjects);
1177 ArrayRef::SetValueAt(ecmaVm, jsValueRef, index++, objRef);
1179 AddInternalProperties(ecmaVm, jsValueRef, ArkInternalValueType::Entry, internalObjects);
1183 Local<JSValueRef> DebuggerApi::GetQueueValue(const EcmaVM *ecmaVm, Local<JSValueRef> value,
1188 Local<JSValueRef> jsValueRef = ArrayRef::New(ecmaVm, size);
1189 JSThread *thread = ecmaVm->GetJSThread();
1196 ArrayRef::SetValueAt(ecmaVm, jsValueRef, index++, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
1198 AddInternalProperties(ecmaVm, jsValueRef, ArkInternalValueType::Entry, internalObjects);
1202 Local<JSValueRef> DebuggerApi::GetStackValue(const EcmaVM *ecmaVm, Local<JSValueRef> value,
1207 Local<JSValueRef> jsValueRef = ArrayRef::New(ecmaVm, size);
1208 JSThread *thread = ecmaVm->GetJSThread();
1213 ArrayRef::SetValueAt(ecmaVm, jsValueRef, index++, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
1215 AddInternalProperties(ecmaVm, jsValueRef, ArkInternalValueType::Entry, internalObjects);
1219 Local<JSValueRef> DebuggerApi::GetTreeMapValue(const EcmaVM *ecmaVm, Local<JSValueRef> value,
1224 Local<JSValueRef> jsValueRef = ArrayRef::New(ecmaVm, size);
1225 JSThread *thread = ecmaVm->GetJSThread();
1231 Local<JSValueRef> jsKey = StringRef::NewFromUtf8(ecmaVm, "key");
1232 Local<JSValueRef> jsValue = StringRef::NewFromUtf8(ecmaVm, "value");
1238 Local<ObjectRef> objRef = ObjectRef::New(ecmaVm);
1239 objRef->Set(ecmaVm, jsKey, JSNApiHelper::ToLocal<JSValueRef>(currentKey));
1240 objRef->Set(ecmaVm, jsValue, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
1241 AddInternalProperties(ecmaVm, objRef, ArkInternalValueType::Entry, internalObjects);
1242 ArrayRef::SetValueAt(ecmaVm, jsValueRef, index++, objRef);
1244 AddInternalProperties(ecmaVm, jsValueRef, ArkInternalValueType::Entry, internalObjects);
1248 Local<JSValueRef> DebuggerApi::GetTreeSetValue(const EcmaVM *ecmaVm, Local<JSValueRef> value,
1252 JSThread *thread = ecmaVm->GetJSThread();
1255 Local<JSValueRef> jsValueRef = ArrayRef::New(ecmaVm, elements);
1258 Local<JSValueRef> jsValue = StringRef::NewFromUtf8(ecmaVm, "value");
1264 Local<ObjectRef> objRef = ObjectRef::New(ecmaVm);
1265 objRef->Set(ecmaVm, jsValue, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
1266 AddInternalProperties(ecmaVm, objRef, ArkInternalValueType::Entry, internalObjects);
1267 ArrayRef::SetValueAt(ecmaVm, jsValueRef, index++, objRef);
1269 ArrayRef::SetValueAt(ecmaVm, jsValueRef, index++, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
1272 AddInternalProperties(ecmaVm, jsValueRef, ArkInternalValueType::Entry, internalObjects);
1276 Local<JSValueRef> DebuggerApi::GetVectorValue(const EcmaVM *ecmaVm, Local<JSValueRef> value,
1281 Local<JSValueRef> jsValueRef = ArrayRef::New(ecmaVm, size);
1282 JSThread *thread = ecmaVm->GetJSThread();
1287 ArrayRef::SetValueAt(ecmaVm, jsValueRef, index++, JSNApiHelper::ToLocal<JSValueRef>(currentValue));
1289 AddInternalProperties(ecmaVm, jsValueRef, ArkInternalValueType::Entry, internalObjects);
1293 bool DebuggerApi::CheckPromiseQueueSize(const EcmaVM *ecmaVm)
1295 auto *debuggerMgr = ecmaVm->GetJsDebuggerManager();
1297 JSThread *thread = ecmaVm->GetJSThread();
1303 bool DebuggerApi::CheckIsSendableMethod(const EcmaVM *ecmaVm)
1305 auto *debuggerMgr = ecmaVm->GetJsDebuggerManager();
1313 void DebuggerApi::DropLastFrame(const EcmaVM *ecmaVm)
1315 auto *debuggerMgr = ecmaVm->GetJsDebuggerManager();