OLD | NEW |
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 10 matching lines...) Expand all Loading... |
21 static Truncation Word64() { return Truncation(TruncationKind::kWord64); } | 21 static Truncation Word64() { return Truncation(TruncationKind::kWord64); } |
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 TruncatesToBool() const { | |
32 return LessGeneral(kind_, TruncationKind::kBool); | |
33 } | |
34 bool TruncatesToWord32() const { | 31 bool TruncatesToWord32() const { |
35 return LessGeneral(kind_, TruncationKind::kWord32); | 32 return LessGeneral(kind_, TruncationKind::kWord32); |
36 } | 33 } |
37 bool TruncatesToFloat64() const { | 34 bool TruncatesToFloat64() const { |
38 return LessGeneral(kind_, TruncationKind::kFloat64); | 35 return LessGeneral(kind_, TruncationKind::kFloat64); |
39 } | 36 } |
40 bool TruncatesNaNToZero() { | 37 bool TruncatesNaNToZero() { |
41 return LessGeneral(kind_, TruncationKind::kWord32) || | 38 return LessGeneral(kind_, TruncationKind::kWord32) || |
42 LessGeneral(kind_, TruncationKind::kBool); | 39 LessGeneral(kind_, TruncationKind::kBool); |
43 } | 40 } |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 Factory* factory() const { return isolate()->factory(); } | 242 Factory* factory() const { return isolate()->factory(); } |
246 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); } | 243 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); } |
247 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } | 244 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } |
248 }; | 245 }; |
249 | 246 |
250 } // namespace compiler | 247 } // namespace compiler |
251 } // namespace internal | 248 } // namespace internal |
252 } // namespace v8 | 249 } // namespace v8 |
253 | 250 |
254 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ | 251 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ |
OLD | NEW |