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

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

Issue 2171703002: [turbofan] Sanitize the Truncation query method names. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@TurboFan_SimplifiedLowering_TruncationNone
Patch Set: Created 4 years, 5 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 | « no previous file | 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 11 matching lines...) Expand all
22 static Truncation Float32() { return Truncation(TruncationKind::kFloat32); } 22 static Truncation Float32() { return Truncation(TruncationKind::kFloat32); }
23 static Truncation Float64() { return Truncation(TruncationKind::kFloat64); } 23 static Truncation Float64() { return Truncation(TruncationKind::kFloat64); }
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 IsUnused() const { return kind_ == TruncationKind::kNone; } 31 bool IsUnused() const { return kind_ == TruncationKind::kNone; }
32 bool TruncatesToWord32() const { 32 bool IsUsedAsWord32() const {
33 return LessGeneral(kind_, TruncationKind::kWord32); 33 return LessGeneral(kind_, TruncationKind::kWord32);
34 } 34 }
35 bool TruncatesToFloat64() const { 35 bool IsUsedAsFloat64() const {
36 return LessGeneral(kind_, TruncationKind::kFloat64); 36 return LessGeneral(kind_, TruncationKind::kFloat64);
37 } 37 }
38 bool TruncatesNaNToZero() { 38 bool IdentifiesNaNAndZero() {
39 return LessGeneral(kind_, TruncationKind::kWord32) || 39 return LessGeneral(kind_, TruncationKind::kWord32) ||
40 LessGeneral(kind_, TruncationKind::kBool); 40 LessGeneral(kind_, TruncationKind::kBool);
41 } 41 }
42 bool TruncatesUndefinedToZeroOrNaN() { 42 bool IdentifiesUndefinedAndNaNAndZero() {
43 return LessGeneral(kind_, TruncationKind::kFloat64) || 43 return LessGeneral(kind_, TruncationKind::kFloat64) ||
44 LessGeneral(kind_, TruncationKind::kWord64); 44 LessGeneral(kind_, TruncationKind::kWord64);
45 } 45 }
46 46
47 // Operators. 47 // Operators.
48 bool operator==(Truncation other) const { return kind() == other.kind(); } 48 bool operator==(Truncation other) const { return kind() == other.kind(); }
49 bool operator!=(Truncation other) const { return !(*this == other); } 49 bool operator!=(Truncation other) const { return !(*this == other); }
50 50
51 // Debug utilities. 51 // Debug utilities.
52 const char* description() const; 52 const char* description() const;
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 Factory* factory() const { return isolate()->factory(); } 243 Factory* factory() const { return isolate()->factory(); }
244 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); } 244 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); }
245 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } 245 MachineOperatorBuilder* machine() { return jsgraph()->machine(); }
246 }; 246 };
247 247
248 } // namespace compiler 248 } // namespace compiler
249 } // namespace internal 249 } // namespace internal
250 } // namespace v8 250 } // namespace v8
251 251
252 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ 252 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/representation-change.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698