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() || use->IsShl() || use->IsSar() || use->IsShr()) { | 36 if (use->IsBitwise() || |
| 37 use->IsShl() || |
| 38 use->IsSar() || |
| 39 use->IsShr() || |
| 40 use->IsBitNot()) { |
37 return true; | 41 return true; |
38 } else if (use->IsChange() || use->IsSimulate()) { | 42 } else if (use->IsChange() || use->IsSimulate()) { |
39 // Conversions and deoptimization have special support for unt32. | 43 // Conversions and deoptimization have special support for unt32. |
40 return true; | 44 return true; |
41 } else if (use->IsStoreKeyed()) { | 45 } else if (use->IsStoreKeyed()) { |
42 HStoreKeyed* store = HStoreKeyed::cast(use); | 46 HStoreKeyed* store = HStoreKeyed::cast(use); |
43 if (store->is_external()) { | 47 if (store->is_external()) { |
44 // Storing a value into an external integer array is a bit level | 48 // Storing a value into an external integer array is a bit level |
45 // operation. | 49 // operation. |
46 if (store->value() == val) { | 50 if (store->value() == val) { |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |