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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 static bool LessGeneral(TruncationKind rep1, TruncationKind rep2); | 73 static bool LessGeneral(TruncationKind rep1, TruncationKind rep2); |
74 }; | 74 }; |
75 | 75 |
76 enum class TypeCheckKind : uint8_t { | 76 enum class TypeCheckKind : uint8_t { |
77 kNone, | 77 kNone, |
78 kSigned32, | 78 kSigned32, |
79 kNumberOrUndefined, | 79 kNumberOrUndefined, |
80 kNumber | 80 kNumber |
81 }; | 81 }; |
82 | 82 |
| 83 inline std::ostream& operator<<(std::ostream& os, TypeCheckKind type_check) { |
| 84 switch (type_check) { |
| 85 case TypeCheckKind::kNone: |
| 86 return os << "None"; |
| 87 case TypeCheckKind::kSigned32: |
| 88 return os << "Signed32"; |
| 89 case TypeCheckKind::kNumberOrUndefined: |
| 90 return os << "NumberOrUndefined"; |
| 91 case TypeCheckKind::kNumber: |
| 92 return os << "Number"; |
| 93 } |
| 94 UNREACHABLE(); |
| 95 return os; |
| 96 } |
| 97 |
83 // The {UseInfo} class is used to describe a use of an input of a node. | 98 // The {UseInfo} class is used to describe a use of an input of a node. |
84 // | 99 // |
85 // This information is used in two different ways, based on the phase: | 100 // This information is used in two different ways, based on the phase: |
86 // | 101 // |
87 // 1. During propagation, the use info is used to inform the input node | 102 // 1. During propagation, the use info is used to inform the input node |
88 // about what part of the input is used (we call this truncation) and what | 103 // about what part of the input is used (we call this truncation) and what |
89 // is the preferred representation. | 104 // is the preferred representation. |
90 // | 105 // |
91 // 2. During lowering, the use info is used to properly convert the input | 106 // 2. During lowering, the use info is used to properly convert the input |
92 // to the preferred representation. The preferred representation might be | 107 // to the preferred representation. The preferred representation might be |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 Factory* factory() const { return isolate()->factory(); } | 248 Factory* factory() const { return isolate()->factory(); } |
234 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); } | 249 SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); } |
235 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } | 250 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } |
236 }; | 251 }; |
237 | 252 |
238 } // namespace compiler | 253 } // namespace compiler |
239 } // namespace internal | 254 } // namespace internal |
240 } // namespace v8 | 255 } // namespace v8 |
241 | 256 |
242 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ | 257 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ |
OLD | NEW |