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_SIMPLIFIED_OPERATOR_H_ | 5 #ifndef V8_COMPILER_SIMPLIFIED_OPERATOR_H_ |
6 #define V8_COMPILER_SIMPLIFIED_OPERATOR_H_ | 6 #define V8_COMPILER_SIMPLIFIED_OPERATOR_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/compiler/type-hints.h" | 10 #include "src/compiler/type-hints.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 bool operator==(ElementAccess const&, ElementAccess const&); | 97 bool operator==(ElementAccess const&, ElementAccess const&); |
98 bool operator!=(ElementAccess const&, ElementAccess const&); | 98 bool operator!=(ElementAccess const&, ElementAccess const&); |
99 | 99 |
100 size_t hash_value(ElementAccess const&); | 100 size_t hash_value(ElementAccess const&); |
101 | 101 |
102 std::ostream& operator<<(std::ostream&, ElementAccess const&); | 102 std::ostream& operator<<(std::ostream&, ElementAccess const&); |
103 | 103 |
104 ElementAccess const& ElementAccessOf(const Operator* op) WARN_UNUSED_RESULT; | 104 ElementAccess const& ElementAccessOf(const Operator* op) WARN_UNUSED_RESULT; |
105 | 105 |
| 106 // Mode of operation for the check-hole operators. |
| 107 enum class CheckHoleMode : uint8_t { |
| 108 kAllowReturnHole, // Allow to return the hole either as NaN or undefined. |
| 109 kNeverReturnHole, // Never return the hole (deoptimize instead). |
| 110 }; |
| 111 |
| 112 size_t hash_value(CheckHoleMode); |
| 113 |
| 114 std::ostream& operator<<(std::ostream&, CheckHoleMode); |
| 115 |
| 116 CheckHoleMode CheckHoleModeOf(const Operator*) WARN_UNUSED_RESULT; |
| 117 |
106 Type* TypeOf(const Operator* op) WARN_UNUSED_RESULT; | 118 Type* TypeOf(const Operator* op) WARN_UNUSED_RESULT; |
107 | 119 |
108 BinaryOperationHints::Hint BinaryOperationHintOf(const Operator* op); | 120 BinaryOperationHints::Hint BinaryOperationHintOf(const Operator* op); |
109 | 121 |
110 // Interface for building simplified operators, which represent the | 122 // Interface for building simplified operators, which represent the |
111 // medium-level operations of V8, including adding numbers, allocating objects, | 123 // medium-level operations of V8, including adding numbers, allocating objects, |
112 // indexing into objects and arrays, etc. | 124 // indexing into objects and arrays, etc. |
113 // All operators are typed but many are representation independent. | 125 // All operators are typed but many are representation independent. |
114 | 126 |
115 // Number values from JS can be in one of these representations: | 127 // Number values from JS can be in one of these representations: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 const Operator* NumberFround(); | 169 const Operator* NumberFround(); |
158 const Operator* NumberAtan(); | 170 const Operator* NumberAtan(); |
159 const Operator* NumberAtan2(); | 171 const Operator* NumberAtan2(); |
160 const Operator* NumberLog(); | 172 const Operator* NumberLog(); |
161 const Operator* NumberLog1p(); | 173 const Operator* NumberLog1p(); |
162 const Operator* NumberRound(); | 174 const Operator* NumberRound(); |
163 const Operator* NumberSqrt(); | 175 const Operator* NumberSqrt(); |
164 const Operator* NumberTrunc(); | 176 const Operator* NumberTrunc(); |
165 const Operator* NumberToInt32(); | 177 const Operator* NumberToInt32(); |
166 const Operator* NumberToUint32(); | 178 const Operator* NumberToUint32(); |
167 const Operator* NumberIsHoleNaN(); | |
168 const Operator* NumberConvertHoleNaN(); | |
169 | 179 |
170 const Operator* NumberSilenceNaN(); | 180 const Operator* NumberSilenceNaN(); |
171 | 181 |
172 const Operator* SpeculativeNumberAdd(BinaryOperationHints::Hint hint); | 182 const Operator* SpeculativeNumberAdd(BinaryOperationHints::Hint hint); |
173 const Operator* SpeculativeNumberSubtract(BinaryOperationHints::Hint hint); | 183 const Operator* SpeculativeNumberSubtract(BinaryOperationHints::Hint hint); |
174 | 184 |
175 const Operator* ReferenceEqual(Type* type); | 185 const Operator* ReferenceEqual(Type* type); |
176 | 186 |
177 const Operator* StringEqual(); | 187 const Operator* StringEqual(); |
178 const Operator* StringLessThan(); | 188 const Operator* StringLessThan(); |
(...skipping 16 matching lines...) Expand all Loading... |
195 const Operator* ChangeTaggedToBit(); | 205 const Operator* ChangeTaggedToBit(); |
196 const Operator* ChangeBitToTagged(); | 206 const Operator* ChangeBitToTagged(); |
197 const Operator* TruncateTaggedToWord32(); | 207 const Operator* TruncateTaggedToWord32(); |
198 const Operator* TruncateTaggedToFloat64(); | 208 const Operator* TruncateTaggedToFloat64(); |
199 | 209 |
200 const Operator* CheckedUint32ToInt32(); | 210 const Operator* CheckedUint32ToInt32(); |
201 const Operator* CheckedFloat64ToInt32(); | 211 const Operator* CheckedFloat64ToInt32(); |
202 const Operator* CheckedTaggedToInt32(); | 212 const Operator* CheckedTaggedToInt32(); |
203 const Operator* CheckedTaggedToFloat64(); | 213 const Operator* CheckedTaggedToFloat64(); |
204 | 214 |
| 215 const Operator* CheckHole(CheckHoleMode); |
| 216 const Operator* CheckHoleNaN(CheckHoleMode); |
205 const Operator* CheckIf(); | 217 const Operator* CheckIf(); |
206 | 218 |
207 const Operator* ObjectIsCallable(); | 219 const Operator* ObjectIsCallable(); |
208 const Operator* ObjectIsNumber(); | 220 const Operator* ObjectIsNumber(); |
209 const Operator* ObjectIsReceiver(); | 221 const Operator* ObjectIsReceiver(); |
210 const Operator* ObjectIsSmi(); | 222 const Operator* ObjectIsSmi(); |
211 const Operator* ObjectIsString(); | 223 const Operator* ObjectIsString(); |
212 const Operator* ObjectIsUndetectable(); | 224 const Operator* ObjectIsUndetectable(); |
213 | 225 |
214 const Operator* TypeGuard(Type* type); | 226 const Operator* TypeGuard(Type* type); |
(...skipping 22 matching lines...) Expand all Loading... |
237 Zone* const zone_; | 249 Zone* const zone_; |
238 | 250 |
239 DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorBuilder); | 251 DISALLOW_COPY_AND_ASSIGN(SimplifiedOperatorBuilder); |
240 }; | 252 }; |
241 | 253 |
242 } // namespace compiler | 254 } // namespace compiler |
243 } // namespace internal | 255 } // namespace internal |
244 } // namespace v8 | 256 } // namespace v8 |
245 | 257 |
246 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ | 258 #endif // V8_COMPILER_SIMPLIFIED_OPERATOR_H_ |
OLD | NEW |