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