mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 18:20:04 +00:00
commit
9e46c1099c
9
BUILD.gn
9
BUILD.gn
@ -1308,3 +1308,12 @@ ohos_prebuilt_etc("app_aot_disable_list") {
|
||||
part_name = "ets_runtime"
|
||||
subsystem_name = "arkcompiler"
|
||||
}
|
||||
|
||||
ohos_prebuilt_etc("app_jit_enable_list") {
|
||||
relative_install_dir = "ark"
|
||||
source = "$js_root/ecmascript/ohos/app_jit_enable_list.conf"
|
||||
|
||||
# Set the subsystem name
|
||||
part_name = "ets_runtime"
|
||||
subsystem_name = "arkcompiler"
|
||||
}
|
||||
|
@ -46,6 +46,7 @@
|
||||
"sub_component": [
|
||||
"//arkcompiler/ets_runtime:app_aot_enable_list",
|
||||
"//arkcompiler/ets_runtime:app_aot_disable_list",
|
||||
"//arkcompiler/ets_runtime:app_jit_enable_list",
|
||||
"//arkcompiler/ets_runtime:ark_js_packages",
|
||||
"//arkcompiler/ets_runtime/etc:arkcompiler.para.dac"
|
||||
],
|
||||
|
@ -168,7 +168,12 @@ void EcmaVM::PostFork()
|
||||
|
||||
bool isEnableJit = options_.IsEnableJIT() && options_.GetEnableAsmInterpreter();
|
||||
options_.SetEnableAPPJIT(true);
|
||||
Jit::GetInstance()->SetEnableOrDisable(options_, isEnableJit);
|
||||
if (ohos::EnableAotListHelper::GetJitInstance()->IsEnableJit(bundleName) && options_.GetEnableAsmInterpreter()) {
|
||||
Jit::GetInstance()->SetEnableOrDisable(options_, isEnableJit);
|
||||
if (isEnableJit) {
|
||||
EnableJit();
|
||||
}
|
||||
}
|
||||
#ifdef ENABLE_POSTFORK_FORCEEXPAND
|
||||
heap_->NotifyPostFork();
|
||||
heap_->NotifyFinishColdStartSoon();
|
||||
|
4
ecmascript/ohos/app_jit_enable_list.conf
Normal file
4
ecmascript/ohos/app_jit_enable_list.conf
Normal file
@ -0,0 +1,4 @@
|
||||
# Apps in this configuration file can be compiled by jit compiler, enable list can be written as below:
|
||||
# {bundleName}:{moduleName}
|
||||
# {bundleName}
|
||||
# com.huawei.hmos.calculator
|
@ -17,4 +17,5 @@
|
||||
namespace panda::ecmascript::ohos {
|
||||
const std::string EnableAotListHelper::ENABLE_LIST_NAME = "/etc/ark/app_aot_enable_list.conf";
|
||||
const std::string EnableAotListHelper::DISABLE_LIST_NAME = "/etc/ark/app_aot_disable_list.conf";
|
||||
const std::string EnableAotListHelper::JIT_ENABLE_LIST_NAME = "/etc/ark/app_jit_enable_list.conf";
|
||||
} // namespace panda::ecmascript::ohos
|
||||
|
@ -34,6 +34,12 @@ public:
|
||||
return helper;
|
||||
}
|
||||
|
||||
static std::shared_ptr<EnableAotListHelper> GetJitInstance()
|
||||
{
|
||||
static auto helper = std::make_shared<EnableAotListHelper>(JIT_ENABLE_LIST_NAME, "");
|
||||
return helper;
|
||||
}
|
||||
|
||||
explicit EnableAotListHelper(const std::string &enableListName, const std::string &disableListName)
|
||||
{
|
||||
ReadEnableAotList(enableListName);
|
||||
@ -56,6 +62,11 @@ public:
|
||||
return IsEnableList(bundleName + ":" + moduleName);
|
||||
}
|
||||
|
||||
bool IsEnableJit(const std::string &candidate)
|
||||
{
|
||||
return jitEnableList_.find(candidate) != jitEnableList_.end();
|
||||
}
|
||||
|
||||
bool IsDisableBlackList(const std::string &candidate)
|
||||
{
|
||||
return disableList_.find(candidate) != disableList_.end();
|
||||
@ -79,10 +90,16 @@ public:
|
||||
disableList_.insert(entry);
|
||||
}
|
||||
|
||||
void AddJitEnableListEntry(const std::string &entry)
|
||||
{
|
||||
jitEnableList_.insert(entry);
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
disableList_.clear();
|
||||
enableList_.clear();
|
||||
jitEnableList_.clear();
|
||||
}
|
||||
|
||||
private:
|
||||
@ -129,12 +146,17 @@ private:
|
||||
if (aotListName == DISABLE_LIST_NAME) {
|
||||
AddDisableListEntry(appName);
|
||||
}
|
||||
if (aotListName == JIT_ENABLE_LIST_NAME) {
|
||||
AddJitEnableListEntry(appName);
|
||||
}
|
||||
}
|
||||
}
|
||||
std::set<std::string> enableList_ {};
|
||||
std::set<std::string> disableList_ {};
|
||||
std::set<std::string> jitEnableList_ {};
|
||||
static const std::string ENABLE_LIST_NAME;
|
||||
static const std::string DISABLE_LIST_NAME;
|
||||
static const std::string JIT_ENABLE_LIST_NAME;
|
||||
};
|
||||
} // namespace panda::ecmascript::ohos
|
||||
#endif // ECMASCRIPT_OHOS_ENABLE_AOT_LIST_HELPER_H
|
||||
|
Loading…
Reference in New Issue
Block a user