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