OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/access-builder.h" | 5 #include "src/compiler/access-builder.h" |
6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
7 #include "src/compiler/graph.h" | 7 #include "src/compiler/graph.h" |
8 #include "src/compiler/graph-visualizer.h" | 8 #include "src/compiler/graph-visualizer.h" |
9 #include "src/compiler/js-operator.h" | 9 #include "src/compiler/js-operator.h" |
10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 } | 1117 } |
1118 | 1118 |
1119 | 1119 |
1120 TARGET_TEST_F(SchedulerTest, Terminate) { | 1120 TARGET_TEST_F(SchedulerTest, Terminate) { |
1121 Node* start = graph()->NewNode(common()->Start(1)); | 1121 Node* start = graph()->NewNode(common()->Start(1)); |
1122 graph()->SetStart(start); | 1122 graph()->SetStart(start); |
1123 | 1123 |
1124 Node* loop = graph()->NewNode(common()->Loop(2), start, start); | 1124 Node* loop = graph()->NewNode(common()->Loop(2), start, start); |
1125 loop->ReplaceInput(1, loop); // self loop, NTL. | 1125 loop->ReplaceInput(1, loop); // self loop, NTL. |
1126 | 1126 |
1127 Node* effect = graph()->NewNode(common()->EffectPhi(1), start, loop); | 1127 Node* effect = graph()->NewNode(common()->EffectPhi(2), start, start, loop); |
| 1128 effect->ReplaceInput(1, effect); // self loop. |
1128 | 1129 |
1129 Node* terminate = graph()->NewNode(common()->Terminate(), effect, loop); | 1130 Node* terminate = graph()->NewNode(common()->Terminate(), effect, loop); |
1130 effect->ReplaceInput(1, terminate); | |
1131 | |
1132 Node* end = graph()->NewNode(common()->End(1), terminate); | 1131 Node* end = graph()->NewNode(common()->End(1), terminate); |
1133 | |
1134 graph()->SetEnd(end); | 1132 graph()->SetEnd(end); |
1135 | 1133 |
1136 Schedule* schedule = ComputeAndVerifySchedule(6); | 1134 Schedule* schedule = ComputeAndVerifySchedule(6); |
1137 BasicBlock* block = schedule->block(loop); | 1135 BasicBlock* block = schedule->block(loop); |
1138 EXPECT_EQ(block, schedule->block(effect)); | 1136 EXPECT_EQ(block, schedule->block(effect)); |
1139 EXPECT_GE(block->rpo_number(), 0); | 1137 EXPECT_GE(block->rpo_number(), 0); |
1140 } | 1138 } |
1141 | 1139 |
1142 } // namespace compiler | 1140 } // namespace compiler |
1143 } // namespace internal | 1141 } // namespace internal |
1144 } // namespace v8 | 1142 } // namespace v8 |
OLD | NEW |