Chromium Code Reviews| 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 #include "src/compiler/schedule.h" | 5 #include "src/compiler/schedule.h" |
| 6 | 6 |
| 7 #include "src/compiler/node.h" | 7 #include "src/compiler/node.h" |
| 8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
| 9 #include "src/ostreams.h" | 9 #include "src/ostreams.h" |
| 10 | 10 |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 329 nodeid_to_block_.resize(node->id() + 1); | 329 nodeid_to_block_.resize(node->id() + 1); |
| 330 } | 330 } |
| 331 nodeid_to_block_[node->id()] = block; | 331 nodeid_to_block_[node->id()] = block; |
| 332 } | 332 } |
| 333 | 333 |
| 334 | 334 |
| 335 std::ostream& operator<<(std::ostream& os, const Schedule& s) { | 335 std::ostream& operator<<(std::ostream& os, const Schedule& s) { |
| 336 for (BasicBlock* block : *s.rpo_order()) { | 336 for (BasicBlock* block : *s.rpo_order()) { |
| 337 os << "--- BLOCK B" << block->rpo_number(); | 337 os << "--- BLOCK B" << block->rpo_number(); |
| 338 if (block->deferred()) os << " (deferred)"; | 338 if (block->deferred()) os << " (deferred)"; |
| 339 if (block->loop_header() != nullptr) | |
| 340 os << " (in loop: B" << block->loop_header()->rpo_number() << ")"; | |
|
Mircea Trofin
2015/06/03 05:25:51
much easier to profile when information whether bl
| |
| 339 if (block->PredecessorCount() != 0) os << " <- "; | 341 if (block->PredecessorCount() != 0) os << " <- "; |
| 340 bool comma = false; | 342 bool comma = false; |
| 341 for (BasicBlock const* predecessor : block->predecessors()) { | 343 for (BasicBlock const* predecessor : block->predecessors()) { |
| 342 if (comma) os << ", "; | 344 if (comma) os << ", "; |
| 343 comma = true; | 345 comma = true; |
| 344 os << "B" << predecessor->rpo_number(); | 346 os << "B" << predecessor->rpo_number(); |
| 345 } | 347 } |
| 346 os << " ---\n"; | 348 os << " ---\n"; |
| 347 for (Node* node : *block) { | 349 for (Node* node : *block) { |
| 348 os << " " << *node; | 350 os << " " << *node; |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 374 } | 376 } |
| 375 os << "\n"; | 377 os << "\n"; |
| 376 } | 378 } |
| 377 } | 379 } |
| 378 return os; | 380 return os; |
| 379 } | 381 } |
| 380 | 382 |
| 381 } // namespace compiler | 383 } // namespace compiler |
| 382 } // namespace internal | 384 } // namespace internal |
| 383 } // namespace v8 | 385 } // namespace v8 |
| OLD | NEW |