1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef V8_COMPILER_GRAPH_REPLAY_H_
6 #define V8_COMPILER_GRAPH_REPLAY_H_
10 #include "src/compiler/node.h"
19 // Helper class to print a full replay of a graph. This replay can be used to
20 // materialize the same graph within a C++ unit test and hence test subsequent
21 // optimization passes on a graph without going through the construction steps.
22 class GraphReplayPrinter : public NullNodeVisitor {
25 static void PrintReplay(Graph* graph);
27 static void PrintReplay(Graph* graph) {}
30 GenericGraphVisit::Control Pre(Node* node);
31 void PostEdge(Node* from, int index, Node* to);
34 GraphReplayPrinter() {}
36 static void PrintReplayOpCreator(Operator* op);
38 DISALLOW_COPY_AND_ASSIGN(GraphReplayPrinter);
42 } // namespace v8::internal::compiler
44 #endif // V8_COMPILER_GRAPH_REPLAY_H_