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() || |
Michael Starzinger
2013/08/06 08:12:06
nit: Condition should fit into one line now.
Sven Panne
2013/08/06 13:33:38
Done.
| |
37 use->IsShl() || | 37 use->IsShl() || |
38 use->IsSar() || | 38 use->IsSar() || |
39 use->IsShr() || | 39 use->IsShr()) { |
40 use->IsBitNot()) { | |
41 return true; | 40 return true; |
42 } else if (use->IsChange() || use->IsSimulate()) { | 41 } else if (use->IsChange() || use->IsSimulate()) { |
43 // Conversions and deoptimization have special support for unt32. | 42 // Conversions and deoptimization have special support for unt32. |
44 return true; | 43 return true; |
45 } else if (use->IsStoreKeyed()) { | 44 } else if (use->IsStoreKeyed()) { |
46 HStoreKeyed* store = HStoreKeyed::cast(use); | 45 HStoreKeyed* store = HStoreKeyed::cast(use); |
47 if (store->is_external()) { | 46 if (store->is_external()) { |
48 // Storing a value into an external integer array is a bit level | 47 // Storing a value into an external integer array is a bit level |
49 // operation. | 48 // operation. |
50 if (store->value() == val) { | 49 if (store->value() == val) { |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 | 221 |
223 // Some phis might have been optimistically marked with kUint32 flag. | 222 // Some phis might have been optimistically marked with kUint32 flag. |
224 // Remove this flag from those phis that are unsafe and propagate | 223 // Remove this flag from those phis that are unsafe and propagate |
225 // this information transitively potentially clearing kUint32 flag | 224 // this information transitively potentially clearing kUint32 flag |
226 // from some non-phi operations that are used as operands to unsafe phis. | 225 // from some non-phi operations that are used as operands to unsafe phis. |
227 UnmarkUnsafePhis(); | 226 UnmarkUnsafePhis(); |
228 } | 227 } |
229 | 228 |
230 | 229 |
231 } } // namespace v8::internal | 230 } } // namespace v8::internal |
OLD | NEW |