void DebugInfo::recordPerfMap(TCRange range, const Func* func, bool exit, bool inPrologue) { if (!m_perfMap) return; if (RuntimeOption::EvalProfileBC) return; std::string name = lookupFunction(func, exit, inPrologue, true); fprintf(m_perfMap, "%lx %x %s\n", reinterpret_cast<uintptr_t>(range.begin()), range.size(), name.c_str()); fflush(m_perfMap); }
void DebugInfo::recordStub(TCRange range, const char* name) { if (range.isAstubs()) { m_astubsDwarfInfo.addTracelet(range, name, NULL, NULL, false, false); } else { m_aDwarfInfo.addTracelet(range, name, NULL, NULL, false, false); } }
void DebugInfo::recordStub(TCRange range, const char* name) { if (range.isAcold()) { m_acoldDwarfInfo.addTracelet(range, name, nullptr, nullptr, false, false); } else { m_aDwarfInfo.addTracelet(range, name, nullptr, nullptr, false, false); } }
void DebugInfo::recordTracelet(TCRange range, const Func* func, const Opcode *instr, bool exit, bool inPrologue) { if (range.isAstubs()) { m_astubsDwarfInfo.addTracelet(range, NULL, func, instr, exit, inPrologue); } else { m_aDwarfInfo.addTracelet(range, NULL, func, instr, exit, inPrologue); } }
void DebugInfo::recordTracelet(TCRange range, const Func* func, const Op* instr, bool exit, bool inPrologue) { if (range.isAcold()) { m_acoldDwarfInfo.addTracelet(range, nullptr, func, instr, exit, inPrologue); } else { m_aDwarfInfo.addTracelet(range, nullptr, func, instr, exit, inPrologue); } }
void DebugInfo::recordBCInstr(TCRange range, uint32_t op) { static const char* opcodeName[] = { #define O(name, imm, push, pop, flags) \ #name, OPCODES #undef O }; static const char* astubOpcodeName[] = { "OpAstubStart", #define O(name, imm, push, pop, flags) \ #name "-Astub", OPCODES #undef O }; static const char* highOpcodeName[] = { "OpHighStart", #define O(name) \ #name, HIGH_OPCODES #undef O }; if (RuntimeOption::EvalProfileBC) { if (!m_perfMap) return; const char* name; if (op < Op_count) { name = opcodeName[op]; } else if (op < OpAstubCount) { name = astubOpcodeName[op - OpAstubStart]; } else { name = highOpcodeName[op - OpHighStart]; } fprintf(m_perfMap, "%lx %x %s\n", uintptr_t(range.begin()), range.size(), name); } }