| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
| 8 #include "src/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
| 9 #include "src/compiler/graph.h" | 9 #include "src/compiler/graph.h" |
| 10 #include "src/compiler/graph-visualizer.h" | 10 #include "src/compiler/graph-visualizer.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 static void CheckRPONumbers(BasicBlockVector* order, size_t expected, | 28 static void CheckRPONumbers(BasicBlockVector* order, size_t expected, |
| 29 bool loops_allowed) { | 29 bool loops_allowed) { |
| 30 CHECK(expected == order->size()); | 30 CHECK(expected == order->size()); |
| 31 for (int i = 0; i < static_cast<int>(order->size()); i++) { | 31 for (int i = 0; i < static_cast<int>(order->size()); i++) { |
| 32 CHECK(order->at(i)->rpo_number() == i); | 32 CHECK(order->at(i)->rpo_number() == i); |
| 33 if (!loops_allowed) { | 33 if (!loops_allowed) { |
| 34 CHECK_EQ(NULL, order->at(i)->loop_end()); | 34 CHECK_EQ(NULL, order->at(i)->loop_end()); |
| 35 CHECK_EQ(NULL, order->at(i)->loop_header()); | 35 CHECK_EQ(NULL, order->at(i)->loop_header()); |
| 36 } | 36 } |
| 37 } | 37 } |
| 38 int number = 0; | |
| 39 for (auto const block : *order) { | |
| 40 if (block->deferred()) continue; | |
| 41 CHECK_EQ(number, block->ao_number()); | |
| 42 ++number; | |
| 43 } | |
| 44 for (auto const block : *order) { | |
| 45 if (!block->deferred()) continue; | |
| 46 CHECK_EQ(number, block->ao_number()); | |
| 47 ++number; | |
| 48 } | |
| 49 } | 38 } |
| 50 | 39 |
| 51 | 40 |
| 52 static void CheckLoop(BasicBlockVector* order, BasicBlock** blocks, | 41 static void CheckLoop(BasicBlockVector* order, BasicBlock** blocks, |
| 53 int body_size) { | 42 int body_size) { |
| 54 BasicBlock* header = blocks[0]; | 43 BasicBlock* header = blocks[0]; |
| 55 BasicBlock* end = header->loop_end(); | 44 BasicBlock* end = header->loop_end(); |
| 56 CHECK_NE(NULL, end); | 45 CHECK_NE(NULL, end); |
| 57 CHECK_GT(end->rpo_number(), 0); | 46 CHECK_GT(end->rpo_number(), 0); |
| 58 CHECK_EQ(body_size, end->rpo_number() - header->rpo_number()); | 47 CHECK_EQ(body_size, end->rpo_number() - header->rpo_number()); |
| (...skipping 2067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2126 graph.SetEnd(end); | 2115 graph.SetEnd(end); |
| 2127 | 2116 |
| 2128 Schedule* schedule = ComputeAndVerifySchedule(6, &graph); | 2117 Schedule* schedule = ComputeAndVerifySchedule(6, &graph); |
| 2129 BasicBlock* block = schedule->block(loop); | 2118 BasicBlock* block = schedule->block(loop); |
| 2130 CHECK_NE(NULL, loop); | 2119 CHECK_NE(NULL, loop); |
| 2131 CHECK_EQ(block, schedule->block(effect)); | 2120 CHECK_EQ(block, schedule->block(effect)); |
| 2132 CHECK_GE(block->rpo_number(), 0); | 2121 CHECK_GE(block->rpo_number(), 0); |
| 2133 } | 2122 } |
| 2134 | 2123 |
| 2135 #endif | 2124 #endif |
| OLD | NEW |