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

Side by Side Diff: test/unittests/compiler/node-properties-unittest.cc

Issue 1193833002: [turbofan] Proper dead code elimination as regular reducer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Renamed DeadControl to Dead. Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/common-operator.h" 5 #include "src/compiler/common-operator.h"
6 #include "src/compiler/node-properties.h" 6 #include "src/compiler/node-properties.h"
7 #include "test/unittests/test-utils.h" 7 #include "test/unittests/test-utils.h"
8 #include "testing/gmock/include/gmock/gmock.h" 8 #include "testing/gmock/include/gmock/gmock.h"
9 9
10 using testing::AnyOf; 10 using testing::AnyOf;
(...skipping 14 matching lines...) Expand all
25 return Node::New(zone(), 0, op, arraysize(nodes), nodes, false); 25 return Node::New(zone(), 0, op, arraysize(nodes), nodes, false);
26 } 26 }
27 Node* NewMockNode(const Operator* op, Node* n1, Node* n2) { 27 Node* NewMockNode(const Operator* op, Node* n1, Node* n2) {
28 Node* nodes[] = {n1, n2}; 28 Node* nodes[] = {n1, n2};
29 return Node::New(zone(), 0, op, arraysize(nodes), nodes, false); 29 return Node::New(zone(), 0, op, arraysize(nodes), nodes, false);
30 } 30 }
31 }; 31 };
32 32
33 namespace { 33 namespace {
34 34
35 const Operator kMockOperator(IrOpcode::kDeadControl, Operator::kNoProperties, 35 const Operator kMockOperator(IrOpcode::kDead, Operator::kNoProperties,
36 "MockOperator", 0, 0, 0, 1, 1, 2); 36 "MockOperator", 0, 0, 0, 1, 1, 2);
37 const Operator kMockCallOperator(IrOpcode::kCall, Operator::kNoProperties, 37 const Operator kMockCallOperator(IrOpcode::kCall, Operator::kNoProperties,
38 "MockCallOperator", 0, 0, 0, 0, 0, 2); 38 "MockCallOperator", 0, 0, 0, 0, 0, 2);
39 39
40 const IfExceptionHint kNoHint = IfExceptionHint::kLocallyCaught; 40 const IfExceptionHint kNoHint = IfExceptionHint::kLocallyCaught;
41 41
42 } // namespace 42 } // namespace
43 43
44 44
45 TEST_F(NodePropertiesTest, ReplaceUses) { 45 TEST_F(NodePropertiesTest, ReplaceUses) {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 Node* if_value2 = NewMockNode(common.IfValue(2), sw); 116 Node* if_value2 = NewMockNode(common.IfValue(2), sw);
117 NodeProperties::CollectControlProjections(sw, result, arraysize(result)); 117 NodeProperties::CollectControlProjections(sw, result, arraysize(result));
118 EXPECT_THAT(result[0], AnyOf(if_value1, if_value2)); 118 EXPECT_THAT(result[0], AnyOf(if_value1, if_value2));
119 EXPECT_THAT(result[1], AnyOf(if_value1, if_value2)); 119 EXPECT_THAT(result[1], AnyOf(if_value1, if_value2));
120 EXPECT_EQ(if_default, result[2]); 120 EXPECT_EQ(if_default, result[2]);
121 } 121 }
122 122
123 } // namespace compiler 123 } // namespace compiler
124 } // namespace internal 124 } // namespace internal
125 } // namespace v8 125 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/graph-trimmer-unittest.cc ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698