Title: [139506] trunk/Source/_javascript_Core
Revision
139506
Author
fpi...@apple.com
Date
2013-01-11 15:04:35 -0800 (Fri, 11 Jan 2013)

Log Message

Add a run-time option to print bytecode at DFG compile time
https://bugs.webkit.org/show_bug.cgi?id=106704

Reviewed by Mark Hahnenberg.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseCodeBlock):
* runtime/Options.h:
(JSC):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (139505 => 139506)


--- trunk/Source/_javascript_Core/ChangeLog	2013-01-11 22:57:29 UTC (rev 139505)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-01-11 23:04:35 UTC (rev 139506)
@@ -1,5 +1,17 @@
 2013-01-11  Filip Pizlo  <fpi...@apple.com>
 
+        Add a run-time option to print bytecode at DFG compile time
+        https://bugs.webkit.org/show_bug.cgi?id=106704
+
+        Reviewed by Mark Hahnenberg.
+
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::parseCodeBlock):
+        * runtime/Options.h:
+        (JSC):
+
+2013-01-11  Filip Pizlo  <fpi...@apple.com>
+
         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
         https://bugs.webkit.org/show_bug.cgi?id=106700
 

Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (139505 => 139506)


--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2013-01-11 22:57:29 UTC (rev 139505)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2013-01-11 23:04:35 UTC (rev 139506)
@@ -31,6 +31,7 @@
 #include "ArrayConstructor.h"
 #include "CallLinkStatus.h"
 #include "CodeBlock.h"
+#include "CodeBlockWithJITType.h"
 #include "DFGArrayMode.h"
 #include "DFGCapabilities.h"
 #include "GetByIdStatus.h"
@@ -3641,15 +3642,24 @@
             *m_globalData->m_perBytecodeProfiler, m_inlineStackTop->m_profiledBlock);
     }
     
+    bool shouldDumpBytecode = Options::dumpBytecodeAtDFGTime();
 #if DFG_ENABLE(DEBUG_VERBOSE)
-    dataLog(
-        "Parsing ", *codeBlock,
-        ": captureCount = ", codeBlock->symbolTable() ? codeBlock->symbolTable()->captureCount() : 0,
-        ", needsFullScopeChain = ", codeBlock->needsFullScopeChain(),
-        ", needsActivation = ", codeBlock->ownerExecutable()->needsActivation(),
-        ", isStrictMode = ", codeBlock->ownerExecutable()->isStrictMode(), "\n");
-    codeBlock->baselineVersion()->dumpBytecode();
+    shouldDumpBytecode |= true;
 #endif
+    if (shouldDumpBytecode) {
+        dataLog("Parsing ", *codeBlock);
+        if (m_inlineStackTop->m_inlineCallFrame) {
+            dataLog(
+                " for inlining at ", CodeBlockWithJITType(m_codeBlock, JITCode::DFGJIT),
+                " ", m_inlineStackTop->m_inlineCallFrame->caller);
+        }
+        dataLog(
+            ": captureCount = ", codeBlock->symbolTable() ? codeBlock->symbolTable()->captureCount() : 0,
+            ", needsFullScopeChain = ", codeBlock->needsFullScopeChain(),
+            ", needsActivation = ", codeBlock->ownerExecutable()->needsActivation(),
+            ", isStrictMode = ", codeBlock->ownerExecutable()->isStrictMode(), "\n");
+        codeBlock->baselineVersion()->dumpBytecode();
+    }
     
     for (unsigned jumpTargetIndex = 0; jumpTargetIndex <= codeBlock->numberOfJumpTargets(); ++jumpTargetIndex) {
         // The maximum bytecode offset to go into the current basicblock is either the next jump target, or the end of the instructions.

Modified: trunk/Source/_javascript_Core/runtime/Options.h (139505 => 139506)


--- trunk/Source/_javascript_Core/runtime/Options.h	2013-01-11 22:57:29 UTC (rev 139505)
+++ trunk/Source/_javascript_Core/runtime/Options.h	2013-01-11 23:04:35 UTC (rev 139506)
@@ -74,7 +74,7 @@
     v(bool, showDisassembly, false) \
     v(bool, showDFGDisassembly, false) \
     v(bool, showAllDFGNodes, false) \
-    \
+    v(bool, dumpBytecodeAtDFGTime, false) \
     v(bool, printEachOSRExit, false) \
     \
     v(bool, enableProfiler, false) \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to