예제 #1
0
파일: debug.cpp 프로젝트: Alienfeel/hhvm
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);
}
예제 #2
0
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);
  }
}
예제 #3
0
파일: debug.cpp 프로젝트: 6api/hhvm
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);
  }
}
예제 #4
0
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);
  }
}
예제 #5
0
파일: debug.cpp 프로젝트: 6api/hhvm
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);
  }
}
예제 #6
0
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);
  }
}