diff --git a/ecmascript/patch/patch_loader.cpp b/ecmascript/patch/patch_loader.cpp index 017f729c17a71297d5aa748b736e5a659c73796b..be3c85c2fa7e0423427b56f5417c47c8d36608c9 100644 --- a/ecmascript/patch/patch_loader.cpp +++ b/ecmascript/patch/patch_loader.cpp @@ -89,10 +89,11 @@ void PatchLoader::ExecuteFuncOrPatchMain( moduleRecords.emplace(recordName, moduleRecord); } + EcmaVM *vm = thread->GetEcmaVM(); for (const auto &recordName : replacedRecordNames) { LOG_ECMA(DEBUG) << "func main record name " << recordName; JSHandle program = - JSPandaFileManager::GetInstance()->GenerateProgram(thread->GetEcmaVM(), jsPandaFile, recordName); + JSPandaFileManager::GetInstance()->GenerateProgram(vm, jsPandaFile, recordName); if (program.IsEmpty()) { LOG_ECMA(ERROR) << "program is empty, invoke entrypoint failed"; continue; diff --git a/ecmascript/patch/quick_fix_helper.cpp b/ecmascript/patch/quick_fix_helper.cpp index 2066ab52bbd7f6af8f29b3d3d58869d247391d89..fe0f6421d73f267d682238ca50ccd49e3be3b90c 100644 --- a/ecmascript/patch/quick_fix_helper.cpp +++ b/ecmascript/patch/quick_fix_helper.cpp @@ -21,7 +21,8 @@ JSTaggedValue QuickFixHelper::CreateMainFuncWithPatch(EcmaVM *vm, MethodLiteral const JSPandaFile *jsPandaFile) { JSThread *thread = vm->GetJSThread(); - if (vm->GetStageOfColdReload() != StageOfColdReload::NOT_COLD_RELOAD) { + if (vm->GetStageOfColdReload() != + StageOfColdReload::NOT_COLD_RELOAD) { EntityId methodId = mainMethodLiteral->GetMethodId(); JSTaggedValue patchVal = vm->GetQuickFixManager()->CheckAndGetPatch(thread, jsPandaFile, methodId); return patchVal;