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 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 // indirectly through a transitive closure of the def-use relation. | 1659 // indirectly through a transitive closure of the def-use relation. |
1660 bool change = true; | 1660 bool change = true; |
1661 while (change) { | 1661 while (change) { |
1662 change = false; | 1662 change = false; |
1663 for (int i = 0; i < phi_count; ++i) { | 1663 for (int i = 0; i < phi_count; ++i) { |
1664 HPhi* phi = phi_list->at(i); | 1664 HPhi* phi = phi_list->at(i); |
1665 for (HUseIterator it(phi->uses()); !it.Done(); it.Advance()) { | 1665 for (HUseIterator it(phi->uses()); !it.Done(); it.Advance()) { |
1666 HValue* use = it.value(); | 1666 HValue* use = it.value(); |
1667 if (use->IsPhi()) { | 1667 if (use->IsPhi()) { |
1668 int id = HPhi::cast(use)->phi_id(); | 1668 int id = HPhi::cast(use)->phi_id(); |
1669 change = change || | 1669 if (connected_phis[i]->UnionIsChanged(*connected_phis[id])) |
1670 connected_phis[i]->UnionIsChanged(*connected_phis[id]); | 1670 change = true; |
1671 } | 1671 } |
1672 } | 1672 } |
1673 } | 1673 } |
1674 } | 1674 } |
1675 | 1675 |
1676 // (3) Sum up the non-phi use counts of all connected phis. Don't include | 1676 // (3) Sum up the non-phi use counts of all connected phis. Don't include |
1677 // the non-phi uses of the phi itself. | 1677 // the non-phi uses of the phi itself. |
1678 for (int i = 0; i < phi_count; ++i) { | 1678 for (int i = 0; i < phi_count; ++i) { |
1679 HPhi* phi = phi_list->at(i); | 1679 HPhi* phi = phi_list->at(i); |
1680 for (BitVector::Iterator it(connected_phis.at(i)); | 1680 for (BitVector::Iterator it(connected_phis.at(i)); |
(...skipping 5011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6692 } | 6692 } |
6693 } | 6693 } |
6694 | 6694 |
6695 #ifdef DEBUG | 6695 #ifdef DEBUG |
6696 if (graph_ != NULL) graph_->Verify(); | 6696 if (graph_ != NULL) graph_->Verify(); |
6697 if (allocator_ != NULL) allocator_->Verify(); | 6697 if (allocator_ != NULL) allocator_->Verify(); |
6698 #endif | 6698 #endif |
6699 } | 6699 } |
6700 | 6700 |
6701 } } // namespace v8::internal | 6701 } } // namespace v8::internal |
OLD | NEW |