| 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 28 matching lines...) Expand all Loading... |
| 39 return LessGeneral(kind_, TruncationKind::kFloat64) || | 39 return LessGeneral(kind_, TruncationKind::kFloat64) || |
| 40 LessGeneral(kind_, TruncationKind::kWord64); | 40 LessGeneral(kind_, TruncationKind::kWord64); |
| 41 } | 41 } |
| 42 | 42 |
| 43 // Operators. | 43 // Operators. |
| 44 bool operator==(Truncation other) const { return kind() == other.kind(); } | 44 bool operator==(Truncation other) const { return kind() == other.kind(); } |
| 45 bool operator!=(Truncation other) const { return !(*this == other); } | 45 bool operator!=(Truncation other) const { return !(*this == other); } |
| 46 | 46 |
| 47 // Debug utilities. | 47 // Debug utilities. |
| 48 const char* description() const; | 48 const char* description() const; |
| 49 bool IsLessGeneralThan(Truncation other) { |
| 50 return LessGeneral(kind(), other.kind()); |
| 51 } |
| 49 | 52 |
| 50 private: | 53 private: |
| 51 enum class TruncationKind : uint8_t { | 54 enum class TruncationKind : uint8_t { |
| 52 kNone, | 55 kNone, |
| 53 kBool, | 56 kBool, |
| 54 kWord32, | 57 kWord32, |
| 55 kWord64, | 58 kWord64, |
| 56 kFloat32, | 59 kFloat32, |
| 57 kFloat64, | 60 kFloat64, |
| 58 kAny | 61 kAny |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 Factory* factory() const { return isolate()->factory(); } | 130 Factory* factory() const { return isolate()->factory(); } |
| 128 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); } | 131 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); } |
| 129 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } | 132 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } |
| 130 }; | 133 }; |
| 131 | 134 |
| 132 } // namespace compiler | 135 } // namespace compiler |
| 133 } // namespace internal | 136 } // namespace internal |
| 134 } // namespace v8 | 137 } // namespace v8 |
| 135 | 138 |
| 136 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ | 139 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ |
| OLD | NEW |