Chromium Code Reviews| 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 18 matching lines...) Expand all Loading... | |
| 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->IsChange() || use->IsSimulate()) { |
| 39 // Conversions and deoptimization have special support for unt32. | 39 // Conversions and deoptimization have special support for uint32. |
| 40 // This ASSERT guards that the conversion in question is actually | |
| 41 // implemented. Do not extend the whitelist without adding | |
| 42 // support to LChunkBuilder::DoChange(). | |
| 43 ASSERT(!use->IsChange() || | |
|
Vyacheslav Egorov (Google)
2013/10/31 10:05:36
I would make it
else if (use->IsSimulate()) {
| |
| 44 HChange::cast(use)->to().IsDouble() || | |
| 45 HChange::cast(use)->to().IsSmi() || | |
| 46 HChange::cast(use)->to().IsTagged()); | |
| 40 return true; | 47 return true; |
| 41 } else if (use->IsStoreKeyed()) { | 48 } else if (use->IsStoreKeyed()) { |
| 42 HStoreKeyed* store = HStoreKeyed::cast(use); | 49 HStoreKeyed* store = HStoreKeyed::cast(use); |
| 43 if (store->is_external()) { | 50 if (store->is_external()) { |
| 44 // Storing a value into an external integer array is a bit level | 51 // Storing a value into an external integer array is a bit level |
| 45 // operation. | 52 // operation. |
| 46 if (store->value() == val) { | 53 if (store->value() == val) { |
| 47 // Clamping or a conversion to double should have beed inserted. | 54 // Clamping or a conversion to double should have beed inserted. |
| 48 ASSERT(store->elements_kind() != EXTERNAL_PIXEL_ELEMENTS); | 55 ASSERT(store->elements_kind() != EXTERNAL_PIXEL_ELEMENTS); |
| 49 ASSERT(store->elements_kind() != EXTERNAL_FLOAT_ELEMENTS); | 56 ASSERT(store->elements_kind() != EXTERNAL_FLOAT_ELEMENTS); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 218 | 225 |
| 219 // Some phis might have been optimistically marked with kUint32 flag. | 226 // Some phis might have been optimistically marked with kUint32 flag. |
| 220 // Remove this flag from those phis that are unsafe and propagate | 227 // Remove this flag from those phis that are unsafe and propagate |
| 221 // this information transitively potentially clearing kUint32 flag | 228 // this information transitively potentially clearing kUint32 flag |
| 222 // from some non-phi operations that are used as operands to unsafe phis. | 229 // from some non-phi operations that are used as operands to unsafe phis. |
| 223 UnmarkUnsafePhis(); | 230 UnmarkUnsafePhis(); |
| 224 } | 231 } |
| 225 | 232 |
| 226 | 233 |
| 227 } } // namespace v8::internal | 234 } } // namespace v8::internal |
| OLD | NEW |