| 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 <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 // Clients of this interface shouldn't depend on lots of interpreter internals. | 10 // Clients of this interface shouldn't depend on lots of interpreter internals. |
| 11 // Do not include anything from src/interpreter here! | 11 // Do not include anything from src/interpreter here! |
| 12 #include "src/utils.h" | 12 #include "src/utils.h" |
| 13 | 13 |
| 14 namespace v8 { | 14 namespace v8 { |
| 15 namespace internal { | 15 namespace internal { |
| 16 namespace interpreter { | 16 namespace interpreter { |
| 17 | 17 |
| 18 // The list of operand types used by bytecodes. | 18 // The list of operand types used by bytecodes. |
| 19 #define OPERAND_TYPE_LIST(V) \ | 19 #define OPERAND_TYPE_LIST(V) \ |
| 20 \ | 20 \ |
| 21 /* None operand. */ \ | 21 /* None operand. */ \ |
| 22 V(None, OperandSize::kNone) \ | 22 V(None, OperandSize::kNone) \ |
| 23 \ | 23 \ |
| 24 /* Byte operands. */ \ | 24 /* Byte operands. */ \ |
| 25 V(Count8, OperandSize::kByte) \ | 25 V(Count8, OperandSize::kByte) \ |
| 26 V(Imm8, OperandSize::kByte) \ | 26 V(Imm8, OperandSize::kByte) \ |
| 27 V(Idx8, OperandSize::kByte) \ | 27 V(Idx8, OperandSize::kByte) \ |
| 28 V(MaybeReg8, OperandSize::kByte) \ | 28 V(MaybeReg8, OperandSize::kByte) \ |
| 29 V(Reg8, OperandSize::kByte) \ | 29 V(Reg8, OperandSize::kByte) \ |
| 30 V(RegPair8, OperandSize::kByte) \ | 30 V(RegPair8, OperandSize::kByte) \ |
| 31 \ | 31 V(RegTriple8, OperandSize::kByte) \ |
| 32 /* Short operands. */ \ | 32 \ |
| 33 V(Count16, OperandSize::kShort) \ | 33 /* Short operands. */ \ |
| 34 V(Idx16, OperandSize::kShort) \ | 34 V(Count16, OperandSize::kShort) \ |
| 35 V(Idx16, OperandSize::kShort) \ |
| 35 V(Reg16, OperandSize::kShort) | 36 V(Reg16, OperandSize::kShort) |
| 36 | 37 |
| 37 // The list of bytecodes which are interpreted by the interpreter. | 38 // The list of bytecodes which are interpreted by the interpreter. |
| 38 #define BYTECODE_LIST(V) \ | 39 #define BYTECODE_LIST(V) \ |
| 39 \ | 40 \ |
| 40 /* Loading the accumulator */ \ | 41 /* Loading the accumulator */ \ |
| 41 V(LdaZero, OperandType::kNone) \ | 42 V(LdaZero, OperandType::kNone) \ |
| 42 V(LdaSmi8, OperandType::kImm8) \ | 43 V(LdaSmi8, OperandType::kImm8) \ |
| 43 V(LdaUndefined, OperandType::kNone) \ | 44 V(LdaUndefined, OperandType::kNone) \ |
| 44 V(LdaNull, OperandType::kNone) \ | 45 V(LdaNull, OperandType::kNone) \ |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 V(JumpIfToBooleanFalseConstant, OperandType::kIdx8) \ | 213 V(JumpIfToBooleanFalseConstant, OperandType::kIdx8) \ |
| 213 V(JumpIfToBooleanFalseConstantWide, OperandType::kIdx16) \ | 214 V(JumpIfToBooleanFalseConstantWide, OperandType::kIdx16) \ |
| 214 V(JumpIfNull, OperandType::kImm8) \ | 215 V(JumpIfNull, OperandType::kImm8) \ |
| 215 V(JumpIfNullConstant, OperandType::kIdx8) \ | 216 V(JumpIfNullConstant, OperandType::kIdx8) \ |
| 216 V(JumpIfNullConstantWide, OperandType::kIdx16) \ | 217 V(JumpIfNullConstantWide, OperandType::kIdx16) \ |
| 217 V(JumpIfUndefined, OperandType::kImm8) \ | 218 V(JumpIfUndefined, OperandType::kImm8) \ |
| 218 V(JumpIfUndefinedConstant, OperandType::kIdx8) \ | 219 V(JumpIfUndefinedConstant, OperandType::kIdx8) \ |
| 219 V(JumpIfUndefinedConstantWide, OperandType::kIdx16) \ | 220 V(JumpIfUndefinedConstantWide, OperandType::kIdx16) \ |
| 220 \ | 221 \ |
| 221 /* Complex flow control For..in */ \ | 222 /* Complex flow control For..in */ \ |
| 222 V(ForInPrepare, OperandType::kReg8, OperandType::kReg8, OperandType::kReg8) \ | 223 V(ForInPrepare, OperandType::kRegTriple8) \ |
| 223 V(ForInDone, OperandType::kReg8, OperandType::kReg8) \ | 224 V(ForInDone, OperandType::kReg8, OperandType::kReg8) \ |
| 224 V(ForInNext, OperandType::kReg8, OperandType::kReg8, OperandType::kReg8, \ | 225 V(ForInNext, OperandType::kReg8, OperandType::kReg8, OperandType::kRegPair8) \ |
| 225 OperandType::kReg8) \ | |
| 226 V(ForInStep, OperandType::kReg8) \ | 226 V(ForInStep, OperandType::kReg8) \ |
| 227 \ | 227 \ |
| 228 /* Non-local flow control */ \ | 228 /* Non-local flow control */ \ |
| 229 V(Throw, OperandType::kNone) \ | 229 V(Throw, OperandType::kNone) \ |
| 230 V(Return, OperandType::kNone) | 230 V(Return, OperandType::kNone) |
| 231 | 231 |
| 232 | 232 |
| 233 // Enumeration of the size classes of operand types used by bytecodes. | 233 // Enumeration of the size classes of operand types used by bytecodes. |
| 234 enum class OperandSize : uint8_t { | 234 enum class OperandSize : uint8_t { |
| 235 kNone = 0, | 235 kNone = 0, |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 | 410 |
| 411 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 411 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
| 412 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 412 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
| 413 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); | 413 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); |
| 414 | 414 |
| 415 } // namespace interpreter | 415 } // namespace interpreter |
| 416 } // namespace internal | 416 } // namespace internal |
| 417 } // namespace v8 | 417 } // namespace v8 |
| 418 | 418 |
| 419 #endif // V8_INTERPRETER_BYTECODES_H_ | 419 #endif // V8_INTERPRETER_BYTECODES_H_ |
| OLD | NEW |