| 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 15 matching lines...) Expand all Loading... |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 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() || | 36 if (use->IsBitwise() || use->IsShl() || use->IsSar() || use->IsShr()) { |
| 37 use->IsShl() || | |
| 38 use->IsSar() || | |
| 39 use->IsShr() || | |
| 40 use->IsBitNot()) { | |
| 41 return true; | 37 return true; |
| 42 } else if (use->IsChange() || use->IsSimulate()) { | 38 } else if (use->IsChange() || use->IsSimulate()) { |
| 43 // Conversions and deoptimization have special support for unt32. | 39 // Conversions and deoptimization have special support for unt32. |
| 44 return true; | 40 return true; |
| 45 } else if (use->IsStoreKeyed()) { | 41 } else if (use->IsStoreKeyed()) { |
| 46 HStoreKeyed* store = HStoreKeyed::cast(use); | 42 HStoreKeyed* store = HStoreKeyed::cast(use); |
| 47 if (store->is_external()) { | 43 if (store->is_external()) { |
| 48 // Storing a value into an external integer array is a bit level | 44 // Storing a value into an external integer array is a bit level |
| 49 // operation. | 45 // operation. |
| 50 if (store->value() == val) { | 46 if (store->value() == val) { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 218 |
| 223 // Some phis might have been optimistically marked with kUint32 flag. | 219 // Some phis might have been optimistically marked with kUint32 flag. |
| 224 // Remove this flag from those phis that are unsafe and propagate | 220 // Remove this flag from those phis that are unsafe and propagate |
| 225 // this information transitively potentially clearing kUint32 flag | 221 // this information transitively potentially clearing kUint32 flag |
| 226 // from some non-phi operations that are used as operands to unsafe phis. | 222 // from some non-phi operations that are used as operands to unsafe phis. |
| 227 UnmarkUnsafePhis(); | 223 UnmarkUnsafePhis(); |
| 228 } | 224 } |
| 229 | 225 |
| 230 | 226 |
| 231 } } // namespace v8::internal | 227 } } // namespace v8::internal |
| OLD | NEW |