summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGPhase.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGPhase.h')
-rw-r--r--Source/JavaScriptCore/dfg/DFGPhase.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGPhase.h b/Source/JavaScriptCore/dfg/DFGPhase.h
index 6de043bbd..e92049c43 100644
--- a/Source/JavaScriptCore/dfg/DFGPhase.h
+++ b/Source/JavaScriptCore/dfg/DFGPhase.h
@@ -26,8 +26,6 @@
#ifndef DFGPhase_h
#define DFGPhase_h
-#include <wtf/Platform.h>
-
#if ENABLE(DFG_JIT)
#include "DFGCommon.h"
@@ -51,6 +49,8 @@ public:
const char* name() const { return m_name; }
+ Graph& graph() { return m_graph; }
+
// Each phase must have a run() method.
protected:
@@ -60,6 +60,9 @@ protected:
VM& vm() { return m_graph.m_vm; }
CodeBlock* codeBlock() { return m_graph.m_codeBlock; }
CodeBlock* profiledBlock() { return m_graph.m_profiledBlock; }
+
+ // This runs validation, and uses the graph dump before the phase if possible.
+ void validate();
const char* m_name;
@@ -67,13 +70,15 @@ private:
// Call these hooks when starting and finishing.
void beginPhase();
void endPhase();
+
+ CString m_graphDumpBeforePhase;
};
template<typename PhaseType>
bool runAndLog(PhaseType& phase)
{
bool result = phase.run();
- if (result && logCompilationChanges())
+ if (result && logCompilationChanges(phase.graph().m_plan.mode))
dataLogF("Phase %s changed the IR.\n", phase.name());
return result;
}