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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |