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

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

Issue 540253003: [turbofan] Nodes are killed by resetting all their inputs to zero. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Nit Created 6 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 | « no previous file | src/compiler/node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/graph-reducer-unittest.cc
diff --git a/src/compiler/graph-reducer-unittest.cc b/src/compiler/graph-reducer-unittest.cc
index 9dbc9ea2ad590068716d10355c00c074224b61f5..6567203e88def1ebb64a3bd1e0ff1f4dd14b4d9f 100644
--- a/src/compiler/graph-reducer-unittest.cc
+++ b/src/compiler/graph-reducer-unittest.cc
@@ -20,7 +20,8 @@ namespace compiler {
namespace {
-SimpleOperator OP0(0, Operator::kNoWrite, 0, 0, "op0");
+SimpleOperator OP0(0, Operator::kNoWrite, 0, 1, "op0");
+SimpleOperator OP1(1, Operator::kNoProperties, 1, 1, "op1");
struct MockReducer : public Reducer {
@@ -73,6 +74,19 @@ class GraphReducerTest : public TestWithZone {
};
+TEST_F(GraphReducerTest, NodeIsDeadAfterReplace) {
+ StrictMock<MockReducer> r;
+ Node* node0 = graph()->NewNode(&OP0);
+ Node* node1 = graph()->NewNode(&OP1, node0);
+ Node* node2 = graph()->NewNode(&OP1, node0);
+ EXPECT_CALL(r, Reduce(node1)).WillOnce(Return(Reducer::Replace(node2)));
+ ReduceNode(node1, &r);
+ EXPECT_FALSE(node0->IsDead());
+ EXPECT_TRUE(node1->IsDead());
+ EXPECT_FALSE(node2->IsDead());
+}
+
+
TEST_F(GraphReducerTest, ReduceOnceForEveryReducer) {
StrictMock<MockReducer> r1, r2;
Node* node0 = graph()->NewNode(&OP0);
@@ -95,17 +109,6 @@ TEST_F(GraphReducerTest, ReduceAgainAfterChanged) {
ReduceNode(node0, &r1, &r2, &r3);
}
-
-TEST_F(GraphReducerTest, OperatorIsNullAfterReplace) {
- StrictMock<MockReducer> r;
- Node* node0 = graph()->NewNode(&OP0);
- Node* node1 = graph()->NewNode(&OP0);
- EXPECT_CALL(r, Reduce(node0)).WillOnce(Return(Reducer::Replace(node1)));
- ReduceNode(node0, &r);
- EXPECT_EQ(NULL, node0->op());
- EXPECT_EQ(&OP0, node1->op());
-}
-
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « no previous file | src/compiler/node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698