!7074 jit compile mode refactor

Merge pull request !7074 from zoumujia/refactor
This commit is contained in:
openharmony_ci 2024-04-24 12:54:32 +00:00 committed by Gitee
commit 81f3a44cbd
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 10 additions and 8 deletions

View File

@ -95,10 +95,6 @@
#include "ecmascript/ohos/enable_aot_list_helper.h"
#include "ecmascript/ohos/jit_tools.h"
#ifdef JIT_SWITCH_COMPILE_MODE
#include "base/startup/init/interfaces/innerkits/include/syspara/parameters.h"
#endif
#ifdef PANDA_TARGET_OHOS
#include "parameters.h"
#endif
@ -347,11 +343,9 @@ void EcmaVM::EnableJit()
options_.SetEnableProfileDump(profileNeedDump);
GetJSThread()->SwitchJitProfileStubs();
#ifdef JIT_SWITCH_COMPILE_MODE
bool jitEnableLitecg = OHOS::system::GetBoolParameter("ark.jit.enable.litecg", true);
bool jitEnableLitecg = panda::ecmascript::ohos::IsJitEnableLitecg(options_.IsCompilerEnableLiteCG());
LOG_JIT(INFO) << "jit enable litecg: " << jitEnableLitecg;
options_.SetCompilerEnableLiteCG(jitEnableLitecg);
#endif
}
Jit *EcmaVM::GetJit() const

View File

@ -15,7 +15,7 @@
#ifndef ECMASCRIPT_JIT_TOOLS_H
#define ECMASCRIPT_JIT_TOOLS_H
#ifdef JIT_ESCAPE_ENABLE
#if defined(JIT_ESCAPE_ENABLE) || defined(JIT_SWITCH_COMPILE_MODE)
#include "base/startup/init/interfaces/innerkits/include/syspara/parameters.h"
#endif
@ -28,5 +28,13 @@ bool GetJitEscapeEanble()
#endif
return true;
}
bool IsJitEnableLitecg(bool value)
{
#ifdef JIT_SWITCH_COMPILE_MODE
return OHOS::system::GetBoolParameter("ark.jit.enable.litecg", true);
#endif
return value;
}
}
#endif // ECMASCRIPT_JIT_TOOLS_H