!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:
openharmony_ci 2023-01-19 08:27:12 +00:00 committed by Gitee
commit e8193782b0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 21 additions and 0 deletions

View File

@ -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();

View File

@ -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