diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-29 12:18:48 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-29 12:18:57 +0100 |
commit | 4c01d0526ba4dd8cff0c0ff22a6f0ab5eb973064 (patch) | |
tree | bed2fe914fe0f7ec70abfb47d2d84af8a3604d09 /Source/JavaScriptCore/jit/JITDisassembler.cpp | |
parent | 01485457c9a5da3f1121015afd25bb53af77662e (diff) | |
download | qtwebkit-4c01d0526ba4dd8cff0c0ff22a6f0ab5eb973064.tar.gz |
Imported WebKit commit c60cfe0fc09efd257aa0111d7b133b02deb8a63e (http://svn.webkit.org/repository/webkit/trunk@136119)
New snapshot that includes the fix for installing the QtWebProcess into libexec
Change-Id: I01344e079cbdac5678c4cba6ffcc05f4597cf0d7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/jit/JITDisassembler.cpp')
-rw-r--r-- | Source/JavaScriptCore/jit/JITDisassembler.cpp | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/Source/JavaScriptCore/jit/JITDisassembler.cpp b/Source/JavaScriptCore/jit/JITDisassembler.cpp index 35b939913..0ec72e205 100644 --- a/Source/JavaScriptCore/jit/JITDisassembler.cpp +++ b/Source/JavaScriptCore/jit/JITDisassembler.cpp @@ -44,11 +44,11 @@ JITDisassembler::~JITDisassembler() { } -void JITDisassembler::dump(LinkBuffer& linkBuffer) +void JITDisassembler::dump(PrintStream& out, LinkBuffer& linkBuffer) { - dataLogF("Baseline JIT code for CodeBlock %p, instruction count = %u:\n", m_codeBlock, m_codeBlock->instructionCount()); - dataLogF(" Code at [%p, %p):\n", linkBuffer.debugAddress(), static_cast<char*>(linkBuffer.debugAddress()) + linkBuffer.debugSize()); - dumpDisassembly(linkBuffer, m_startOfCode, m_labelForBytecodeIndexInMainPath[0]); + out.print("Baseline JIT code for CodeBlock ", RawPointer(m_codeBlock), ", instruction count = ", m_codeBlock->instructionCount(), "\n"); + out.print(" Code at [", RawPointer(linkBuffer.debugAddress()), ", ", RawPointer(static_cast<char*>(linkBuffer.debugAddress()) + linkBuffer.debugSize()), "):\n"); + dumpDisassembly(out, linkBuffer, m_startOfCode, m_labelForBytecodeIndexInMainPath[0]); MacroAssembler::Label firstSlowLabel; for (unsigned i = 0; i < m_labelForBytecodeIndexInSlowPath.size(); ++i) { @@ -57,30 +57,35 @@ void JITDisassembler::dump(LinkBuffer& linkBuffer) break; } } - dumpForInstructions(linkBuffer, " ", m_labelForBytecodeIndexInMainPath, firstSlowLabel.isSet() ? firstSlowLabel : m_endOfSlowPath); - dataLogF(" (End Of Main Path)\n"); - dumpForInstructions(linkBuffer, " (S) ", m_labelForBytecodeIndexInSlowPath, m_endOfSlowPath); - dataLogF(" (End Of Slow Path)\n"); + dumpForInstructions(out, linkBuffer, " ", m_labelForBytecodeIndexInMainPath, firstSlowLabel.isSet() ? firstSlowLabel : m_endOfSlowPath); + out.print(" (End Of Main Path)\n"); + dumpForInstructions(out, linkBuffer, " (S) ", m_labelForBytecodeIndexInSlowPath, m_endOfSlowPath); + out.print(" (End Of Slow Path)\n"); + + dumpDisassembly(out, linkBuffer, m_endOfSlowPath, m_endOfCode); +} - dumpDisassembly(linkBuffer, m_endOfSlowPath, m_endOfCode); +void JITDisassembler::dump(LinkBuffer& linkBuffer) +{ + dump(WTF::dataFile(), linkBuffer); } -void JITDisassembler::dumpForInstructions(LinkBuffer& linkBuffer, const char* prefix, Vector<MacroAssembler::Label>& labels, MacroAssembler::Label endLabel) +void JITDisassembler::dumpForInstructions(PrintStream& out, LinkBuffer& linkBuffer, const char* prefix, Vector<MacroAssembler::Label>& labels, MacroAssembler::Label endLabel) { for (unsigned i = 0 ; i < labels.size();) { if (!labels[i].isSet()) { i++; continue; } - dataLogF("%s", prefix); + out.print(prefix); m_codeBlock->dump(i); for (unsigned nextIndex = i + 1; ; nextIndex++) { if (nextIndex >= labels.size()) { - dumpDisassembly(linkBuffer, labels[i], endLabel); + dumpDisassembly(out, linkBuffer, labels[i], endLabel); return; } if (labels[nextIndex].isSet()) { - dumpDisassembly(linkBuffer, labels[i], labels[nextIndex]); + dumpDisassembly(out, linkBuffer, labels[i], labels[nextIndex]); i = nextIndex; break; } @@ -88,11 +93,11 @@ void JITDisassembler::dumpForInstructions(LinkBuffer& linkBuffer, const char* pr } } -void JITDisassembler::dumpDisassembly(LinkBuffer& linkBuffer, MacroAssembler::Label from, MacroAssembler::Label to) +void JITDisassembler::dumpDisassembly(PrintStream& out, LinkBuffer& linkBuffer, MacroAssembler::Label from, MacroAssembler::Label to) { CodeLocationLabel fromLocation = linkBuffer.locationOf(from); CodeLocationLabel toLocation = linkBuffer.locationOf(to); - disassemble(fromLocation, bitwise_cast<uintptr_t>(toLocation.executableAddress()) - bitwise_cast<uintptr_t>(fromLocation.executableAddress()), " ", WTF::dataFile()); + disassemble(fromLocation, bitwise_cast<uintptr_t>(toLocation.executableAddress()) - bitwise_cast<uintptr_t>(fromLocation.executableAddress()), " ", out); } } // namespace JSC |