Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Unified Diff: src/compiler/graph-replay.cc

Issue 879583002: [turbofan] Remove GenericAlgorithm from verifier and graph replay. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/graph-replay.cc
diff --git a/src/compiler/graph-replay.cc b/src/compiler/graph-replay.cc
index 3a0b7836fcba8a2c33929f86761ab7ca01891e36..06771ff8244d4cb21c64ce3469f0653fea1405a6 100644
--- a/src/compiler/graph-replay.cc
+++ b/src/compiler/graph-replay.cc
@@ -4,9 +4,9 @@
#include "src/compiler/graph-replay.h"
+#include "src/compiler/all-nodes.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/graph.h"
-#include "src/compiler/graph-inl.h"
#include "src/compiler/node.h"
#include "src/compiler/operator.h"
#include "src/compiler/operator-properties.h"
@@ -20,22 +20,26 @@ namespace compiler {
void GraphReplayPrinter::PrintReplay(Graph* graph) {
GraphReplayPrinter replay;
PrintF(" Node* nil = graph.NewNode(common_builder.Dead());\n");
- graph->VisitNodeInputsFromEnd(&replay);
-}
-
+ Zone zone;
+ AllNodes nodes(&zone, graph);
-void GraphReplayPrinter::Pre(Node* node) {
- PrintReplayOpCreator(node->op());
- PrintF(" Node* n%d = graph.NewNode(op", node->id());
- for (int i = 0; i < node->InputCount(); ++i) {
- PrintF(", nil");
+ // Allocate the nodes first.
+ for (Node* node : nodes.live) {
+ PrintReplayOpCreator(node->op());
+ PrintF(" Node* n%d = graph.NewNode(op", node->id());
+ for (int i = 0; i < node->InputCount(); ++i) {
+ PrintF(", nil");
+ }
+ PrintF("); USE(n%d);\n", node->id());
}
- PrintF("); USE(n%d);\n", node->id());
-}
-
-void GraphReplayPrinter::PostEdge(Node* from, int index, Node* to) {
- PrintF(" n%d->ReplaceInput(%d, n%d);\n", from->id(), index, to->id());
+ // Connect the nodes to their inputs.
+ for (Node* node : nodes.live) {
+ for (int i = 0; i < node->InputCount(); i++) {
+ PrintF(" n%d->ReplaceInput(%d, n%d);\n", node->id(), i,
+ node->InputAt(i)->id());
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698