Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/hydrogen.cc

Issue 6647019: Reuse backing store of two zone lists by using Rewind(0) instead of Clear(). (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.h ('k') | src/lithium-allocator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/hydrogen.h ('k') | src/lithium-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698