Title: [196044] trunk/Source/_javascript_Core
Revision
196044
Author
[email protected]
Date
2016-02-02 20:53:39 -0800 (Tue, 02 Feb 2016)

Log Message

DFG, FTL, B3, and Air should all have a unique option for printing their graphs
https://bugs.webkit.org/show_bug.cgi?id=153815

Reviewed by Benjamin Poulain.

This patch adds a new printing option for each of the DFG/FTL compilation phases.

* b3/B3Common.cpp:
(JSC::B3::shouldDumpIR):
(JSC::B3::shouldDumpIRAtEachPhase):
* b3/B3Common.h:
* b3/B3Generate.cpp:
(JSC::B3::generateToAir):
* b3/B3PhaseScope.cpp:
(JSC::B3::PhaseScope::PhaseScope):
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):
* b3/air/AirPhaseScope.cpp:
(JSC::B3::Air::PhaseScope::PhaseScope):
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::run):
* dfg/DFGCommon.h:
(JSC::DFG::shouldDumpGraphAtEachPhase):
* dfg/DFGPhase.cpp:
(JSC::DFG::Phase::beginPhase):
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/Options.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (196043 => 196044)


--- trunk/Source/_javascript_Core/ChangeLog	2016-02-03 04:32:24 UTC (rev 196043)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-02-03 04:53:39 UTC (rev 196044)
@@ -1,3 +1,34 @@
+2016-02-02  Keith Miller  <[email protected]>
+
+        DFG, FTL, B3, and Air should all have a unique option for printing their graphs
+        https://bugs.webkit.org/show_bug.cgi?id=153815
+
+        Reviewed by Benjamin Poulain.
+
+        This patch adds a new printing option for each of the DFG/FTL compilation phases.
+
+        * b3/B3Common.cpp:
+        (JSC::B3::shouldDumpIR):
+        (JSC::B3::shouldDumpIRAtEachPhase):
+        * b3/B3Common.h:
+        * b3/B3Generate.cpp:
+        (JSC::B3::generateToAir):
+        * b3/B3PhaseScope.cpp:
+        (JSC::B3::PhaseScope::PhaseScope):
+        * b3/air/AirGenerate.cpp:
+        (JSC::B3::Air::prepareForGeneration):
+        * b3/air/AirPhaseScope.cpp:
+        (JSC::B3::Air::PhaseScope::PhaseScope):
+        * dfg/DFGCFAPhase.cpp:
+        (JSC::DFG::CFAPhase::run):
+        * dfg/DFGCommon.h:
+        (JSC::DFG::shouldDumpGraphAtEachPhase):
+        * dfg/DFGPhase.cpp:
+        (JSC::DFG::Phase::beginPhase):
+        * runtime/Options.cpp:
+        (JSC::recomputeDependentOptions):
+        * runtime/Options.h:
+
 2016-02-02  Caitlin Potter  <[email protected]>
 
         [JSC] make Object.getOwnPropertyDescriptors() work with non-JSObject types

Modified: trunk/Source/_javascript_Core/b3/B3Common.cpp (196043 => 196044)


--- trunk/Source/_javascript_Core/b3/B3Common.cpp	2016-02-03 04:32:24 UTC (rev 196043)
+++ trunk/Source/_javascript_Core/b3/B3Common.cpp	2016-02-03 04:53:39 UTC (rev 196044)
@@ -34,14 +34,16 @@
 
 namespace JSC { namespace B3 {
 
-bool shouldDumpIR()
+bool shouldDumpIR(B3ComplitationMode mode)
 {
-    return FTL::verboseCompilationEnabled() || FTL::shouldDumpDisassembly() || shouldDumpIRAtEachPhase();
+    return FTL::verboseCompilationEnabled() || FTL::shouldDumpDisassembly() || shouldDumpIRAtEachPhase(mode);
 }
 
-bool shouldDumpIRAtEachPhase()
+bool shouldDumpIRAtEachPhase(B3ComplitationMode mode)
 {
-    return Options::dumpGraphAtEachPhase();
+    if (mode == B3Mode)
+        return Options::dumpGraphAtEachPhase() || Options::dumpB3GraphAtEachPhase();
+    return Options::dumpGraphAtEachPhase() || Options::dumpAirGraphAtEachPhase();
 }
 
 bool shouldValidateIR()

Modified: trunk/Source/_javascript_Core/b3/B3Common.h (196043 => 196044)


--- trunk/Source/_javascript_Core/b3/B3Common.h	2016-02-03 04:32:24 UTC (rev 196043)
+++ trunk/Source/_javascript_Core/b3/B3Common.h	2016-02-03 04:53:39 UTC (rev 196044)
@@ -33,8 +33,13 @@
 inline bool is64Bit() { return sizeof(void*) == 8; }
 inline bool is32Bit() { return !is64Bit(); }
 
-bool shouldDumpIR();
-bool shouldDumpIRAtEachPhase();
+enum B3ComplitationMode {
+    B3Mode,
+    AirMode
+};
+
+bool shouldDumpIR(B3ComplitationMode);
+bool shouldDumpIRAtEachPhase(B3ComplitationMode);
 bool shouldValidateIR();
 bool shouldValidateIRAtEachPhase();
 bool shouldSaveIRBeforePhase();

Modified: trunk/Source/_javascript_Core/b3/B3Generate.cpp (196043 => 196044)


--- trunk/Source/_javascript_Core/b3/B3Generate.cpp	2016-02-03 04:32:24 UTC (rev 196043)
+++ trunk/Source/_javascript_Core/b3/B3Generate.cpp	2016-02-03 04:53:39 UTC (rev 196044)
@@ -67,7 +67,7 @@
 {
     TimingScope timingScope("generateToAir");
     
-    if (shouldDumpIR() && !shouldDumpIRAtEachPhase()) {
+    if (shouldDumpIR(B3Mode) && !shouldDumpIRAtEachPhase(B3Mode)) {
         dataLog("Initial B3:\n");
         dataLog(procedure);
     }
@@ -108,7 +108,7 @@
     
     // If we're doing super verbose dumping, the phase scope of any phase will already do a dump.
     // Note that lowerToAir() acts like a phase in this regard.
-    if (shouldDumpIR() && !shouldDumpIRAtEachPhase()) {
+    if (shouldDumpIR(B3Mode) && !shouldDumpIRAtEachPhase(B3Mode)) {
         dataLog("B3 after ", procedure.lastPhaseName(), ", before generation:\n");
         dataLog(procedure);
     }

Modified: trunk/Source/_javascript_Core/b3/B3PhaseScope.cpp (196043 => 196044)


--- trunk/Source/_javascript_Core/b3/B3PhaseScope.cpp	2016-02-03 04:32:24 UTC (rev 196043)
+++ trunk/Source/_javascript_Core/b3/B3PhaseScope.cpp	2016-02-03 04:53:39 UTC (rev 196044)
@@ -41,7 +41,7 @@
     , m_name(name)
     , m_timingScope(name)
 {
-    if (shouldDumpIRAtEachPhase()) {
+    if (shouldDumpIRAtEachPhase(B3Mode)) {
         dataLog("B3 after ", procedure.lastPhaseName(), ", before ", name, ":\n");
         dataLog(procedure);
     }

Modified: trunk/Source/_javascript_Core/b3/air/AirGenerate.cpp (196043 => 196044)


--- trunk/Source/_javascript_Core/b3/air/AirGenerate.cpp	2016-02-03 04:32:24 UTC (rev 196043)
+++ trunk/Source/_javascript_Core/b3/air/AirGenerate.cpp	2016-02-03 04:53:39 UTC (rev 196044)
@@ -65,7 +65,7 @@
         validate(code);
 
     // If we're doing super verbose dumping, the phase scope of any phase will already do a dump.
-    if (shouldDumpIR() && !shouldDumpIRAtEachPhase()) {
+    if (shouldDumpIR(AirMode) && !shouldDumpIRAtEachPhase(AirMode)) {
         dataLog("Initial air:\n");
         dataLog(code);
     }
@@ -130,7 +130,7 @@
 
     // Do a final dump of Air. Note that we have to do this even if we are doing per-phase dumping,
     // since the final generation is not a phase.
-    if (shouldDumpIR()) {
+    if (shouldDumpIR(AirMode)) {
         dataLog("Air after ", code.lastPhaseName(), ", before generation:\n");
         dataLog(code);
     }

Modified: trunk/Source/_javascript_Core/b3/air/AirPhaseScope.cpp (196043 => 196044)


--- trunk/Source/_javascript_Core/b3/air/AirPhaseScope.cpp	2016-02-03 04:32:24 UTC (rev 196043)
+++ trunk/Source/_javascript_Core/b3/air/AirPhaseScope.cpp	2016-02-03 04:53:39 UTC (rev 196044)
@@ -39,7 +39,7 @@
     , m_name(name)
     , m_timingScope(name)
 {
-    if (shouldDumpIRAtEachPhase()) {
+    if (shouldDumpIRAtEachPhase(AirMode)) {
         dataLog("Air after ", code.lastPhaseName(), ", before ", name, ":\n");
         dataLog(code);
     }

Modified: trunk/Source/_javascript_Core/dfg/DFGCFAPhase.cpp (196043 => 196044)


--- trunk/Source/_javascript_Core/dfg/DFGCFAPhase.cpp	2016-02-03 04:32:24 UTC (rev 196043)
+++ trunk/Source/_javascript_Core/dfg/DFGCFAPhase.cpp	2016-02-03 04:53:39 UTC (rev 196044)
@@ -56,7 +56,7 @@
         
         m_count = 0;
         
-        if (m_verbose && !shouldDumpGraphAtEachPhase()) {
+        if (m_verbose && !shouldDumpGraphAtEachPhase(m_graph.m_plan.mode)) {
             dataLog("Graph before CFA:\n");
             m_graph.dump();
         }

Modified: trunk/Source/_javascript_Core/dfg/DFGCommon.h (196043 => 196044)


--- trunk/Source/_javascript_Core/dfg/DFGCommon.h	2016-02-03 04:32:24 UTC (rev 196043)
+++ trunk/Source/_javascript_Core/dfg/DFGCommon.h	2016-02-03 04:53:39 UTC (rev 196044)
@@ -82,9 +82,11 @@
     return verboseCompilationEnabled(mode) || Options::logCompilationChanges();
 }
 
-inline bool shouldDumpGraphAtEachPhase()
+inline bool shouldDumpGraphAtEachPhase(CompilationMode mode)
 {
-    return Options::dumpGraphAtEachPhase();
+    if (isFTL(mode))
+        return Options::dumpGraphAtEachPhase() || Options::dumpDFGFTLGraphAtEachPhase();
+    return Options::dumpGraphAtEachPhase() || Options::dumpDFGGraphAtEachPhase();
 }
 
 inline bool validationEnabled()

Modified: trunk/Source/_javascript_Core/dfg/DFGPhase.cpp (196043 => 196044)


--- trunk/Source/_javascript_Core/dfg/DFGPhase.cpp	2016-02-03 04:32:24 UTC (rev 196043)
+++ trunk/Source/_javascript_Core/dfg/DFGPhase.cpp	2016-02-03 04:53:39 UTC (rev 196044)
@@ -46,7 +46,7 @@
         m_graphDumpBeforePhase = out.toCString();
     }
     
-    if (!shouldDumpGraphAtEachPhase())
+    if (!shouldDumpGraphAtEachPhase(m_graph.m_plan.mode))
         return;
     
     dataLog("Beginning DFG phase ", m_name, ".\n");

Modified: trunk/Source/_javascript_Core/runtime/Options.cpp (196043 => 196044)


--- trunk/Source/_javascript_Core/runtime/Options.cpp	2016-02-03 04:32:24 UTC (rev 196043)
+++ trunk/Source/_javascript_Core/runtime/Options.cpp	2016-02-03 04:53:39 UTC (rev 196044)
@@ -304,6 +304,10 @@
         || Options::dumpFTLDisassembly()
         || Options::dumpBytecodeAtDFGTime()
         || Options::dumpGraphAtEachPhase()
+        || Options::dumpDFGGraphAtEachPhase()
+        || Options::dumpDFGFTLGraphAtEachPhase()
+        || Options::dumpB3GraphAtEachPhase()
+        || Options::dumpAirGraphAtEachPhase()
         || Options::verboseCompilation()
         || Options::verboseFTLCompilation()
         || Options::logCompilationChanges()

Modified: trunk/Source/_javascript_Core/runtime/Options.h (196043 => 196044)


--- trunk/Source/_javascript_Core/runtime/Options.h	2016-02-03 04:32:24 UTC (rev 196043)
+++ trunk/Source/_javascript_Core/runtime/Options.h	2016-02-03 04:53:39 UTC (rev 196044)
@@ -147,6 +147,10 @@
     v(bool, dumpBytecodeAtDFGTime, false, "dumps bytecode of JS function being DFG compiled") \
     v(bool, dumpGraphAfterParsing, false, nullptr) \
     v(bool, dumpGraphAtEachPhase, false, nullptr) \
+    v(bool, dumpDFGGraphAtEachPhase, false, "dumps the DFG graph at each phase DFG of complitaion (note this excludes DFG graphs during FTL compilation)") \
+    v(bool, dumpDFGFTLGraphAtEachPhase, false, "dumps the DFG graph at each phase DFG of complitaion when compiling FTL code") \
+    v(bool, dumpB3GraphAtEachPhase, false, "dumps the B3 graph at each phase of compilation") \
+    v(bool, dumpAirGraphAtEachPhase, false, "dumps the Air graph at each phase of compilation") \
     v(bool, verboseDFGByteCodeParsing, false, nullptr) \
     v(bool, verboseCompilation, false, nullptr) \
     v(bool, verboseFTLCompilation, false, nullptr) \
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to