Changeset 139496 in webkit
- Timestamp:
- Jan 11, 2013, 2:18:27 PM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r139491 r139496 1 2013-01-11 Filip Pizlo <fpizlo@apple.com> 2 3 It should be possible to enable verbose printing of each OSR exit at run-time (rather than compile-time) and it should print register state 4 https://bugs.webkit.org/show_bug.cgi?id=106700 5 6 Reviewed by Mark Hahnenberg. 7 8 * dfg/DFGAssemblyHelpers.h: 9 (DFG): 10 (JSC::DFG::AssemblyHelpers::debugCall): 11 * dfg/DFGCommon.h: 12 * dfg/DFGOSRExit.h: 13 (DFG): 14 * dfg/DFGOSRExitCompiler32_64.cpp: 15 (JSC::DFG::OSRExitCompiler::compileExit): 16 * dfg/DFGOSRExitCompiler64.cpp: 17 (JSC::DFG::OSRExitCompiler::compileExit): 18 * dfg/DFGOperations.cpp: 19 * dfg/DFGOperations.h: 20 * runtime/Options.h: 21 (JSC): 22 1 23 2013-01-11 Geoffrey Garen <ggaren@apple.com> 2 24 -
trunk/Source/JavaScriptCore/dfg/DFGAssemblyHelpers.h
r138669 r139496 40 40 namespace JSC { namespace DFG { 41 41 42 typedef void (*V_DFGDebugOperation_EP )(ExecState*, void*);42 typedef void (*V_DFGDebugOperation_EPP)(ExecState*, void*, void*); 43 43 44 44 class AssemblyHelpers : public MacroAssembler { … … 171 171 172 172 // Add a debug call. This call has no effect on JIT code execution state. 173 void debugCall(V_DFGDebugOperation_EP function, void* argument)173 void debugCall(V_DFGDebugOperation_EPP function, void* argument) 174 174 { 175 175 size_t scratchSize = sizeof(EncodedJSValue) * (GPRInfo::numberOfRegisters + FPRInfo::numberOfRegisters); … … 195 195 196 196 #if CPU(X86_64) || CPU(ARM) 197 move(TrustedImmPtr(buffer), GPRInfo::argumentGPR2); 197 198 move(TrustedImmPtr(argument), GPRInfo::argumentGPR1); 198 199 move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0); … … 201 202 poke(GPRInfo::callFrameRegister, 0); 202 203 poke(TrustedImmPtr(argument), 1); 204 poke(TrustedImmPtr(buffer), 2); 203 205 GPRReg scratch = GPRInfo::regT0; 204 206 #else -
trunk/Source/JavaScriptCore/dfg/DFGCommon.h
r135640 r139496 71 71 // Emit a breakpoint into the speculation failure code. 72 72 #define DFG_ENABLE_JIT_BREAK_ON_SPECULATION_FAILURE 0 73 // Log every speculation failure.74 #define DFG_ENABLE_VERBOSE_SPECULATION_FAILURE 075 73 // Disable the DFG JIT without having to touch Platform.h 76 74 #define DFG_DEBUG_LOCAL_DISBALE 0 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExit.h
r137976 r139496 123 123 }; 124 124 125 #if DFG_ENABLE(VERBOSE_SPECULATION_FAILURE)126 125 struct SpeculationFailureDebugInfo { 127 126 CodeBlock* codeBlock; 128 127 NodeIndex nodeIndex; 129 128 }; 130 #endif131 129 132 130 } } // namespace JSC::DFG -
trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler32_64.cpp
r138669 r139496 48 48 dumpOperands(operands, WTF::dataFile()); 49 49 #endif 50 #if DFG_ENABLE(VERBOSE_SPECULATION_FAILURE) 51 SpeculationFailureDebugInfo* debugInfo = new SpeculationFailureDebugInfo; 52 debugInfo->codeBlock = m_jit.codeBlock(); 53 debugInfo->nodeIndex = exit.m_nodeIndex; 54 55 m_jit.debugCall(debugOperationPrintSpeculationFailure, debugInfo); 56 #endif 50 51 if (Options::printEachOSRExit()) { 52 SpeculationFailureDebugInfo* debugInfo = new SpeculationFailureDebugInfo; 53 debugInfo->codeBlock = m_jit.codeBlock(); 54 debugInfo->nodeIndex = exit.m_nodeIndex; 55 56 m_jit.debugCall(debugOperationPrintSpeculationFailure, debugInfo); 57 } 57 58 58 59 #if DFG_ENABLE(JIT_BREAK_ON_SPECULATION_FAILURE) -
trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp
r138669 r139496 48 48 dumpOperands(operands, WTF::dataFile()); 49 49 #endif 50 #if DFG_ENABLE(VERBOSE_SPECULATION_FAILURE) 51 SpeculationFailureDebugInfo* debugInfo = new SpeculationFailureDebugInfo; 52 debugInfo->codeBlock = m_jit.codeBlock(); 53 debugInfo->nodeIndex = exit.m_nodeIndex; 54 55 m_jit.debugCall(debugOperationPrintSpeculationFailure, debugInfo); 56 #endif 50 51 if (Options::printEachOSRExit()) { 52 SpeculationFailureDebugInfo* debugInfo = new SpeculationFailureDebugInfo; 53 debugInfo->codeBlock = m_jit.codeBlock(); 54 debugInfo->nodeIndex = exit.m_nodeIndex; 55 56 m_jit.debugCall(debugOperationPrintSpeculationFailure, debugInfo); 57 } 57 58 58 59 #if DFG_ENABLE(JIT_BREAK_ON_SPECULATION_FAILURE) … … 137 138 if (!!exit.m_valueProfile) { 138 139 EncodedJSValue* bucket = exit.m_valueProfile.getSpecFailBucket(0); 139 140 #if DFG_ENABLE(VERBOSE_SPECULATION_FAILURE)141 dataLogF(" (have exit profile, bucket %p) ", bucket);142 #endif143 140 144 141 if (exit.m_jsValueSource.isAddress()) { -
trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp
r139491 r139496 1608 1608 } 1609 1609 1610 #if DFG_ENABLE(VERBOSE_SPECULATION_FAILURE) 1611 void DFG_OPERATION debugOperationPrintSpeculationFailure(ExecState* exec, void* debugInfoRaw) 1610 void DFG_OPERATION debugOperationPrintSpeculationFailure(ExecState* exec, void* debugInfoRaw, void* scratch) 1612 1611 { 1613 1612 JSGlobalData* globalData = &exec->globalData(); … … 1628 1627 dataLog("no alternative code block (i.e. we've been jettisoned)"); 1629 1628 dataLog(", osrExitCounter = ", codeBlock->osrExitCounter(), "\n"); 1630 } 1631 #endif 1629 dataLog(" GPRs at time of exit:"); 1630 char* scratchPointer = static_cast<char*>(scratch); 1631 for (unsigned i = 0; i < GPRInfo::numberOfRegisters; ++i) { 1632 GPRReg gpr = GPRInfo::toRegister(i); 1633 dataLog(" ", GPRInfo::debugName(gpr), ":", RawPointer(*reinterpret_cast<void**>(scratchPointer))); 1634 scratchPointer += sizeof(EncodedJSValue); 1635 } 1636 dataLog("\n"); 1637 dataLog(" FPRs at time of exit:"); 1638 for (unsigned i = 0; i < FPRInfo::numberOfRegisters; ++i) { 1639 FPRReg fpr = FPRInfo::toRegister(i); 1640 dataLog(" ", FPRInfo::debugName(fpr), ":"); 1641 uint64_t bits = *reinterpret_cast<uint64_t*>(scratchPointer); 1642 double value = *reinterpret_cast<double*>(scratchPointer); 1643 dataLogF("%llx:%lf", bits, value); 1644 scratchPointer += sizeof(EncodedJSValue); 1645 } 1646 dataLog("\n"); 1647 } 1632 1648 1633 1649 extern "C" void DFG_OPERATION triggerReoptimizationNow(CodeBlock* codeBlock) -
trunk/Source/JavaScriptCore/dfg/DFGOperations.h
r139145 r139496 260 260 size_t DFG_OPERATION dfgConvertJSValueToBoolean(ExecState*, EncodedJSValue) WTF_INTERNAL; 261 261 262 #if DFG_ENABLE(VERBOSE_SPECULATION_FAILURE) 263 void DFG_OPERATION debugOperationPrintSpeculationFailure(ExecState*, void*) WTF_INTERNAL; 264 #endif 262 void DFG_OPERATION debugOperationPrintSpeculationFailure(ExecState*, void*, void*) WTF_INTERNAL; 265 263 266 264 void DFG_OPERATION triggerReoptimizationNow(CodeBlock*) WTF_INTERNAL; -
trunk/Source/JavaScriptCore/runtime/Options.h
r138924 r139496 76 76 v(bool, showAllDFGNodes, false) \ 77 77 \ 78 v(bool, printEachOSRExit, false) \ 79 \ 78 80 v(bool, enableProfiler, false) \ 79 81 \
Note:
See TracChangeset
for help on using the changeset viewer.