Changeset 136069 in webkit for trunk/Source/JavaScriptCore/jit/JITDisassembler.cpp
- Timestamp:
- Nov 28, 2012, 3:37:24 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITDisassembler.cpp
r135469 r136069 45 45 } 46 46 47 void JITDisassembler::dump( LinkBuffer& linkBuffer)47 void JITDisassembler::dump(PrintStream& out, LinkBuffer& linkBuffer) 48 48 { 49 dataLogF("Baseline JIT code for CodeBlock %p, instruction count = %u:\n", m_codeBlock, m_codeBlock->instructionCount());50 dataLogF(" Code at [%p, %p):\n", linkBuffer.debugAddress(), static_cast<char*>(linkBuffer.debugAddress()) + linkBuffer.debugSize());51 dumpDisassembly( linkBuffer, m_startOfCode, m_labelForBytecodeIndexInMainPath[0]);49 out.print("Baseline JIT code for CodeBlock ", RawPointer(m_codeBlock), ", instruction count = ", m_codeBlock->instructionCount(), "\n"); 50 out.print(" Code at [", RawPointer(linkBuffer.debugAddress()), ", ", RawPointer(static_cast<char*>(linkBuffer.debugAddress()) + linkBuffer.debugSize()), "):\n"); 51 dumpDisassembly(out, linkBuffer, m_startOfCode, m_labelForBytecodeIndexInMainPath[0]); 52 52 53 53 MacroAssembler::Label firstSlowLabel; … … 58 58 } 59 59 } 60 dumpForInstructions( linkBuffer, " ", m_labelForBytecodeIndexInMainPath, firstSlowLabel.isSet() ? firstSlowLabel : m_endOfSlowPath);61 dataLogF(" (End Of Main Path)\n");62 dumpForInstructions( linkBuffer, " (S) ", m_labelForBytecodeIndexInSlowPath, m_endOfSlowPath);63 dataLogF(" (End Of Slow Path)\n");60 dumpForInstructions(out, linkBuffer, " ", m_labelForBytecodeIndexInMainPath, firstSlowLabel.isSet() ? firstSlowLabel : m_endOfSlowPath); 61 out.print(" (End Of Main Path)\n"); 62 dumpForInstructions(out, linkBuffer, " (S) ", m_labelForBytecodeIndexInSlowPath, m_endOfSlowPath); 63 out.print(" (End Of Slow Path)\n"); 64 64 65 dumpDisassembly( linkBuffer, m_endOfSlowPath, m_endOfCode);65 dumpDisassembly(out, linkBuffer, m_endOfSlowPath, m_endOfCode); 66 66 } 67 67 68 void JITDisassembler::dumpForInstructions(LinkBuffer& linkBuffer, const char* prefix, Vector<MacroAssembler::Label>& labels, MacroAssembler::Label endLabel) 68 void JITDisassembler::dump(LinkBuffer& linkBuffer) 69 { 70 dump(WTF::dataFile(), linkBuffer); 71 } 72 73 void JITDisassembler::dumpForInstructions(PrintStream& out, LinkBuffer& linkBuffer, const char* prefix, Vector<MacroAssembler::Label>& labels, MacroAssembler::Label endLabel) 69 74 { 70 75 for (unsigned i = 0 ; i < labels.size();) { … … 73 78 continue; 74 79 } 75 dataLogF("%s",prefix);80 out.print(prefix); 76 81 m_codeBlock->dump(i); 77 82 for (unsigned nextIndex = i + 1; ; nextIndex++) { 78 83 if (nextIndex >= labels.size()) { 79 dumpDisassembly( linkBuffer, labels[i], endLabel);84 dumpDisassembly(out, linkBuffer, labels[i], endLabel); 80 85 return; 81 86 } 82 87 if (labels[nextIndex].isSet()) { 83 dumpDisassembly( linkBuffer, labels[i], labels[nextIndex]);88 dumpDisassembly(out, linkBuffer, labels[i], labels[nextIndex]); 84 89 i = nextIndex; 85 90 break; … … 89 94 } 90 95 91 void JITDisassembler::dumpDisassembly( LinkBuffer& linkBuffer, MacroAssembler::Label from, MacroAssembler::Label to)96 void JITDisassembler::dumpDisassembly(PrintStream& out, LinkBuffer& linkBuffer, MacroAssembler::Label from, MacroAssembler::Label to) 92 97 { 93 98 CodeLocationLabel fromLocation = linkBuffer.locationOf(from); 94 99 CodeLocationLabel toLocation = linkBuffer.locationOf(to); 95 disassemble(fromLocation, bitwise_cast<uintptr_t>(toLocation.executableAddress()) - bitwise_cast<uintptr_t>(fromLocation.executableAddress()), " ", WTF::dataFile());100 disassemble(fromLocation, bitwise_cast<uintptr_t>(toLocation.executableAddress()) - bitwise_cast<uintptr_t>(fromLocation.executableAddress()), " ", out); 96 101 } 97 102
Note:
See TracChangeset
for help on using the changeset viewer.