OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/graph-unittest.h" | 5 #include "src/compiler/graph-unittest.h" |
6 #include "src/compiler/js-graph.h" | 6 #include "src/compiler/js-graph.h" |
7 #include "src/compiler/simplified-operator.h" | 7 #include "src/compiler/simplified-operator.h" |
8 #include "src/compiler/simplified-operator-reducer.h" | 8 #include "src/compiler/simplified-operator-reducer.h" |
9 #include "src/compiler/typer.h" | 9 #include "src/compiler/typer.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 | 160 |
161 TEST_P(SimplifiedUnaryOperatorTest, Parameter) { | 161 TEST_P(SimplifiedUnaryOperatorTest, Parameter) { |
162 const UnaryOperator& unop = GetParam(); | 162 const UnaryOperator& unop = GetParam(); |
163 Reduction reduction = Reduce( | 163 Reduction reduction = Reduce( |
164 graph()->NewNode((simplified()->*unop.constructor)(), Parameter(0))); | 164 graph()->NewNode((simplified()->*unop.constructor)(), Parameter(0))); |
165 EXPECT_FALSE(reduction.Changed()); | 165 EXPECT_FALSE(reduction.Changed()); |
166 } | 166 } |
167 | 167 |
168 | 168 |
169 INSTANTIATE_TEST_CASE_P(SimplifiedOperatorTest, SimplifiedUnaryOperatorTest, | 169 INSTANTIATE_TEST_CASE_P(SimplifiedOperatorReducerTest, |
| 170 SimplifiedUnaryOperatorTest, |
170 ::testing::ValuesIn(kUnaryOperators)); | 171 ::testing::ValuesIn(kUnaryOperators)); |
171 | 172 |
172 | 173 |
173 // ----------------------------------------------------------------------------- | 174 // ----------------------------------------------------------------------------- |
174 // BooleanNot | 175 // BooleanNot |
175 | 176 |
176 | 177 |
177 TEST_F(SimplifiedOperatorReducerTest, BooleanNotWithBooleanNot) { | 178 TEST_F(SimplifiedOperatorReducerTest, BooleanNotWithBooleanNot) { |
178 Node* param0 = Parameter(0); | 179 Node* param0 = Parameter(0); |
179 Reduction reduction = Reduce( | 180 Reduction reduction = Reduce( |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 Reduce(graph()->NewNode(simplified()->ChangeUint32ToTagged(), | 473 Reduce(graph()->NewNode(simplified()->ChangeUint32ToTagged(), |
473 Int32Constant(bit_cast<int32_t>(n)))); | 474 Int32Constant(bit_cast<int32_t>(n)))); |
474 ASSERT_TRUE(reduction.Changed()); | 475 ASSERT_TRUE(reduction.Changed()); |
475 EXPECT_THAT(reduction.replacement(), IsNumberConstant(FastUI2D(n))); | 476 EXPECT_THAT(reduction.replacement(), IsNumberConstant(FastUI2D(n))); |
476 } | 477 } |
477 } | 478 } |
478 | 479 |
479 } // namespace compiler | 480 } // namespace compiler |
480 } // namespace internal | 481 } // namespace internal |
481 } // namespace v8 | 482 } // namespace v8 |
OLD | NEW |