mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-07 08:03:29 +00:00
!3438 Add a Distinction for AOT's Input Panda File between Debuggable and Released Version
Merge pull request !3438 from dingding/debug_pf
This commit is contained in:
commit
e8193782b0
@ -40,6 +40,12 @@ bool PassManager::Compile(const std::string &fileName, AOTFileGenerator &generat
|
||||
(profilerLoader_.IsLoaded() || vm_->GetTSManager()->AssertTypes());
|
||||
BytecodeInfoCollector bcInfoCollector(vm_, jsPandaFile, maxAotMethodSize_,
|
||||
enableCollectLiteralInfo);
|
||||
|
||||
if (!IsReleasedPandaFile(jsPandaFile)) {
|
||||
LOG_COMPILER(ERROR) << "The input panda file [" << fileName
|
||||
<< "] of AOT Compiler is debuggable version, do not use for performance test!";
|
||||
}
|
||||
|
||||
ResolveModule(jsPandaFile, fileName);
|
||||
auto aotModule = new LLVMModule(fileName, triple_);
|
||||
auto aotModuleAssembler = new LLVMAssembler(aotModule->GetModule(),
|
||||
@ -131,6 +137,20 @@ JSPandaFile *PassManager::CreateAndVerifyJSPandaFile(const CString &fileName)
|
||||
return jsPandaFile;
|
||||
}
|
||||
|
||||
bool PassManager::IsReleasedPandaFile(const JSPandaFile *jsPandaFile) const
|
||||
{
|
||||
MethodLiteral* methodLiteral = jsPandaFile->GetMethodLiterals();
|
||||
if (methodLiteral == nullptr) {
|
||||
LOG_COMPILER(ERROR) << "There is no mehtod literal in " << jsPandaFile->GetJSPandaFileDesc();
|
||||
return false;
|
||||
}
|
||||
|
||||
panda_file::File::EntityId methodId = methodLiteral->GetMethodId();
|
||||
DebugInfoExtractor *debugInfoExtractor = JSPandaFileManager::GetInstance()->GetJSPtExtractor(jsPandaFile);
|
||||
LocalVariableTable lvt = debugInfoExtractor->GetLocalVariableTable(methodId);
|
||||
return lvt.empty();
|
||||
}
|
||||
|
||||
void PassManager::ResolveModule(const JSPandaFile *jsPandaFile, const std::string &fileName)
|
||||
{
|
||||
const auto &recordInfo = jsPandaFile->GetJSRecordInfo();
|
||||
|
@ -114,6 +114,7 @@ public:
|
||||
|
||||
private:
|
||||
JSPandaFile *CreateAndVerifyJSPandaFile(const CString &fileName);
|
||||
bool IsReleasedPandaFile(const JSPandaFile *jsPandaFile) const;
|
||||
void ResolveModule(const JSPandaFile *jsPandaFile, const std::string &fileName);
|
||||
|
||||
bool EnableTypeLowering() const
|
||||
|
Loading…
Reference in New Issue
Block a user