From ac3d5059ca805c47b934c90d909233b94cbdaa2d Mon Sep 17 00:00:00 2001 From: yanzhiqi1 Date: Sat, 9 Aug 2025 15:35:47 +0800 Subject: [PATCH] sync code Issue: #ICS6HJ Signed-off-by: yanzhiqi1 Change-Id: Id2a0bfac7d0fb5781ee0548512a108f1a19698a5 --- ecmascript/patch/patch_loader.cpp | 3 ++- ecmascript/patch/quick_fix_helper.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ecmascript/patch/patch_loader.cpp b/ecmascript/patch/patch_loader.cpp index 017f729c17..be3c85c2fa 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 2066ab52bb..fe0f6421d7 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; -- Gitee