diff --git a/ecmascript/compiler/aot_compiler.cpp b/ecmascript/compiler/aot_compiler.cpp index 43fb555ccc1b0c48c00f0b983abf33d88a9b162d..1e99007eeb774691c6f890edd622b65038662671 100644 --- a/ecmascript/compiler/aot_compiler.cpp +++ b/ecmascript/compiler/aot_compiler.cpp @@ -215,10 +215,6 @@ int Main(const int argc, const char **argv) cOptions.optBCRange_); bool isEnableLiteCG = runtimeOptions.IsCompilerEnableLiteCG(); - if (ohos::EnableAotJitListHelper::GetInstance()->IsEnableAot(bundleName)) { - isEnableLiteCG = true; - } - vm->GetJSOptions().SetCompilerEnableLiteCG(isEnableLiteCG); compilerStats.SetIsLiteCg(isEnableLiteCG); AOTFileGenerator generator(&log, &logList, &aotCompilationEnv, cOptions.triple_, isEnableLiteCG); diff --git a/ecmascript/js_runtime_options.cpp b/ecmascript/js_runtime_options.cpp index 5b51de70b909ca64c232cb7e952b4817bf403de0..731a232cec77e88c456444d6b451ab4d689a5b01 100644 --- a/ecmascript/js_runtime_options.cpp +++ b/ecmascript/js_runtime_options.cpp @@ -1440,33 +1440,27 @@ void JSRuntimeOptions::BindCPUCoreForTargetCompilation() void JSRuntimeOptions::SetOptionsForTargetCompilation() { - if (IsTargetCompilerMode()) { + if (IsApplicationCompilation()) { SetTargetTriple("aarch64-unknown-linux-gnu"); SetMaxAotMethodSize(MAX_APP_COMPILE_METHOD_SIZE); SetEnableOptTrackField(false); SetEnableOptInlining(false); SetEnableArrayBoundsCheckElimination(false); - if (IsPartialCompilerMode()) { - SetEnableOptPGOType(true); - if (IsPGOProfilerPathEmpty()) { - LOG_ECMA(DEBUG) << "no pgo profile file in partial mode!"; - } - } else { + SetCompilerEnableLiteCG(true); + SetEnableOptPGOType(true); + } + + if (IsTargetCompilerMode()) { + if (UNLIKELY(IsFullCompilerMode())) { SetEnableOptPGOType(false); SetPGOProfilerPath(""); } BindCPUCoreForTargetCompilation(); } + if (IsCompilerPipelineHostAOT()) { - SetTargetTriple("aarch64-unknown-linux-gnu"); - SetMaxAotMethodSize(MAX_APP_COMPILE_METHOD_SIZE); - SetEnableOptTrackField(false); - SetEnableOptInlining(false); - SetEnableArrayBoundsCheckElimination(false); - SetEnableOptPGOType(true); SetFastAOTCompileMode(true); SetOptLevel(DEFAULT_OPT_LEVEL); - SetCompilerEnableLiteCG(true); SetEnableLoweringBuiltin(false); } } diff --git a/ecmascript/js_runtime_options.h b/ecmascript/js_runtime_options.h index 6db993c335436563cb12d02a88a416faf14f78d6..63c2c30c098ee82ffeb115f4b8fc5d933d68da27 100644 --- a/ecmascript/js_runtime_options.h +++ b/ecmascript/js_runtime_options.h @@ -1599,6 +1599,11 @@ public: return targetCompilerMode_ == "full"; } + bool IsApplicationCompilation() const + { + return IsTargetCompilerMode() || IsCompilerPipelineHostAOT(); + } + void SetHapPath(std::string path) { hapPath_ = std::move(path);