OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef V8_COMPILER_SCHEDULE_H_ | 5 #ifndef V8_COMPILER_SCHEDULE_H_ |
6 #define V8_COMPILER_SCHEDULE_H_ | 6 #define V8_COMPILER_SCHEDULE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "src/v8.h" | 10 #include "src/v8.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 bool IsScheduled(Node* node) { | 188 bool IsScheduled(Node* node) { |
189 int length = static_cast<int>(nodeid_to_block_.size()); | 189 int length = static_cast<int>(nodeid_to_block_.size()); |
190 if (node->id() >= length) return false; | 190 if (node->id() >= length) return false; |
191 return nodeid_to_block_[node->id()] != NULL; | 191 return nodeid_to_block_[node->id()] != NULL; |
192 } | 192 } |
193 | 193 |
194 BasicBlock* GetBlockById(int block_id) { return all_blocks_[block_id]; } | 194 BasicBlock* GetBlockById(int block_id) { return all_blocks_[block_id]; } |
195 | 195 |
196 int BasicBlockCount() const { return NodeCount(); } | 196 int BasicBlockCount() const { return NodeCount(); } |
197 int RpoBlockCount() const { return rpo_order_.size(); } | 197 int RpoBlockCount() const { return static_cast<int>(rpo_order_.size()); } |
198 | 198 |
199 typedef ContainerPointerWrapper<BasicBlockVector> BasicBlocks; | 199 typedef ContainerPointerWrapper<BasicBlockVector> BasicBlocks; |
200 | 200 |
201 // Return a list of all the blocks in the schedule, in arbitrary order. | 201 // Return a list of all the blocks in the schedule, in arbitrary order. |
202 BasicBlocks all_blocks() { return BasicBlocks(&all_blocks_); } | 202 BasicBlocks all_blocks() { return BasicBlocks(&all_blocks_); } |
203 | 203 |
204 // Check if nodes {a} and {b} are in the same block. | 204 // Check if nodes {a} and {b} are in the same block. |
205 inline bool SameBasicBlock(Node* a, Node* b) const { | 205 inline bool SameBasicBlock(Node* a, Node* b) const { |
206 BasicBlock* block = this->block(a); | 206 BasicBlock* block = this->block(a); |
207 return block != NULL && block == this->block(b); | 207 return block != NULL && block == this->block(b); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 // dominator, indexed by block | 326 // dominator, indexed by block |
327 // id. | 327 // id. |
328 }; | 328 }; |
329 | 329 |
330 OStream& operator<<(OStream& os, const Schedule& s); | 330 OStream& operator<<(OStream& os, const Schedule& s); |
331 } | 331 } |
332 } | 332 } |
333 } // namespace v8::internal::compiler | 333 } // namespace v8::internal::compiler |
334 | 334 |
335 #endif // V8_COMPILER_SCHEDULE_H_ | 335 #endif // V8_COMPILER_SCHEDULE_H_ |
OLD | NEW |