| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/checkpoint-elimination.h" | 5 #include "src/compiler/checkpoint-elimination.h" |
| 6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
| 7 #include "src/compiler/operator.h" | 7 #include "src/compiler/operator.h" |
| 8 #include "test/unittests/compiler/graph-reducer-unittest.h" | 8 #include "test/unittests/compiler/graph-reducer-unittest.h" |
| 9 #include "test/unittests/compiler/graph-unittest.h" | 9 #include "test/unittests/compiler/graph-unittest.h" |
| 10 #include "test/unittests/compiler/node-test-utils.h" | 10 #include "test/unittests/compiler/node-test-utils.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 namespace { | 35 namespace { |
| 36 | 36 |
| 37 const Operator kOpNoWrite(0, Operator::kNoWrite, "OpNoWrite", 0, 1, 0, 0, 1, 0); | 37 const Operator kOpNoWrite(0, Operator::kNoWrite, "OpNoWrite", 0, 1, 0, 0, 1, 0); |
| 38 | 38 |
| 39 } // namespace | 39 } // namespace |
| 40 | 40 |
| 41 // ----------------------------------------------------------------------------- | 41 // ----------------------------------------------------------------------------- |
| 42 // CheckPoint | 42 // Checkpoint |
| 43 | 43 |
| 44 TEST_F(CheckpointEliminationTest, CheckPointChain) { | 44 TEST_F(CheckpointEliminationTest, CheckpointChain) { |
| 45 Node* const control = graph()->start(); | 45 Node* const control = graph()->start(); |
| 46 Node* frame_state = EmptyFrameState(); | 46 Node* frame_state = EmptyFrameState(); |
| 47 Node* checkpoint1 = graph()->NewNode(common()->CheckPoint(), frame_state, | 47 Node* checkpoint1 = graph()->NewNode(common()->Checkpoint(), frame_state, |
| 48 graph()->start(), control); | 48 graph()->start(), control); |
| 49 Node* effect_link = graph()->NewNode(&kOpNoWrite, checkpoint1); | 49 Node* effect_link = graph()->NewNode(&kOpNoWrite, checkpoint1); |
| 50 Node* checkpoint2 = graph()->NewNode(common()->CheckPoint(), frame_state, | 50 Node* checkpoint2 = graph()->NewNode(common()->Checkpoint(), frame_state, |
| 51 effect_link, control); | 51 effect_link, control); |
| 52 Reduction r = Reduce(checkpoint2); | 52 Reduction r = Reduce(checkpoint2); |
| 53 ASSERT_TRUE(r.Changed()); | 53 ASSERT_TRUE(r.Changed()); |
| 54 EXPECT_EQ(effect_link, r.replacement()); | 54 EXPECT_EQ(effect_link, r.replacement()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace compiler | 57 } // namespace compiler |
| 58 } // namespace internal | 58 } // namespace internal |
| 59 } // namespace v8 | 59 } // namespace v8 |
| OLD | NEW |