Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Side by Side Diff: src/hydrogen-uint32-analysis.cc

Issue 22184004: Desugar bitwise negation into XOR and kill all UnaryOp stuff. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698