add SuspendVM and ResumeVM

issues:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I79K2R

Signed-off-by: Rtangyu <rentangyu@huawei.com>
This commit is contained in:
Rtangyu
2023-07-24 19:59:31 +08:00
parent d2b6d4b24f
commit 649b8884c8
+6
View File
@@ -934,7 +934,13 @@ bool JsRuntime::BuildJsStackInfoList(uint32_t tid, std::vector<JsFrames>& jsFram
auto nativeEngine = GetNativeEnginePointer();
CHECK_POINTER_AND_RETURN(nativeEngine, false);
std::vector<JsFrameInfo> jsFrameInfo;
auto arkNativeEngine = static_cast<ArkNativeEngine*>(nativeEngine->GetWorkerVm(nativeEngine, tid));
if (arkNativeEngine == nullptr){
return false;
}
arkNativeEngine->SuspendVM();
bool ret = nativeEngine->BuildJsStackInfoList(tid, jsFrameInfo);
arkNativeEngine->ResumeVM();
if (!ret) {
return ret;
}