mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
!8214 skip try catch compile in jit
Merge pull request !8214 from zoumujia/trycatchjit
This commit is contained in:
commit
b7fa81a4c6
@ -21,6 +21,8 @@
|
||||
#include "ecmascript/compiler/aot_file/func_entry_des.h"
|
||||
#include "ecmascript/dfx/vmstat/jit_warmup_profiler.h"
|
||||
#include "ecmascript/ic/profile_type_info.h"
|
||||
#include "libpandafile/code_data_accessor-inl.h"
|
||||
#include "libpandafile/method_data_accessor-inl.h"
|
||||
|
||||
namespace panda::ecmascript {
|
||||
void (*Jit::initJitCompiler_)(JSRuntimeOptions options) = nullptr;
|
||||
@ -172,8 +174,22 @@ Jit::~Jit()
|
||||
{
|
||||
}
|
||||
|
||||
bool Jit::SupportJIT(const Method *method) const
|
||||
bool Jit::MethodHasTryCatch(const JSPandaFile *jsPandaFile, const MethodLiteral *methodLiteral) const
|
||||
{
|
||||
auto pf = jsPandaFile->GetPandaFile();
|
||||
panda_file::MethodDataAccessor mda(*pf, methodLiteral->GetMethodId());
|
||||
panda_file::CodeDataAccessor cda(*pf, mda.GetCodeId().value());
|
||||
return cda.GetTriesSize() != 0;
|
||||
}
|
||||
|
||||
bool Jit::SupportJIT(const Method *method, EcmaVM *vm) const
|
||||
{
|
||||
const JSPandaFile* jSPandaFile_ = method->GetJSPandaFile();
|
||||
MethodLiteral* methodLiteral_ = method->GetMethodLiteral();
|
||||
if (!vm->GetJSOptions().IsEnableTryCatchFunction() && MethodHasTryCatch(jSPandaFile_, methodLiteral_)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
FunctionKind kind = method->GetFunctionKind();
|
||||
switch (kind) {
|
||||
case FunctionKind::NORMAL_FUNCTION:
|
||||
@ -283,7 +299,7 @@ void Jit::Compile(EcmaVM *vm, JSHandle<JSFunction> &jsFunction, CompilerTier tie
|
||||
return;
|
||||
}
|
||||
bool isJSSharedFunction = jsFunction.GetTaggedValue().IsJSSharedFunction();
|
||||
if (!jit->SupportJIT(method) || isJSSharedFunction) {
|
||||
if (!jit->SupportJIT(method, vm) || isJSSharedFunction) {
|
||||
FunctionKind kind = method->GetFunctionKind();
|
||||
std::stringstream msgStr;
|
||||
msgStr << "method does not support jit:" << methodInfo << ", kind:" << static_cast<int>(kind)
|
||||
|
@ -69,6 +69,7 @@ public:
|
||||
void Destroy();
|
||||
void CheckMechineCodeSpaceMemory(JSThread *thread, int remainSize);
|
||||
void ChangeTaskPoolState(bool inBackground);
|
||||
bool MethodHasTryCatch(const JSPandaFile *jsPandaFile, const MethodLiteral *methodLiteral) const;
|
||||
|
||||
// dfx for jit warmup compile
|
||||
static void CountInterpExecFuncs(JSHandle<JSFunction> &jsFunction);
|
||||
@ -200,7 +201,7 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
bool SupportJIT(const Method *method) const;
|
||||
bool SupportJIT(const Method *method, EcmaVM *vm) const;
|
||||
bool initialized_ { false };
|
||||
bool fastJitEnable_ { false };
|
||||
bool baselineJitEnable_ { false };
|
||||
|
@ -4586,7 +4586,8 @@ template("host_jit_test_action") {
|
||||
" --asm-interpreter=true" + " --compiler-enable-jit=true" +
|
||||
" --compiler-enable-jit-pgo=true" +
|
||||
" --compiler-jit-hotness-threshold=5" + " --enable-pgo-profiler=true" +
|
||||
" --compiler-enable-litecg=true" + " --entry-point=${_target_name_} "
|
||||
" --compiler-enable-litecg=true" + " --entry-point=${_target_name_} " +
|
||||
" --compiler-try-catch-function=true"
|
||||
_jit_run_options_ += common_options
|
||||
|
||||
if (defined(invoker.enable_osr) && invoker.enable_osr) {
|
||||
|
Loading…
Reference in New Issue
Block a user