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

Side by Side Diff: src/hydrogen.cc

Issue 6707001: Store HValue uses in a custom small list structure. (Closed)
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
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | src/small-pointer-list.h » ('J')
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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 736
737 // Skip phi node if it was already replaced. 737 // Skip phi node if it was already replaced.
738 if (block == NULL) continue; 738 if (block == NULL) continue;
739 739
740 // Get replacement value if phi is redundant. 740 // Get replacement value if phi is redundant.
741 HValue* value = phi->GetRedundantReplacement(); 741 HValue* value = phi->GetRedundantReplacement();
742 742
743 if (value != NULL) { 743 if (value != NULL) {
744 // Iterate through uses finding the ones that should be 744 // Iterate through uses finding the ones that should be
745 // replaced. 745 // replaced.
746 ZoneList<HValue*>* uses = phi->uses(); 746 SmallPointerList<HValue>* uses = phi->uses();
747 while (!uses->is_empty()) { 747 while (!uses->is_empty()) {
748 HValue* use = uses->RemoveLast(); 748 HValue* use = uses->RemoveLast();
749 if (use != NULL) { 749 if (use != NULL) {
750 phi->ReplaceAtUse(use, value); 750 phi->ReplaceAtUse(use, value);
751 if (use->IsPhi()) worklist.Add(HPhi::cast(use)); 751 if (use->IsPhi()) worklist.Add(HPhi::cast(use));
752 } 752 }
753 } 753 }
754 block->RemovePhi(phi); 754 block->RemovePhi(phi);
755 } 755 }
756 } 756 }
(...skipping 5199 matching lines...) Expand 10 before | Expand all | Expand 10 after
5956 } 5956 }
5957 } 5957 }
5958 5958
5959 #ifdef DEBUG 5959 #ifdef DEBUG
5960 if (graph_ != NULL) graph_->Verify(); 5960 if (graph_ != NULL) graph_->Verify();
5961 if (allocator_ != NULL) allocator_->Verify(); 5961 if (allocator_ != NULL) allocator_->Verify();
5962 #endif 5962 #endif
5963 } 5963 }
5964 5964
5965 } } // namespace v8::internal 5965 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | src/small-pointer-list.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698