| 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 17 matching lines...) Expand all Loading... |
| 28 #include "hydrogen-uint32-analysis.h" | 28 #include "hydrogen-uint32-analysis.h" |
| 29 | 29 |
| 30 namespace v8 { | 30 namespace v8 { |
| 31 namespace internal { | 31 namespace internal { |
| 32 | 32 |
| 33 | 33 |
| 34 bool HUint32AnalysisPhase::IsSafeUint32Use(HValue* val, HValue* use) { | 34 bool HUint32AnalysisPhase::IsSafeUint32Use(HValue* val, HValue* use) { |
| 35 // Operations that operate on bits are safe. | 35 // Operations that operate on bits are safe. |
| 36 if (use->IsBitwise() || use->IsShl() || use->IsSar() || use->IsShr()) { | 36 if (use->IsBitwise() || use->IsShl() || use->IsSar() || use->IsShr()) { |
| 37 return true; | 37 return true; |
| 38 } else if (use->IsChange() || use->IsSimulate()) { | 38 } else if (use->IsSimulate()) { |
| 39 // Conversions and deoptimization have special support for unt32. | 39 // Deoptimization has special support for uint32. |
| 40 return true; |
| 41 } else if (use->IsChange()) { |
| 42 // Conversions have special support for uint32. |
| 43 // This ASSERT guards that the conversion in question is actually |
| 44 // implemented. Do not extend the whitelist without adding |
| 45 // support to LChunkBuilder::DoChange(). |
| 46 ASSERT(HChange::cast(use)->to().IsDouble() || |
| 47 HChange::cast(use)->to().IsSmi() || |
| 48 HChange::cast(use)->to().IsTagged()); |
| 40 return true; | 49 return true; |
| 41 } else if (use->IsStoreKeyed()) { | 50 } else if (use->IsStoreKeyed()) { |
| 42 HStoreKeyed* store = HStoreKeyed::cast(use); | 51 HStoreKeyed* store = HStoreKeyed::cast(use); |
| 43 if (store->is_external()) { | 52 if (store->is_external()) { |
| 44 // Storing a value into an external integer array is a bit level | 53 // Storing a value into an external integer array is a bit level |
| 45 // operation. | 54 // operation. |
| 46 if (store->value() == val) { | 55 if (store->value() == val) { |
| 47 // Clamping or a conversion to double should have beed inserted. | 56 // Clamping or a conversion to double should have beed inserted. |
| 48 ASSERT(store->elements_kind() != EXTERNAL_PIXEL_ELEMENTS); | 57 ASSERT(store->elements_kind() != EXTERNAL_PIXEL_ELEMENTS); |
| 49 ASSERT(store->elements_kind() != EXTERNAL_FLOAT_ELEMENTS); | 58 ASSERT(store->elements_kind() != EXTERNAL_FLOAT_ELEMENTS); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 227 |
| 219 // Some phis might have been optimistically marked with kUint32 flag. | 228 // Some phis might have been optimistically marked with kUint32 flag. |
| 220 // Remove this flag from those phis that are unsafe and propagate | 229 // Remove this flag from those phis that are unsafe and propagate |
| 221 // this information transitively potentially clearing kUint32 flag | 230 // this information transitively potentially clearing kUint32 flag |
| 222 // from some non-phi operations that are used as operands to unsafe phis. | 231 // from some non-phi operations that are used as operands to unsafe phis. |
| 223 UnmarkUnsafePhis(); | 232 UnmarkUnsafePhis(); |
| 224 } | 233 } |
| 225 | 234 |
| 226 | 235 |
| 227 } } // namespace v8::internal | 236 } } // namespace v8::internal |
| OLD | NEW |