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

Side by Side Diff: src/hydrogen.cc

Issue 6707001: Store HValue uses in a custom small list structure. (Closed)
Patch Set: Review fixes 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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 738
739 // Skip phi node if it was already replaced. 739 // Skip phi node if it was already replaced.
740 if (block == NULL) continue; 740 if (block == NULL) continue;
741 741
742 // Get replacement value if phi is redundant. 742 // Get replacement value if phi is redundant.
743 HValue* value = phi->GetRedundantReplacement(); 743 HValue* value = phi->GetRedundantReplacement();
744 744
745 if (value != NULL) { 745 if (value != NULL) {
746 // Iterate through uses finding the ones that should be 746 // Iterate through uses finding the ones that should be
747 // replaced. 747 // replaced.
748 ZoneList<HValue*>* uses = phi->uses(); 748 SmallPointerList<HValue>* uses = phi->uses();
749 while (!uses->is_empty()) { 749 while (!uses->is_empty()) {
750 HValue* use = uses->RemoveLast(); 750 HValue* use = uses->RemoveLast();
751 if (use != NULL) { 751 if (use != NULL) {
752 phi->ReplaceAtUse(use, value); 752 phi->ReplaceAtUse(use, value);
753 if (use->IsPhi()) worklist.Add(HPhi::cast(use)); 753 if (use->IsPhi()) worklist.Add(HPhi::cast(use));
754 } 754 }
755 } 755 }
756 block->RemovePhi(phi); 756 block->RemovePhi(phi);
757 } 757 }
758 } 758 }
(...skipping 5183 matching lines...) Expand 10 before | Expand all | Expand 10 after
5942 } 5942 }
5943 } 5943 }
5944 5944
5945 #ifdef DEBUG 5945 #ifdef DEBUG
5946 if (graph_ != NULL) graph_->Verify(); 5946 if (graph_ != NULL) graph_->Verify();
5947 if (allocator_ != NULL) allocator_->Verify(); 5947 if (allocator_ != NULL) allocator_->Verify();
5948 #endif 5948 #endif
5949 } 5949 }
5950 5950
5951 } } // namespace v8::internal 5951 } } // 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