mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-26 19:50:55 +00:00
Add print codesize for jit
Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IB4DCL Signed-off-by: zhixin <1757149461@qq.com>
This commit is contained in:
parent
fd8fd6ae20
commit
d85178cd1f
@ -531,7 +531,7 @@ Jit::TimeScope::~TimeScope()
|
||||
if (vm_->GetEnableJitLogSkip() && bundleName != "" && message_.find(bundleName) == std::string::npos) {
|
||||
return;
|
||||
}
|
||||
LOG_JIT(INFO) << tier_ << message_ << ": " << TotalSpentTime() << "ms";
|
||||
LOG_JIT(INFO) << tier_ << message_ << ", compile time: " << TotalSpentTime() << "ms";
|
||||
}
|
||||
}
|
||||
} // namespace panda::ecmascript
|
||||
|
@ -129,6 +129,9 @@ public:
|
||||
explicit TimeScope(EcmaVM *vm)
|
||||
: vm_(vm), message_(""), tier_(CompilerTier::Tier::FAST), outPutLog_(false), isDebugLevel_(true) {}
|
||||
PUBLIC_API ~TimeScope();
|
||||
|
||||
void appendMessage(const CString& value) { message_ += value; }
|
||||
|
||||
private:
|
||||
EcmaVM *vm_;
|
||||
CString message_;
|
||||
|
@ -417,6 +417,14 @@ bool JitTask::AsyncTask::Run([[maybe_unused]] uint32_t threadIndex)
|
||||
if (jitTask_->IsAsyncTask()) {
|
||||
jitTask_->jit_->RequestInstallCode(jitTask_);
|
||||
}
|
||||
|
||||
MachineCodeDesc codeDesc = jitTask_->GetMachineCodeDesc();
|
||||
size_t instrSize = codeDesc.codeSizeAlign + codeDesc.rodataSizeBeforeTextAlign
|
||||
+ codeDesc.rodataSizeAfterTextAlign;
|
||||
CString sizeInfo = ": text size: ";
|
||||
sizeInfo.append(std::to_string(instrSize)).append("bytes");
|
||||
scope.appendMessage(sizeInfo);
|
||||
|
||||
int compilerTime = scope.TotalSpentTimeInMicroseconds();
|
||||
JitDfx::GetInstance()->RecordSpentTimeAndPrintStatsLogInJitThread(compilerTime, jitTask_->methodName_,
|
||||
jitTask_->compilerTier_.IsBaseLine(), jitTask_->mainThreadCompileTime_);
|
||||
|
Loading…
Reference in New Issue
Block a user