| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 633 |
| 634 | 634 |
| 635 void HGraph::OrderBlocks() { | 635 void HGraph::OrderBlocks() { |
| 636 HPhase phase("Block ordering"); | 636 HPhase phase("Block ordering"); |
| 637 BitVector visited(blocks_.length()); | 637 BitVector visited(blocks_.length()); |
| 638 | 638 |
| 639 ZoneList<HBasicBlock*> reverse_result(8); | 639 ZoneList<HBasicBlock*> reverse_result(8); |
| 640 HBasicBlock* start = blocks_[0]; | 640 HBasicBlock* start = blocks_[0]; |
| 641 Postorder(start, &visited, &reverse_result, NULL); | 641 Postorder(start, &visited, &reverse_result, NULL); |
| 642 | 642 |
| 643 blocks_.Clear(); | 643 blocks_.Rewind(0); |
| 644 int index = 0; | 644 int index = 0; |
| 645 for (int i = reverse_result.length() - 1; i >= 0; --i) { | 645 for (int i = reverse_result.length() - 1; i >= 0; --i) { |
| 646 HBasicBlock* b = reverse_result[i]; | 646 HBasicBlock* b = reverse_result[i]; |
| 647 blocks_.Add(b); | 647 blocks_.Add(b); |
| 648 b->set_block_id(index++); | 648 b->set_block_id(index++); |
| 649 } | 649 } |
| 650 } | 650 } |
| 651 | 651 |
| 652 | 652 |
| 653 void HGraph::PostorderLoopBlocks(HLoopInformation* loop, | 653 void HGraph::PostorderLoopBlocks(HLoopInformation* loop, |
| (...skipping 5236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5890 } | 5890 } |
| 5891 } | 5891 } |
| 5892 | 5892 |
| 5893 #ifdef DEBUG | 5893 #ifdef DEBUG |
| 5894 if (graph_ != NULL) graph_->Verify(); | 5894 if (graph_ != NULL) graph_->Verify(); |
| 5895 if (allocator_ != NULL) allocator_->Verify(); | 5895 if (allocator_ != NULL) allocator_->Verify(); |
| 5896 #endif | 5896 #endif |
| 5897 } | 5897 } |
| 5898 | 5898 |
| 5899 } } // namespace v8::internal | 5899 } } // namespace v8::internal |
| OLD | NEW |