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

Side by Side Diff: src/compiler/representation-change.h

Issue 1884713003: [turbofan] Change number operations to handle Undefined as well. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweaks Created 4 years, 8 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
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/compiler/representation-change.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_REPRESENTATION_CHANGE_H_ 5 #ifndef V8_COMPILER_REPRESENTATION_CHANGE_H_
6 #define V8_COMPILER_REPRESENTATION_CHANGE_H_ 6 #define V8_COMPILER_REPRESENTATION_CHANGE_H_
7 7
8 #include "src/compiler/js-graph.h" 8 #include "src/compiler/js-graph.h"
9 #include "src/compiler/simplified-operator.h" 9 #include "src/compiler/simplified-operator.h"
10 10
(...skipping 13 matching lines...) Expand all
24 static Truncation Any() { return Truncation(TruncationKind::kAny); } 24 static Truncation Any() { return Truncation(TruncationKind::kAny); }
25 25
26 static Truncation Generalize(Truncation t1, Truncation t2) { 26 static Truncation Generalize(Truncation t1, Truncation t2) {
27 return Truncation(Generalize(t1.kind(), t2.kind())); 27 return Truncation(Generalize(t1.kind(), t2.kind()));
28 } 28 }
29 29
30 // Queries. 30 // Queries.
31 bool TruncatesToWord32() const { 31 bool TruncatesToWord32() const {
32 return LessGeneral(kind_, TruncationKind::kWord32); 32 return LessGeneral(kind_, TruncationKind::kWord32);
33 } 33 }
34 bool TruncatesToFloat64() const {
Benedikt Meurer 2016/04/14 04:57:44 I suppose you also need something like TruncatesTo
35 return LessGeneral(kind_, TruncationKind::kFloat64);
36 }
34 bool TruncatesNaNToZero() { 37 bool TruncatesNaNToZero() {
35 return LessGeneral(kind_, TruncationKind::kWord32) || 38 return LessGeneral(kind_, TruncationKind::kWord32) ||
36 LessGeneral(kind_, TruncationKind::kBool); 39 LessGeneral(kind_, TruncationKind::kBool);
37 } 40 }
38 bool TruncatesUndefinedToZeroOrNaN() { 41 bool TruncatesUndefinedToZeroOrNaN() {
39 return LessGeneral(kind_, TruncationKind::kFloat64) || 42 return LessGeneral(kind_, TruncationKind::kFloat64) ||
40 LessGeneral(kind_, TruncationKind::kWord64); 43 LessGeneral(kind_, TruncationKind::kWord64);
41 } 44 }
42 45
43 // Operators. 46 // Operators.
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 Factory* factory() const { return isolate()->factory(); } 140 Factory* factory() const { return isolate()->factory(); }
138 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); } 141 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); }
139 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } 142 MachineOperatorBuilder* machine() { return jsgraph()->machine(); }
140 }; 143 };
141 144
142 } // namespace compiler 145 } // namespace compiler
143 } // namespace internal 146 } // namespace internal
144 } // namespace v8 147 } // namespace v8
145 148
146 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ 149 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_
OLDNEW
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/compiler/representation-change.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698