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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 206 |
207 | 207 |
208 void HUint32AnalysisPhase::Run() { | 208 void HUint32AnalysisPhase::Run() { |
209 if (!graph()->has_uint32_instructions()) return; | 209 if (!graph()->has_uint32_instructions()) return; |
210 | 210 |
211 ZoneList<HInstruction*>* uint32_instructions = graph()->uint32_instructions(); | 211 ZoneList<HInstruction*>* uint32_instructions = graph()->uint32_instructions(); |
212 for (int i = 0; i < uint32_instructions->length(); ++i) { | 212 for (int i = 0; i < uint32_instructions->length(); ++i) { |
213 // Analyze instruction and mark it with kUint32 if all | 213 // Analyze instruction and mark it with kUint32 if all |
214 // its uses are uint32 safe. | 214 // its uses are uint32 safe. |
215 HInstruction* current = uint32_instructions->at(i); | 215 HInstruction* current = uint32_instructions->at(i); |
216 if (Uint32UsesAreSafe(current)) current->SetFlag(HInstruction::kUint32); | 216 if (current->IsLinked() && |
| 217 current->representation().IsInteger32() && |
| 218 Uint32UsesAreSafe(current)) { |
| 219 current->SetFlag(HInstruction::kUint32); |
| 220 } |
217 } | 221 } |
218 | 222 |
219 // Some phis might have been optimistically marked with kUint32 flag. | 223 // Some phis might have been optimistically marked with kUint32 flag. |
220 // Remove this flag from those phis that are unsafe and propagate | 224 // Remove this flag from those phis that are unsafe and propagate |
221 // this information transitively potentially clearing kUint32 flag | 225 // this information transitively potentially clearing kUint32 flag |
222 // from some non-phi operations that are used as operands to unsafe phis. | 226 // from some non-phi operations that are used as operands to unsafe phis. |
223 UnmarkUnsafePhis(); | 227 UnmarkUnsafePhis(); |
224 } | 228 } |
225 | 229 |
226 | 230 |
227 } } // namespace v8::internal | 231 } } // namespace v8::internal |
OLD | NEW |