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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 | 650 |
651 | 651 |
652 TEST_F(SchedulerTest, BuildScheduleIfSplit) { | 652 TEST_F(SchedulerTest, BuildScheduleIfSplit) { |
653 graph()->SetStart(graph()->NewNode(common()->Start(5))); | 653 graph()->SetStart(graph()->NewNode(common()->Start(5))); |
654 | 654 |
655 Node* p1 = graph()->NewNode(common()->Parameter(0), graph()->start()); | 655 Node* p1 = graph()->NewNode(common()->Parameter(0), graph()->start()); |
656 Node* p2 = graph()->NewNode(common()->Parameter(1), graph()->start()); | 656 Node* p2 = graph()->NewNode(common()->Parameter(1), graph()->start()); |
657 Node* p3 = graph()->NewNode(common()->Parameter(2), graph()->start()); | 657 Node* p3 = graph()->NewNode(common()->Parameter(2), graph()->start()); |
658 Node* p4 = graph()->NewNode(common()->Parameter(3), graph()->start()); | 658 Node* p4 = graph()->NewNode(common()->Parameter(3), graph()->start()); |
659 Node* p5 = graph()->NewNode(common()->Parameter(4), graph()->start()); | 659 Node* p5 = graph()->NewNode(common()->Parameter(4), graph()->start()); |
660 Node* cmp = | 660 Node* cmp = graph()->NewNode(js()->LessThanOrEqual(Strength::NORMAL), p1, p2, |
661 graph()->NewNode(js()->LessThanOrEqual(LanguageMode::SLOPPY), p1, p2, p3, | 661 p3, p4, p5, graph()->start(), graph()->start()); |
662 p4, p5, graph()->start(), graph()->start()); | |
663 Node* branch = graph()->NewNode(common()->Branch(), cmp, graph()->start()); | 662 Node* branch = graph()->NewNode(common()->Branch(), cmp, graph()->start()); |
664 Node* true_branch = graph()->NewNode(common()->IfTrue(), branch); | 663 Node* true_branch = graph()->NewNode(common()->IfTrue(), branch); |
665 Node* false_branch = graph()->NewNode(common()->IfFalse(), branch); | 664 Node* false_branch = graph()->NewNode(common()->IfFalse(), branch); |
666 | 665 |
667 Node* ret1 = | 666 Node* ret1 = |
668 graph()->NewNode(common()->Return(), p4, graph()->start(), true_branch); | 667 graph()->NewNode(common()->Return(), p4, graph()->start(), true_branch); |
669 Node* ret2 = | 668 Node* ret2 = |
670 graph()->NewNode(common()->Return(), p5, graph()->start(), false_branch); | 669 graph()->NewNode(common()->Return(), p5, graph()->start(), false_branch); |
671 graph()->SetEnd(graph()->NewNode(common()->End(2), ret1, ret2)); | 670 graph()->SetEnd(graph()->NewNode(common()->End(2), ret1, ret2)); |
672 | 671 |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1160 | 1159 |
1161 Schedule* schedule = ComputeAndVerifySchedule(6); | 1160 Schedule* schedule = ComputeAndVerifySchedule(6); |
1162 BasicBlock* block = schedule->block(loop); | 1161 BasicBlock* block = schedule->block(loop); |
1163 EXPECT_EQ(block, schedule->block(effect)); | 1162 EXPECT_EQ(block, schedule->block(effect)); |
1164 EXPECT_GE(block->rpo_number(), 0); | 1163 EXPECT_GE(block->rpo_number(), 0); |
1165 } | 1164 } |
1166 | 1165 |
1167 } // namespace compiler | 1166 } // namespace compiler |
1168 } // namespace internal | 1167 } // namespace internal |
1169 } // namespace v8 | 1168 } // namespace v8 |
OLD | NEW |