OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_INTERPRETER_BYTECODES_H_ | 5 #ifndef V8_INTERPRETER_BYTECODES_H_ |
6 #define V8_INTERPRETER_BYTECODES_H_ | 6 #define V8_INTERPRETER_BYTECODES_H_ |
7 | 7 |
8 #include <cstdint> | 8 #include <cstdint> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <string> | 10 #include <string> |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 /* - [Forward jumps] */ \ | 224 /* - [Forward jumps] */ \ |
225 V(Jump, AccumulatorUse::kNone, OperandType::kImm) \ | 225 V(Jump, AccumulatorUse::kNone, OperandType::kImm) \ |
226 /* - [Start constant jumps] */ \ | 226 /* - [Start constant jumps] */ \ |
227 V(JumpConstant, AccumulatorUse::kNone, OperandType::kIdx) \ | 227 V(JumpConstant, AccumulatorUse::kNone, OperandType::kIdx) \ |
228 /* - [Conditional jumps] */ \ | 228 /* - [Conditional jumps] */ \ |
229 /* - [Conditional constant jumps] */ \ | 229 /* - [Conditional constant jumps] */ \ |
230 V(JumpIfNullConstant, AccumulatorUse::kRead, OperandType::kIdx) \ | 230 V(JumpIfNullConstant, AccumulatorUse::kRead, OperandType::kIdx) \ |
231 V(JumpIfUndefinedConstant, AccumulatorUse::kRead, OperandType::kIdx) \ | 231 V(JumpIfUndefinedConstant, AccumulatorUse::kRead, OperandType::kIdx) \ |
232 V(JumpIfTrueConstant, AccumulatorUse::kRead, OperandType::kIdx) \ | 232 V(JumpIfTrueConstant, AccumulatorUse::kRead, OperandType::kIdx) \ |
233 V(JumpIfFalseConstant, AccumulatorUse::kRead, OperandType::kIdx) \ | 233 V(JumpIfFalseConstant, AccumulatorUse::kRead, OperandType::kIdx) \ |
| 234 V(JumpIfJSReceiverConstant, AccumulatorUse::kRead, OperandType::kIdx) \ |
234 V(JumpIfNotHoleConstant, AccumulatorUse::kRead, OperandType::kIdx) \ | 235 V(JumpIfNotHoleConstant, AccumulatorUse::kRead, OperandType::kIdx) \ |
235 /* - [Start ToBoolean jumps] */ \ | 236 /* - [Start ToBoolean jumps] */ \ |
236 V(JumpIfToBooleanTrueConstant, AccumulatorUse::kRead, OperandType::kIdx) \ | 237 V(JumpIfToBooleanTrueConstant, AccumulatorUse::kRead, OperandType::kIdx) \ |
237 V(JumpIfToBooleanFalseConstant, AccumulatorUse::kRead, OperandType::kIdx) \ | 238 V(JumpIfToBooleanFalseConstant, AccumulatorUse::kRead, OperandType::kIdx) \ |
238 /* - [End constant jumps] */ \ | 239 /* - [End constant jumps] */ \ |
239 /* - [Conditional immediate jumps] */ \ | 240 /* - [Conditional immediate jumps] */ \ |
240 V(JumpIfToBooleanTrue, AccumulatorUse::kRead, OperandType::kImm) \ | 241 V(JumpIfToBooleanTrue, AccumulatorUse::kRead, OperandType::kImm) \ |
241 V(JumpIfToBooleanFalse, AccumulatorUse::kRead, OperandType::kImm) \ | 242 V(JumpIfToBooleanFalse, AccumulatorUse::kRead, OperandType::kImm) \ |
242 /* - [End ToBoolean jumps] */ \ | 243 /* - [End ToBoolean jumps] */ \ |
243 V(JumpIfTrue, AccumulatorUse::kRead, OperandType::kImm) \ | 244 V(JumpIfTrue, AccumulatorUse::kRead, OperandType::kImm) \ |
244 V(JumpIfFalse, AccumulatorUse::kRead, OperandType::kImm) \ | 245 V(JumpIfFalse, AccumulatorUse::kRead, OperandType::kImm) \ |
245 V(JumpIfNull, AccumulatorUse::kRead, OperandType::kImm) \ | 246 V(JumpIfNull, AccumulatorUse::kRead, OperandType::kImm) \ |
246 V(JumpIfUndefined, AccumulatorUse::kRead, OperandType::kImm) \ | 247 V(JumpIfUndefined, AccumulatorUse::kRead, OperandType::kImm) \ |
| 248 V(JumpIfJSReceiver, AccumulatorUse::kRead, OperandType::kImm) \ |
247 V(JumpIfNotHole, AccumulatorUse::kRead, OperandType::kImm) \ | 249 V(JumpIfNotHole, AccumulatorUse::kRead, OperandType::kImm) \ |
248 \ | 250 \ |
249 /* Complex flow control For..in */ \ | 251 /* Complex flow control For..in */ \ |
250 V(ForInPrepare, AccumulatorUse::kNone, OperandType::kReg, \ | 252 V(ForInPrepare, AccumulatorUse::kNone, OperandType::kReg, \ |
251 OperandType::kRegOutTriple) \ | 253 OperandType::kRegOutTriple) \ |
252 V(ForInContinue, AccumulatorUse::kWrite, OperandType::kReg, \ | 254 V(ForInContinue, AccumulatorUse::kWrite, OperandType::kReg, \ |
253 OperandType::kReg) \ | 255 OperandType::kReg) \ |
254 V(ForInNext, AccumulatorUse::kWrite, OperandType::kReg, OperandType::kReg, \ | 256 V(ForInNext, AccumulatorUse::kWrite, OperandType::kReg, OperandType::kReg, \ |
255 OperandType::kRegPair, OperandType::kIdx) \ | 257 OperandType::kRegPair, OperandType::kIdx) \ |
256 V(ForInStep, AccumulatorUse::kWrite, OperandType::kReg) \ | 258 V(ForInStep, AccumulatorUse::kWrite, OperandType::kReg) \ |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 #define JUMP_TOBOOLEAN_CONDITIONAL_CONSTANT_BYTECODE_LIST(V) \ | 331 #define JUMP_TOBOOLEAN_CONDITIONAL_CONSTANT_BYTECODE_LIST(V) \ |
330 V(JumpIfToBooleanTrueConstant) \ | 332 V(JumpIfToBooleanTrueConstant) \ |
331 V(JumpIfToBooleanFalseConstant) | 333 V(JumpIfToBooleanFalseConstant) |
332 | 334 |
333 #define JUMP_CONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) \ | 335 #define JUMP_CONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) \ |
334 JUMP_TOBOOLEAN_CONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) \ | 336 JUMP_TOBOOLEAN_CONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) \ |
335 V(JumpIfTrue) \ | 337 V(JumpIfTrue) \ |
336 V(JumpIfFalse) \ | 338 V(JumpIfFalse) \ |
337 V(JumpIfNull) \ | 339 V(JumpIfNull) \ |
338 V(JumpIfUndefined) \ | 340 V(JumpIfUndefined) \ |
| 341 V(JumpIfJSReceiver) \ |
339 V(JumpIfNotHole) | 342 V(JumpIfNotHole) |
340 | 343 |
341 #define JUMP_CONDITIONAL_CONSTANT_BYTECODE_LIST(V) \ | 344 #define JUMP_CONDITIONAL_CONSTANT_BYTECODE_LIST(V) \ |
342 JUMP_TOBOOLEAN_CONDITIONAL_CONSTANT_BYTECODE_LIST(V) \ | 345 JUMP_TOBOOLEAN_CONDITIONAL_CONSTANT_BYTECODE_LIST(V) \ |
343 V(JumpIfNullConstant) \ | 346 V(JumpIfNullConstant) \ |
344 V(JumpIfUndefinedConstant) \ | 347 V(JumpIfUndefinedConstant) \ |
345 V(JumpIfTrueConstant) \ | 348 V(JumpIfTrueConstant) \ |
346 V(JumpIfFalseConstant) \ | 349 V(JumpIfFalseConstant) \ |
| 350 V(JumpIfJSReceiverConstant) \ |
347 V(JumpIfNotHoleConstant) | 351 V(JumpIfNotHoleConstant) |
348 | 352 |
349 #define JUMP_CONSTANT_BYTECODE_LIST(V) \ | 353 #define JUMP_CONSTANT_BYTECODE_LIST(V) \ |
350 JUMP_UNCONDITIONAL_CONSTANT_BYTECODE_LIST(V) \ | 354 JUMP_UNCONDITIONAL_CONSTANT_BYTECODE_LIST(V) \ |
351 JUMP_CONDITIONAL_CONSTANT_BYTECODE_LIST(V) | 355 JUMP_CONDITIONAL_CONSTANT_BYTECODE_LIST(V) |
352 | 356 |
353 #define JUMP_IMMEDIATE_BYTECODE_LIST(V) \ | 357 #define JUMP_IMMEDIATE_BYTECODE_LIST(V) \ |
354 JUMP_UNCONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) \ | 358 JUMP_UNCONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) \ |
355 JUMP_CONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) | 359 JUMP_CONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) |
356 | 360 |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 #undef CONSTEXPR | 822 #undef CONSTEXPR |
819 | 823 |
820 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, | 824 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, |
821 const Bytecode& bytecode); | 825 const Bytecode& bytecode); |
822 | 826 |
823 } // namespace interpreter | 827 } // namespace interpreter |
824 } // namespace internal | 828 } // namespace internal |
825 } // namespace v8 | 829 } // namespace v8 |
826 | 830 |
827 #endif // V8_INTERPRETER_BYTECODES_H_ | 831 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |