Lines Matching +full:panda +full:- +full:options
2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
16 #include <assembly-program.h>
17 #include <assembly-emitter.h>
22 #include <options.h>
31 namespace panda::es2panda::aot { namespace
53 static void GenerateBase64Output(panda::pandasm::Program *prog) in GenerateBase64Output()
55 auto pandaFile = panda::pandasm::AsmEmitter::Emit(*prog); in GenerateBase64Output()
56 const uint8_t *buffer = pandaFile->GetBase(); in GenerateBase64Output()
57 size_t size = pandaFile->GetPtr().GetSize(); in GenerateBase64Output()
66 std::cout << "Panda file size statistic:" << std::endl; in DumpPandaFileSizeStatistic()
84 static bool GenerateProgramsByWorkers(const std::map<std::string, panda::es2panda::util::ProgramCac… in GenerateProgramsByWorkers()
85 …const std::unique_ptr<panda::es2panda::aot::Options> &options, std::map<std::string, size_t> *stat… in GenerateProgramsByWorkers() argument
87 auto queue = new panda::es2panda::aot::EmitFileQueue(options, statp, programsInfo); in GenerateProgramsByWorkers()
91 queue->Schedule(); in GenerateProgramsByWorkers()
92 queue->Consume(); in GenerateProgramsByWorkers()
93 queue->Wait(); in GenerateProgramsByWorkers()
105 static void DumpProgramInfos(const std::map<std::string, panda::es2panda::util::ProgramCache*> &pro… in DumpProgramInfos()
106 const std::unique_ptr<panda::es2panda::aot::Options> &options) in DumpProgramInfos() argument
108 const es2panda::CompilerOptions &compilerOptions = options->CompilerOptions(); in DumpProgramInfos()
112 es2panda::Compiler::DumpAsm(&(progInfo.second->program)); in DumpProgramInfos()
116 … panda::es2panda::util::Dumper::DumpLiterals(progInfo.second->program.literalarray_table); in DumpProgramInfos()
122 static bool GenerateProgram(const std::map<std::string, panda::es2panda::util::ProgramCache*> &prog… in GenerateProgram()
123 const std::unique_ptr<panda::es2panda::aot::Options> &options) in GenerateProgram() argument
125 DumpProgramInfos(programsInfo, options); in GenerateProgram()
128 auto *prog = &(programsInfo.begin()->second->program); in GenerateProgram()
129 if (options->OutputFiles().empty() && options->CompilerOutput().empty()) { in GenerateProgram()
134 if (options->compilerProtoOutput().size() > 0) { in GenerateProgram()
135 … panda::proto::ProtobufSnapshotGenerator::GenerateSnapshot(*prog, options->compilerProtoOutput()); in GenerateProgram()
140 bool dumpSize = options->SizeStat(); in GenerateProgram()
144 if (!GenerateProgramsByWorkers(programsInfo, options, statp)) { in GenerateProgram()
155 static bool GenerateAbcFiles(const std::map<std::string, panda::es2panda::util::ProgramCache*> &pro… in GenerateAbcFiles()
156 const std::unique_ptr<panda::es2panda::aot::Options> &options, size_t expectedProgsCount) in GenerateAbcFiles() argument
164 if (!GenerateProgram(programsInfo, options)) { in GenerateAbcFiles()
174 auto options = std::make_unique<Options>(); in Run() local
175 if (!options->Parse(argc, argv)) { in Run()
176 std::cerr << options->ErrorMsg() << std::endl; in Run()
180 if (options->CompilerOptions().bcVersion || options->CompilerOptions().bcMinVersion) { in Run()
181 std::string version = options->CompilerOptions().bcVersion ? in Run()
182 panda::panda_file::GetVersion(panda::panda_file::version) : in Run()
183 panda::panda_file::GetVersion(panda::panda_file::minVersion); in Run()
188 std::map<std::string, panda::es2panda::util::ProgramCache*> programsInfo; in Run()
189 size_t expectedProgsCount = options->CompilerOptions().sourceFiles.size(); in Run()
190 panda::ArenaAllocator allocator(panda::SpaceType::SPACE_TYPE_COMPILER, nullptr, true); in Run()
192 int ret = Compiler::CompileFiles(options->CompilerOptions(), programsInfo, &allocator); in Run()
193 if (options->ParseOnly()) { in Run()
197 if (!options->NpmModuleEntryList().empty()) { in Run()
198 es2panda::util::ModuleHelpers::CompileNpmModuleEntryList(options->NpmModuleEntryList(), in Run()
199 options->CompilerOptions(), programsInfo, &allocator); in Run()
203 if (!GenerateAbcFiles(programsInfo, options, expectedProgsCount)) { in Run()
209 } // namespace panda::es2panda::aot
213 panda::es2panda::aot::MemManager mm; in main()
214 return panda::es2panda::aot::Run(argc, argv); in main()