Lines Matching refs:ark
22 namespace ark::es2panda::util {
26 ark::Logger::ComponentMask componentMask;
27 componentMask.set(ark::Logger::Component::ASSEMBLER);
28 componentMask.set(ark::Logger::Component::COMPILER);
29 componentMask.set(ark::Logger::Component::BYTECODE_OPTIMIZER);
31 if (!ark::Logger::IsInitialized()) {
32 ark::Logger::InitializeStdLogging(Logger::LevelFromString(options->LogLevel()), componentMask);
34 ark::Logger::EnableComponent(componentMask);
39 static int OptimizeBytecode(ark::pandasm::Program *prog, const util::Options *options, const ReporterFun &reporter,
41 ark::pandasm::AsmEmitter::PandaFileToPandaAsmMaps *mapsp)
45 if (!ark::pandasm::AsmEmitter::Emit(options->CompilerOutput(), *prog, statp, mapsp, true)) {
46 reporter("Failed to emit binary data: " + ark::pandasm::AsmEmitter::GetLastError());
50 ark::bytecodeopt::g_options.SetOptLevel(options->OptLevel());
51 // Set default value instead of maximum set in ark::bytecodeopt::SetCompilerOptions()
52 ark::compiler::CompilerLogger::Init({"all"});
53 ark::compiler::g_options.SetCompilerMaxBytecodeSize(ark::compiler::g_options.GetCompilerMaxBytecodeSize());
54 ark::bytecodeopt::OptimizeBytecode(prog, mapsp, options->CompilerOutput(), options->IsDynamic(), true);
61 static int GenerateProgramImpl(ark::pandasm::Program *prog, const util::Options *options, const ReporterFun &reporter,
63 ark::pandasm::AsmEmitter::PandaFileToPandaAsmMaps *mapsp)
69 if (!ark::pandasm::AsmEmitter::AssignProfileInfo(prog)) {
74 if (!ark::pandasm::AsmEmitter::Emit(options->CompilerOutput(), *prog, statp, mapsp, true)) {
75 reporter("Failed to emit binary data: " + ark::pandasm::AsmEmitter::GetLastError());
103 int GenerateProgram(ark::pandasm::Program *prog, const util::Options *options, const ReporterFun &reporter)
107 ark::pandasm::AsmEmitter::PandaFileToPandaAsmMaps maps {};
108 ark::pandasm::AsmEmitter::PandaFileToPandaAsmMaps *mapsp = options->OptLevel() != 0 ? &maps : nullptr;
122 } // namespace ark::es2panda::util