summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGPhase.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/dfg/DFGPhase.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGPhase.h')
-rw-r--r--Source/JavaScriptCore/dfg/DFGPhase.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGPhase.h b/Source/JavaScriptCore/dfg/DFGPhase.h
index 6de043bbd..0fcfc5fa5 100644
--- a/Source/JavaScriptCore/dfg/DFGPhase.h
+++ b/Source/JavaScriptCore/dfg/DFGPhase.h
@@ -23,10 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef DFGPhase_h
-#define DFGPhase_h
-
-#include <wtf/Platform.h>
+#pragma once
#if ENABLE(DFG_JIT)
@@ -51,6 +48,8 @@ public:
const char* name() const { return m_name; }
+ Graph& graph() { return m_graph; }
+
// Each phase must have a run() method.
protected:
@@ -60,6 +59,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 +69,25 @@ private:
// Call these hooks when starting and finishing.
void beginPhase();
void endPhase();
+
+ CString m_graphDumpBeforePhase;
};
template<typename PhaseType>
bool runAndLog(PhaseType& phase)
{
+ double before = 0;
+
+ if (UNLIKELY(Options::reportDFGPhaseTimes()))
+ before = monotonicallyIncreasingTimeMS();
+
bool result = phase.run();
- if (result && logCompilationChanges())
+
+ if (UNLIKELY(Options::reportDFGPhaseTimes())) {
+ double after = monotonicallyIncreasingTimeMS();
+ dataLogF("Phase %s took %.4f ms\n", phase.name(), after - before);
+ }
+ if (result && logCompilationChanges(phase.graph().m_plan.mode))
dataLogF("Phase %s changed the IR.\n", phase.name());
return result;
}
@@ -88,6 +102,3 @@ bool runPhase(Graph& graph)
} } // namespace JSC::DFG
#endif // ENABLE(DFG_JIT)
-
-#endif // DFGPhase_h
-