OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 for (HInstructionIterator it(block); !it.Done(); it.Advance()) { | 146 for (HInstructionIterator it(block); !it.Done(); it.Advance()) { |
147 HInstruction* current = it.Current(); | 147 HInstruction* current = it.Current(); |
148 AddToWorklist(current); | 148 AddToWorklist(current); |
149 } | 149 } |
150 } | 150 } |
151 | 151 |
152 // Do a fixed point iteration, trying to improve representations | 152 // Do a fixed point iteration, trying to improve representations |
153 while (!worklist_.is_empty()) { | 153 while (!worklist_.is_empty()) { |
154 HValue* current = worklist_.RemoveLast(); | 154 HValue* current = worklist_.RemoveLast(); |
| 155 current->InferRepresentation(this); |
155 in_worklist_.Remove(current->id()); | 156 in_worklist_.Remove(current->id()); |
156 current->InferRepresentation(this); | |
157 } | 157 } |
158 | 158 |
159 // Lastly: any instruction that we don't have representation information | 159 // Lastly: any instruction that we don't have representation information |
160 // for defaults to Tagged. | 160 // for defaults to Tagged. |
161 for (int i = 0; i < graph()->blocks()->length(); ++i) { | 161 for (int i = 0; i < graph()->blocks()->length(); ++i) { |
162 HBasicBlock* block = graph()->blocks()->at(i); | 162 HBasicBlock* block = graph()->blocks()->at(i); |
163 const ZoneList<HPhi*>* phis = block->phis(); | 163 const ZoneList<HPhi*>* phis = block->phis(); |
164 for (int j = 0; j < phis->length(); ++j) { | 164 for (int j = 0; j < phis->length(); ++j) { |
165 HPhi* phi = phis->at(j); | 165 HPhi* phi = phis->at(j); |
166 if (phi->representation().IsNone()) { | 166 if (phi->representation().IsNone()) { |
167 phi->ChangeRepresentation(Representation::Tagged()); | 167 phi->ChangeRepresentation(Representation::Tagged()); |
168 } | 168 } |
169 } | 169 } |
170 for (HInstructionIterator it(block); !it.Done(); it.Advance()) { | 170 for (HInstructionIterator it(block); !it.Done(); it.Advance()) { |
171 HInstruction* current = it.Current(); | 171 HInstruction* current = it.Current(); |
172 if (current->representation().IsNone() && | 172 if (current->representation().IsNone() && |
173 current->CheckFlag(HInstruction::kFlexibleRepresentation)) { | 173 current->CheckFlag(HInstruction::kFlexibleRepresentation)) { |
174 if (current->CheckFlag(HInstruction::kCannotBeTagged)) { | 174 if (current->CheckFlag(HInstruction::kCannotBeTagged)) { |
175 current->ChangeRepresentation(Representation::Double()); | 175 current->ChangeRepresentation(Representation::Double()); |
176 } else { | 176 } else { |
177 current->ChangeRepresentation(Representation::Tagged()); | 177 current->ChangeRepresentation(Representation::Tagged()); |
178 } | 178 } |
179 } | 179 } |
180 } | 180 } |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 } } // namespace v8::internal | 184 } } // namespace v8::internal |
OLD | NEW |