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

Unified Diff: test/unittests/compiler/value-numbering-reducer-unittest.cc

Issue 680313003: Move input/output counts directly into Operators, simplying OperatorProperties. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: yes Created 6 years, 2 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 | « test/unittests/compiler/js-operator-unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/value-numbering-reducer-unittest.cc
diff --git a/test/unittests/compiler/value-numbering-reducer-unittest.cc b/test/unittests/compiler/value-numbering-reducer-unittest.cc
index 7fa3f55ed57f7a3951f2effcfb05da1021e823cf..b6be0bff17cb26c8198c25042d903e978f9c1caf 100644
--- a/test/unittests/compiler/value-numbering-reducer-unittest.cc
+++ b/test/unittests/compiler/value-numbering-reducer-unittest.cc
@@ -12,12 +12,16 @@ namespace v8 {
namespace internal {
namespace compiler {
-namespace {
+struct TestOperator : public Operator {
+ TestOperator(Operator::Opcode opcode, Operator::Properties properties,
+ size_t value_in, size_t value_out)
+ : Operator(opcode, properties, "TestOp", value_in, 0, 0, value_out, 0,
+ 0) {}
+};
-const SimpleOperator kOp0(0, Operator::kEliminatable, 0, 1, "op0");
-const SimpleOperator kOp1(1, Operator::kEliminatable, 1, 1, "op1");
-} // namespace
+static const TestOperator kOp0(0, Operator::kEliminatable, 0, 1);
+static const TestOperator kOp1(1, Operator::kEliminatable, 1, 1);
class ValueNumberingReducerTest : public TestWithZone {
@@ -55,7 +59,7 @@ TEST_F(ValueNumberingReducerTest, DeadNodesAreNeverReturned) {
TEST_F(ValueNumberingReducerTest, OnlyEliminatableNodesAreReduced) {
- SimpleOperator op(0, Operator::kNoProperties, 0, 1, "op");
+ TestOperator op(0, Operator::kNoProperties, 0, 1);
Node* n0 = graph()->NewNode(&op);
Node* n1 = graph()->NewNode(&op);
EXPECT_FALSE(Reduce(n0).Changed());
@@ -69,20 +73,18 @@ TEST_F(ValueNumberingReducerTest, OperatorEqualityNotIdentity) {
for (size_t i = 0; i < arraysize(inputs); ++i) {
Operator::Opcode opcode = static_cast<Operator::Opcode>(
std::numeric_limits<Operator::Opcode>::max() - i);
- inputs[i] = graph()->NewNode(new (zone()) SimpleOperator(
- opcode, Operator::kEliminatable, 0, 1, "Operator"));
+ inputs[i] = graph()->NewNode(
+ new (zone()) TestOperator(opcode, Operator::kEliminatable, 0, 1));
}
TRACED_FORRANGE(size_t, input_count, 0, arraysize(inputs)) {
- const SimpleOperator op1(static_cast<Operator::Opcode>(input_count),
- Operator::kEliminatable,
- static_cast<int>(input_count), 1, "op");
+ const TestOperator op1(static_cast<Operator::Opcode>(input_count),
+ Operator::kEliminatable, input_count, 1);
Node* n1 = graph()->NewNode(&op1, static_cast<int>(input_count), inputs);
Reduction r1 = Reduce(n1);
EXPECT_FALSE(r1.Changed());
- const SimpleOperator op2(static_cast<Operator::Opcode>(input_count),
- Operator::kEliminatable,
- static_cast<int>(input_count), 1, "op");
+ const TestOperator op2(static_cast<Operator::Opcode>(input_count),
+ Operator::kEliminatable, input_count, 1);
Node* n2 = graph()->NewNode(&op2, static_cast<int>(input_count), inputs);
Reduction r2 = Reduce(n2);
EXPECT_TRUE(r2.Changed());
@@ -97,12 +99,11 @@ TEST_F(ValueNumberingReducerTest, SubsequentReductionsYieldTheSameNode) {
for (size_t i = 0; i < arraysize(inputs); ++i) {
Operator::Opcode opcode = static_cast<Operator::Opcode>(
std::numeric_limits<Operator::Opcode>::max() - i);
- inputs[i] = graph()->NewNode(new (zone()) SimpleOperator(
- opcode, Operator::kEliminatable, 0, 1, "Operator"));
+ inputs[i] = graph()->NewNode(
+ new (zone()) TestOperator(opcode, Operator::kEliminatable, 0, 1));
}
TRACED_FORRANGE(size_t, input_count, 0, arraysize(inputs)) {
- const SimpleOperator op1(1, Operator::kEliminatable,
- static_cast<int>(input_count), 1, "op1");
+ const TestOperator op1(1, Operator::kEliminatable, input_count, 1);
Node* n = graph()->NewNode(&op1, static_cast<int>(input_count), inputs);
Reduction r = Reduce(n);
EXPECT_FALSE(r.Changed());
« no previous file with comments | « test/unittests/compiler/js-operator-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698