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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 public: | 69 public: |
70 SchedulerRPOTest() {} | 70 SchedulerRPOTest() {} |
71 | 71 |
72 // TODO(titzer): pull RPO tests out to their own file. | 72 // TODO(titzer): pull RPO tests out to their own file. |
73 static void CheckRPONumbers(BasicBlockVector* order, size_t expected, | 73 static void CheckRPONumbers(BasicBlockVector* order, size_t expected, |
74 bool loops_allowed) { | 74 bool loops_allowed) { |
75 CHECK(expected == order->size()); | 75 CHECK(expected == order->size()); |
76 for (int i = 0; i < static_cast<int>(order->size()); i++) { | 76 for (int i = 0; i < static_cast<int>(order->size()); i++) { |
77 CHECK(order->at(i)->rpo_number() == i); | 77 CHECK(order->at(i)->rpo_number() == i); |
78 if (!loops_allowed) { | 78 if (!loops_allowed) { |
79 CHECK_EQ(NULL, order->at(i)->loop_end()); | 79 CHECK(!order->at(i)->loop_end()); |
80 CHECK_EQ(NULL, order->at(i)->loop_header()); | 80 CHECK(!order->at(i)->loop_header()); |
81 } | 81 } |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 static void CheckLoop(BasicBlockVector* order, BasicBlock** blocks, | 85 static void CheckLoop(BasicBlockVector* order, BasicBlock** blocks, |
86 int body_size) { | 86 int body_size) { |
87 BasicBlock* header = blocks[0]; | 87 BasicBlock* header = blocks[0]; |
88 BasicBlock* end = header->loop_end(); | 88 BasicBlock* end = header->loop_end(); |
89 CHECK_NE(NULL, end); | 89 CHECK(end); |
90 CHECK_GT(end->rpo_number(), 0); | 90 CHECK_GT(end->rpo_number(), 0); |
91 CHECK_EQ(body_size, end->rpo_number() - header->rpo_number()); | 91 CHECK_EQ(body_size, end->rpo_number() - header->rpo_number()); |
92 for (int i = 0; i < body_size; i++) { | 92 for (int i = 0; i < body_size; i++) { |
93 CHECK_GE(blocks[i]->rpo_number(), header->rpo_number()); | 93 CHECK_GE(blocks[i]->rpo_number(), header->rpo_number()); |
94 CHECK_LT(blocks[i]->rpo_number(), end->rpo_number()); | 94 CHECK_LT(blocks[i]->rpo_number(), end->rpo_number()); |
95 CHECK(header->LoopContains(blocks[i])); | 95 CHECK(header->LoopContains(blocks[i])); |
96 CHECK(header->IsLoopHeader() || blocks[i]->loop_header() == header); | 96 CHECK(header->IsLoopHeader() || blocks[i]->loop_header() == header); |
97 } | 97 } |
98 if (header->rpo_number() > 0) { | 98 if (header->rpo_number() > 0) { |
99 CHECK_NE(order->at(header->rpo_number() - 1)->loop_header(), header); | 99 CHECK_NE(order->at(header->rpo_number() - 1)->loop_header(), header); |
(...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1962 | 1962 |
1963 Schedule* schedule = ComputeAndVerifySchedule(13, graph()); | 1963 Schedule* schedule = ComputeAndVerifySchedule(13, graph()); |
1964 // Make sure the true block is marked as deferred. | 1964 // Make sure the true block is marked as deferred. |
1965 CHECK(schedule->block(t)->deferred()); | 1965 CHECK(schedule->block(t)->deferred()); |
1966 CHECK(!schedule->block(f)->deferred()); | 1966 CHECK(!schedule->block(f)->deferred()); |
1967 } | 1967 } |
1968 | 1968 |
1969 } // namespace compiler | 1969 } // namespace compiler |
1970 } // namespace internal | 1970 } // namespace internal |
1971 } // namespace v8 | 1971 } // namespace v8 |
OLD | NEW |