| Index: test/cctest/compiler/test-js-typed-lowering.cc
|
| diff --git a/test/cctest/compiler/test-js-typed-lowering.cc b/test/cctest/compiler/test-js-typed-lowering.cc
|
| index ee69e1743b946e6dbf501eb5f6bb2f8695810d51..1a0551442c1e4d98ae38e5f39cfad23701e471c2 100644
|
| --- a/test/cctest/compiler/test-js-typed-lowering.cc
|
| +++ b/test/cctest/compiler/test-js-typed-lowering.cc
|
| @@ -1231,11 +1231,7 @@ TEST(Int32AddNarrowing) {
|
| Node* r = R.reduce(or_node);
|
|
|
| CHECK_EQ(R.ops[o + 1]->opcode(), r->op()->opcode());
|
| - CHECK_EQ(IrOpcode::kInt32Add, add_node->opcode());
|
| - bool is_signed = l ? R.signedness[o] : R.signedness[o + 1];
|
| -
|
| - Type* add_type = NodeProperties::GetBounds(add_node).upper;
|
| - CHECK(add_type->Is(I32Type(is_signed)));
|
| + CHECK_EQ(IrOpcode::kNumberAdd, add_node->opcode());
|
| }
|
| }
|
| }
|
| @@ -1258,40 +1254,33 @@ TEST(Int32AddNarrowing) {
|
| Node* r = R.reduce(or_node);
|
|
|
| CHECK_EQ(R.ops[o + 1]->opcode(), r->op()->opcode());
|
| - CHECK_EQ(IrOpcode::kInt32Add, add_node->opcode());
|
| - bool is_signed = l ? R.signedness[o] : R.signedness[o + 1];
|
| -
|
| - Type* add_type = NodeProperties::GetBounds(add_node).upper;
|
| - CHECK(add_type->Is(I32Type(is_signed)));
|
| + CHECK_EQ(IrOpcode::kNumberAdd, add_node->opcode());
|
| }
|
| }
|
| }
|
| }
|
| }
|
| -}
|
| -
|
| -
|
| -TEST(Int32AddNarrowingNotOwned) {
|
| - JSBitwiseTypedLoweringTester R;
|
| + {
|
| + JSBitwiseTypedLoweringTester R;
|
|
|
| - for (int o = 0; o < R.kNumberOps; o += 2) {
|
| - Node* n0 = R.Parameter(I32Type(R.signedness[o]));
|
| - Node* n1 = R.Parameter(I32Type(R.signedness[o + 1]));
|
| - Node* one = R.graph.NewNode(R.common.NumberConstant(1));
|
| -
|
| - Node* add_node = R.Binop(R.simplified.NumberAdd(), n0, n1);
|
| - Node* or_node = R.Binop(R.ops[o], add_node, one);
|
| - Node* other_use = R.Binop(R.simplified.NumberAdd(), add_node, one);
|
| - Node* r = R.reduce(or_node);
|
| - CHECK_EQ(R.ops[o + 1]->opcode(), r->op()->opcode());
|
| - // Should not be reduced to Int32Add because of the other number add.
|
| - CHECK_EQ(IrOpcode::kNumberAdd, add_node->opcode());
|
| - // Conversion to int32 should be done.
|
| - CheckToI32(add_node, r->InputAt(0), R.signedness[o]);
|
| - CheckToI32(one, r->InputAt(1), R.signedness[o + 1]);
|
| - // The other use should also not be touched.
|
| - CHECK_EQ(add_node, other_use->InputAt(0));
|
| - CHECK_EQ(one, other_use->InputAt(1));
|
| + for (int o = 0; o < R.kNumberOps; o += 2) {
|
| + Node* n0 = R.Parameter(I32Type(R.signedness[o]));
|
| + Node* n1 = R.Parameter(I32Type(R.signedness[o + 1]));
|
| + Node* one = R.graph.NewNode(R.common.NumberConstant(1));
|
| +
|
| + Node* add_node = R.Binop(R.simplified.NumberAdd(), n0, n1);
|
| + Node* or_node = R.Binop(R.ops[o], add_node, one);
|
| + Node* other_use = R.Binop(R.simplified.NumberAdd(), add_node, one);
|
| + Node* r = R.reduce(or_node);
|
| + CHECK_EQ(R.ops[o + 1]->opcode(), r->op()->opcode());
|
| + CHECK_EQ(IrOpcode::kNumberAdd, add_node->opcode());
|
| + // Conversion to int32 should be done.
|
| + CheckToI32(add_node, r->InputAt(0), R.signedness[o]);
|
| + CheckToI32(one, r->InputAt(1), R.signedness[o + 1]);
|
| + // The other use should also not be touched.
|
| + CHECK_EQ(add_node, other_use->InputAt(0));
|
| + CHECK_EQ(one, other_use->InputAt(1));
|
| + }
|
| }
|
| }
|
|
|
|
|