Changeset 121382 in webkit for trunk/Source/JavaScriptCore
- Timestamp:
- Jun 27, 2012, 4:16:10 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r121381 r121382 1 2012-06-27 Filip Pizlo <[email protected]> 2 3 DFG disassembly should be easier to read 4 https://bugs.webkit.org/show_bug.cgi?id=90106 5 6 Reviewed by Mark Hahnenberg. 7 8 Did a few things: 9 10 - Options::showDFGDisassembly now shows OSR exit disassembly as well. 11 12 - Phi node dumping doesn't attempt to do line wrapping since it just made the dump harder 13 to read. 14 15 - DFG graph disassembly view shows a few additional node types that turn out to be 16 essential for understanding OSR exits. 17 18 Put together, these changes reinforce the philosophy that anything needed for computing 19 OSR exit is just as important as the machine code itself. Of course, we still don't take 20 that philosophy to its full extreme - for example Phantom nodes are not dumped. We may 21 revisit that in the future. 22 23 * assembler/LinkBuffer.cpp: 24 (JSC::LinkBuffer::finalizeCodeWithDisassembly): 25 * assembler/LinkBuffer.h: 26 (JSC): 27 * dfg/DFGDisassembler.cpp: 28 (JSC::DFG::Disassembler::dump): 29 * dfg/DFGGraph.cpp: 30 (JSC::DFG::Graph::dumpBlockHeader): 31 * dfg/DFGNode.h: 32 (JSC::DFG::Node::willHaveCodeGenOrOSR): 33 * dfg/DFGOSRExitCompiler.cpp: 34 * jit/JIT.cpp: 35 (JSC::JIT::privateCompile): 36 1 37 2012-06-25 Mark Hahnenberg <[email protected]> 2 38 -
trunk/Source/JavaScriptCore/assembler/LinkBuffer.cpp
r120786 r121382 42 42 LinkBuffer::CodeRef LinkBuffer::finalizeCodeWithDisassembly(const char* format, ...) 43 43 { 44 ASSERT(Options::showDisassembly );44 ASSERT(Options::showDisassembly || Options::showDFGDisassembly); 45 45 46 46 CodeRef result = finalizeCodeWithoutDisassembly(); -
trunk/Source/JavaScriptCore/assembler/LinkBuffer.h
r120786 r121382 258 258 }; 259 259 260 #define FINALIZE_CODE_IF(condition, linkBufferReference, dataLogArgumentsForHeading) \ 261 (UNLIKELY((condition)) \ 262 ? ((linkBufferReference).finalizeCodeWithDisassembly dataLogArgumentsForHeading) \ 263 : (linkBufferReference).finalizeCodeWithoutDisassembly()) 264 260 265 // Use this to finalize code, like so: 261 266 // … … 275 280 276 281 #define FINALIZE_CODE(linkBufferReference, dataLogArgumentsForHeading) \ 277 (UNLIKELY(Options::showDisassembly) \ 278 ? ((linkBufferReference).finalizeCodeWithDisassembly dataLogArgumentsForHeading) \ 279 : (linkBufferReference).finalizeCodeWithoutDisassembly()) 282 FINALIZE_CODE_IF(Options::showDisassembly, linkBufferReference, dataLogArgumentsForHeading) 280 283 281 284 } // namespace JSC -
trunk/Source/JavaScriptCore/dfg/DFGDisassembler.cpp
r120834 r121382 44 44 m_graph.m_dominators.computeIfNecessary(m_graph); 45 45 46 dataLog("Generated JIT code for DFG CodeBlock %p :\n", m_graph.m_codeBlock);46 dataLog("Generated JIT code for DFG CodeBlock %p, instruction count = %u:\n", m_graph.m_codeBlock, m_graph.m_codeBlock->instructionCount()); 47 47 dataLog(" Code at [%p, %p):\n", linkBuffer.debugAddress(), static_cast<char*>(linkBuffer.debugAddress()) + linkBuffer.debugSize()); 48 48 … … 60 60 NodeIndex lastNodeIndexForDisassembly = block->at(0); 61 61 for (size_t i = 0; i < block->size(); ++i) { 62 if (!m_graph[block->at(i)].willHaveCodeGen ())62 if (!m_graph[block->at(i)].willHaveCodeGenOrOSR()) 63 63 continue; 64 64 MacroAssembler::Label currentLabel; -
trunk/Source/JavaScriptCore/dfg/DFGGraph.cpp
r120834 r121382 328 328 } 329 329 dataLog("%s Phi Nodes:", prefix); 330 unsigned count = 0;331 330 for (size_t i = 0; i < block->phis.size(); ++i) { 332 331 NodeIndex phiNodeIndex = block->phis[i]; … … 334 333 if (!phiNode.shouldGenerate() && phiNodeDumpMode == DumpLivePhisOnly) 335 334 continue; 336 if (!((++count) % 4))337 dataLog("\n%s ", prefix);338 335 dataLog(" @%u->(", phiNodeIndex); 339 336 if (phiNode.child1()) { -
trunk/Source/JavaScriptCore/dfg/DFGNode.h
r120834 r121382 732 732 } 733 733 734 bool willHaveCodeGen() 735 { 736 return shouldGenerate() && op() != Phantom && op() != Nop; 734 bool willHaveCodeGenOrOSR() 735 { 736 switch (op()) { 737 case SetLocal: 738 case Int32ToDouble: 739 case ValueToInt32: 740 case UInt32ToNumber: 741 case DoubleAsInt32: 742 return true; 743 case Phantom: 744 case Nop: 745 return false; 746 default: 747 return shouldGenerate(); 748 } 737 749 } 738 750 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp
r121073 r121382 30 30 31 31 #include "CallFrame.h" 32 #include "DFGCommon.h" 32 33 #include "LinkBuffer.h" 33 34 #include "RepatchBuffer.h" … … 80 81 81 82 LinkBuffer patchBuffer(*globalData, &jit, codeBlock); 82 exit.m_code = FINALIZE_CODE( 83 exit.m_code = FINALIZE_CODE_IF( 84 shouldShowDisassembly(), 83 85 patchBuffer, 84 86 ("DFG OSR exit #%u (bc#%u, @%u, %s) from CodeBlock %p", -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r121073 r121382 764 764 765 765 CodeRef result = FINALIZE_CODE( 766 patchBuffer, ("Baseline JIT code for CodeBlock %p", m_codeBlock)); 766 patchBuffer, 767 ("Baseline JIT code for CodeBlock %p, instruction count = %u", 768 m_codeBlock, m_codeBlock->instructionCount())); 767 769 768 770 m_globalData->machineCodeBytesPerBytecodeWordForBaselineJIT.add(
Note:
See TracChangeset
for help on using the changeset viewer.