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

Side by Side Diff: src/hydrogen.cc

Issue 8502012: Improve dominator computation to avoid worst-case quadratic time. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 1 month 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 | « no previous file | no next file » | 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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 750
751 751
752 void HGraph::AssignDominators() { 752 void HGraph::AssignDominators() {
753 HPhase phase("Assign dominators", this); 753 HPhase phase("Assign dominators", this);
754 for (int i = 0; i < blocks_.length(); ++i) { 754 for (int i = 0; i < blocks_.length(); ++i) {
755 if (blocks_[i]->IsLoopHeader()) { 755 if (blocks_[i]->IsLoopHeader()) {
756 // Only the first predecessor of a loop header is from outside the loop. 756 // Only the first predecessor of a loop header is from outside the loop.
757 // All others are back edges, and thus cannot dominate the loop header. 757 // All others are back edges, and thus cannot dominate the loop header.
758 blocks_[i]->AssignCommonDominator(blocks_[i]->predecessors()->first()); 758 blocks_[i]->AssignCommonDominator(blocks_[i]->predecessors()->first());
759 } else { 759 } else {
760 for (int j = 0; j < blocks_[i]->predecessors()->length(); ++j) { 760 for (int j = blocks_[i]->predecessors()->length() - 1; j >= 0; --j) {
761 blocks_[i]->AssignCommonDominator(blocks_[i]->predecessors()->at(j)); 761 blocks_[i]->AssignCommonDominator(blocks_[i]->predecessors()->at(j));
762 } 762 }
763 } 763 }
764 } 764 }
765 } 765 }
766 766
767 // Mark all blocks that are dominated by an unconditional soft deoptimize to 767 // Mark all blocks that are dominated by an unconditional soft deoptimize to
768 // prevent code motion across those blocks. 768 // prevent code motion across those blocks.
769 void HGraph::PropagateDeoptimizingMark() { 769 void HGraph::PropagateDeoptimizingMark() {
770 HPhase phase("Propagate deoptimizing mark", this); 770 HPhase phase("Propagate deoptimizing mark", this);
(...skipping 6320 matching lines...) Expand 10 before | Expand all | Expand 10 after
7091 } 7091 }
7092 } 7092 }
7093 7093
7094 #ifdef DEBUG 7094 #ifdef DEBUG
7095 if (graph_ != NULL) graph_->Verify(false); // No full verify. 7095 if (graph_ != NULL) graph_->Verify(false); // No full verify.
7096 if (allocator_ != NULL) allocator_->Verify(); 7096 if (allocator_ != NULL) allocator_->Verify();
7097 #endif 7097 #endif
7098 } 7098 }
7099 7099
7100 } } // namespace v8::internal 7100 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698