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 11 matching lines...) Expand all Loading... |
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 IsUsedAsBool() const { |
| 33 return LessGeneral(kind_, TruncationKind::kBool); |
| 34 } |
32 bool IsUsedAsWord32() const { | 35 bool IsUsedAsWord32() const { |
33 return LessGeneral(kind_, TruncationKind::kWord32); | 36 return LessGeneral(kind_, TruncationKind::kWord32); |
34 } | 37 } |
35 bool IsUsedAsFloat64() const { | 38 bool IsUsedAsFloat64() const { |
36 return LessGeneral(kind_, TruncationKind::kFloat64); | 39 return LessGeneral(kind_, TruncationKind::kFloat64); |
37 } | 40 } |
38 bool IdentifiesNaNAndZero() { | 41 bool IdentifiesNaNAndZero() { |
39 return LessGeneral(kind_, TruncationKind::kWord32) || | 42 return LessGeneral(kind_, TruncationKind::kWord32) || |
40 LessGeneral(kind_, TruncationKind::kBool); | 43 LessGeneral(kind_, TruncationKind::kBool); |
41 } | 44 } |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 Factory* factory() const { return isolate()->factory(); } | 279 Factory* factory() const { return isolate()->factory(); } |
277 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); } | 280 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); } |
278 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } | 281 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } |
279 }; | 282 }; |
280 | 283 |
281 } // namespace compiler | 284 } // namespace compiler |
282 } // namespace internal | 285 } // namespace internal |
283 } // namespace v8 | 286 } // namespace v8 |
284 | 287 |
285 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ | 288 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ |
OLD | NEW |