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

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

Issue 1367423002: [turbofan] Move node verification methods to the Verifier class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweaks Created 5 years, 3 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
« no previous file with comments | « src/compiler/graph.cc ('k') | src/compiler/node-properties.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/graph-reducer.cc
diff --git a/src/compiler/graph-reducer.cc b/src/compiler/graph-reducer.cc
index cd4822d8a34bd98cbcfde69af64788d66e3b4378..1be0b6dec7b6ecbfe4d38a3d19f9e7329dc69fdb 100644
--- a/src/compiler/graph-reducer.cc
+++ b/src/compiler/graph-reducer.cc
@@ -9,6 +9,7 @@
#include "src/compiler/graph-reducer.h"
#include "src/compiler/node.h"
#include "src/compiler/node-properties.h"
+#include "src/compiler/verifier.h"
namespace v8 {
namespace internal {
@@ -159,22 +160,6 @@ void GraphReducer::Replace(Node* node, Node* replacement) {
}
-namespace {
-
-
-void VerifyUseReplacement(const Edge& edge, const Node* replacement) {
- // Check that the user does not misuse the replacement.
- DCHECK(!NodeProperties::IsControlEdge(edge) ||
- replacement->op()->ControlOutputCount() > 0);
- DCHECK(!NodeProperties::IsEffectEdge(edge) ||
- replacement->op()->EffectOutputCount() > 0);
- DCHECK(!NodeProperties::IsFrameStateEdge(edge) ||
- replacement->opcode() == IrOpcode::kFrameState);
-}
-
-} // namespace
-
-
void GraphReducer::Replace(Node* node, Node* replacement, NodeId max_id) {
if (node == graph()->start()) graph()->SetStart(replacement);
if (node == graph()->end()) graph()->SetEnd(replacement);
@@ -183,7 +168,7 @@ void GraphReducer::Replace(Node* node, Node* replacement, NodeId max_id) {
// {replacement} was already reduced and finish.
for (Edge edge : node->use_edges()) {
Node* const user = edge.from();
- VerifyUseReplacement(edge, replacement);
+ Verifier::VerifyEdgeInputReplacement(edge, replacement);
edge.UpdateTo(replacement);
// Don't revisit this node if it refers to itself.
if (user != node) Revisit(user);
« no previous file with comments | « src/compiler/graph.cc ('k') | src/compiler/node-properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698