| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/hydrogen-uint32-analysis.h" | 5 #include "src/hydrogen-uint32-analysis.h" |
| 6 | 6 |
| 7 namespace v8 { | 7 namespace v8 { |
| 8 namespace internal { | 8 namespace internal { |
| 9 | 9 |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 return instr->IsShr() || | 29 return instr->IsShr() || |
| 30 (instr->IsLoadKeyed() && IsUnsignedLoad(HLoadKeyed::cast(instr))) || | 30 (instr->IsLoadKeyed() && IsUnsignedLoad(HLoadKeyed::cast(instr))) || |
| 31 (instr->IsInteger32Constant() && instr->GetInteger32Constant() >= 0); | 31 (instr->IsInteger32Constant() && instr->GetInteger32Constant() >= 0); |
| 32 } | 32 } |
| 33 | 33 |
| 34 | 34 |
| 35 bool HUint32AnalysisPhase::IsSafeUint32Use(HValue* val, HValue* use) { | 35 bool HUint32AnalysisPhase::IsSafeUint32Use(HValue* val, HValue* use) { |
| 36 // Operations that operate on bits are safe. | 36 // Operations that operate on bits are safe. |
| 37 if (use->IsBitwise() || use->IsShl() || use->IsSar() || use->IsShr()) { | 37 if (use->IsBitwise() || use->IsShl() || use->IsSar() || use->IsShr()) { |
| 38 return true; | 38 return true; |
| 39 } else if (use->IsSimulate()) { | 39 } else if (use->IsSimulate() || use->IsArgumentsObject()) { |
| 40 // Deoptimization has special support for uint32. | 40 // Deoptimization has special support for uint32. |
| 41 return true; | 41 return true; |
| 42 } else if (use->IsChange()) { | 42 } else if (use->IsChange()) { |
| 43 // Conversions have special support for uint32. | 43 // Conversions have special support for uint32. |
| 44 // This DCHECK guards that the conversion in question is actually | 44 // This DCHECK guards that the conversion in question is actually |
| 45 // implemented. Do not extend the whitelist without adding | 45 // implemented. Do not extend the whitelist without adding |
| 46 // support to LChunkBuilder::DoChange(). | 46 // support to LChunkBuilder::DoChange(). |
| 47 DCHECK(HChange::cast(use)->to().IsDouble() || | 47 DCHECK(HChange::cast(use)->to().IsDouble() || |
| 48 HChange::cast(use)->to().IsSmi() || | 48 HChange::cast(use)->to().IsSmi() || |
| 49 HChange::cast(use)->to().IsTagged()); | 49 HChange::cast(use)->to().IsTagged()); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 231 |
| 232 // Some phis might have been optimistically marked with kUint32 flag. | 232 // Some phis might have been optimistically marked with kUint32 flag. |
| 233 // Remove this flag from those phis that are unsafe and propagate | 233 // Remove this flag from those phis that are unsafe and propagate |
| 234 // this information transitively potentially clearing kUint32 flag | 234 // this information transitively potentially clearing kUint32 flag |
| 235 // from some non-phi operations that are used as operands to unsafe phis. | 235 // from some non-phi operations that are used as operands to unsafe phis. |
| 236 UnmarkUnsafePhis(); | 236 UnmarkUnsafePhis(); |
| 237 } | 237 } |
| 238 | 238 |
| 239 | 239 |
| 240 } } // namespace v8::internal | 240 } } // namespace v8::internal |
| OLD | NEW |