mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
!10283 add print codesize for jit
Merge pull request !10283 from 志新/sizeprint
This commit is contained in:
commit
6781ca7293
@ -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