| 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/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
| 6 #include "src/compiler/graph.h" | 6 #include "src/compiler/graph.h" |
| 7 #include "src/compiler/node.h" | 7 #include "src/compiler/node.h" |
| 8 #include "src/compiler/operator.h" | 8 #include "src/compiler/operator.h" |
| 9 #include "test/unittests/compiler/graph-reducer-unittest.h" | 9 #include "test/unittests/compiler/graph-reducer-unittest.h" |
| 10 #include "test/unittests/test-utils.h" | 10 #include "test/unittests/test-utils.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 268 |
| 269 | 269 |
| 270 namespace { | 270 namespace { |
| 271 | 271 |
| 272 struct ReplaceWithValueReducer final : public AdvancedReducer { | 272 struct ReplaceWithValueReducer final : public AdvancedReducer { |
| 273 explicit ReplaceWithValueReducer(Editor* editor) : AdvancedReducer(editor) {} | 273 explicit ReplaceWithValueReducer(Editor* editor) : AdvancedReducer(editor) {} |
| 274 Reduction Reduce(Node* node) final { return NoChange(); } | 274 Reduction Reduce(Node* node) final { return NoChange(); } |
| 275 using AdvancedReducer::ReplaceWithValue; | 275 using AdvancedReducer::ReplaceWithValue; |
| 276 }; | 276 }; |
| 277 | 277 |
| 278 const Operator kMockOperator(IrOpcode::kDeadControl, Operator::kNoProperties, | 278 const Operator kMockOperator(IrOpcode::kDead, Operator::kNoProperties, |
| 279 "MockOperator", 0, 0, 0, 1, 0, 0); | 279 "MockOperator", 0, 0, 0, 1, 0, 0); |
| 280 const Operator kMockOpEffect(IrOpcode::kDeadControl, Operator::kNoProperties, | 280 const Operator kMockOpEffect(IrOpcode::kDead, Operator::kNoProperties, |
| 281 "MockOpEffect", 0, 1, 0, 1, 1, 0); | 281 "MockOpEffect", 0, 1, 0, 1, 1, 0); |
| 282 const Operator kMockOpControl(IrOpcode::kDeadControl, Operator::kNoProperties, | 282 const Operator kMockOpControl(IrOpcode::kDead, Operator::kNoProperties, |
| 283 "MockOpControl", 0, 0, 1, 1, 0, 1); | 283 "MockOpControl", 0, 0, 1, 1, 0, 1); |
| 284 | 284 |
| 285 const IfExceptionHint kNoHint = IfExceptionHint::kLocallyCaught; | 285 const IfExceptionHint kNoHint = IfExceptionHint::kLocallyCaught; |
| 286 | 286 |
| 287 } // namespace | 287 } // namespace |
| 288 | 288 |
| 289 | 289 |
| 290 TEST_F(AdvancedReducerTest, ReplaceWithValue_ValueUse) { | 290 TEST_F(AdvancedReducerTest, ReplaceWithValue_ValueUse) { |
| 291 CommonOperatorBuilder common(zone()); | 291 CommonOperatorBuilder common(zone()); |
| 292 Node* node = graph()->NewNode(&kMockOperator); | 292 Node* node = graph()->NewNode(&kMockOperator); |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 EXPECT_EQ(&kOpC0, n1->op()); | 850 EXPECT_EQ(&kOpC0, n1->op()); |
| 851 EXPECT_EQ(&kOpC1, end->op()); | 851 EXPECT_EQ(&kOpC1, end->op()); |
| 852 EXPECT_EQ(n1, end->InputAt(0)); | 852 EXPECT_EQ(n1, end->InputAt(0)); |
| 853 } | 853 } |
| 854 } | 854 } |
| 855 } | 855 } |
| 856 | 856 |
| 857 } // namespace compiler | 857 } // namespace compiler |
| 858 } // namespace internal | 858 } // namespace internal |
| 859 } // namespace v8 | 859 } // namespace v8 |
| OLD | NEW |