13namespace interpreter {
17#define ENTRY(Name, ...) BytecodeTraits<__VA_ARGS__>::kOperandTypes,
23#define ENTRY(Name, ...) BytecodeTraits<__VA_ARGS__>::kOperandTypeInfos,
29#define ENTRY(Name, ...) BytecodeTraits<__VA_ARGS__>::kOperandCount,
35#define ENTRY(Name, ...) BytecodeTraits<__VA_ARGS__>::kImplicitRegisterUse,
42#define ENTRY(Name, ...) BytecodeTraits<__VA_ARGS__>::kSingleScaleSize,
46#define ENTRY(Name, ...) BytecodeTraits<__VA_ARGS__>::kDoubleScaleSize,
50#define ENTRY(Name, ...) BytecodeTraits<__VA_ARGS__>::kQuadrupleScaleSize,
58#define ENTRY(Name, ...) \
59 BytecodeTraits<__VA_ARGS__>::kSingleScaleOperandSizes,
63#define ENTRY(Name, ...) \
64 BytecodeTraits<__VA_ARGS__>::kDoubleScaleOperandSizes,
68#define ENTRY(Name, ...) \
69 BytecodeTraits<__VA_ARGS__>::kQuadrupleScaleOperandSizes,
77#define ENTRY(Name, ...) \
78 BytecodeTraits<__VA_ARGS__>::kSingleScaleOperandOffsets.data(),
82#define ENTRY(Name, ...) \
83 BytecodeTraits<__VA_ARGS__>::kDoubleScaleOperandOffsets.data(),
87#define ENTRY(Name, ...) \
88 BytecodeTraits<__VA_ARGS__>::kQuadrupleScaleOperandOffsets.data(),
97#define ENTRY(Name, ...) \
98 OperandScaler<OperandType::k##Name, OperandScale::kSingle>::kOperandSize,
102#define ENTRY(Name, ...) \
103 OperandScaler<OperandType::k##Name, OperandScale::kDouble>::kOperandSize,
107#define ENTRY(Name, ...) \
108 OperandScaler<OperandType::k##Name, OperandScale::kQuadruple>::kOperandSize,
116#define ASSERT_SHORT_STAR_RANGE(Name, ...) \
117 static_assert(Bytecode::k##Name >= Bytecode::kFirstShortStar && \
118 Bytecode::k##Name <= Bytecode::kLastShortStar);
120#undef ASSERT_SHORT_STAR_RANGE
125#define CASE(Name, ...) \
126 case Bytecode::k##Name: \
138 if (operand_scale > OperandScale::kSingle) {
140 std::string suffix =
ToString(prefix_bytecode);
141 return value.append(
separator).append(suffix);
150 if (bytecode == Bytecode::kWide) {
151 return Bytecode::kDebugBreakWide;
153 if (bytecode == Bytecode::kExtraWide) {
154 return Bytecode::kDebugBreakExtraWide;
156 int bytecode_size =
Size(bytecode, OperandScale::kSingle);
157#define RETURN_IF_DEBUG_BREAK_SIZE_MATCHES(Name) \
158 if (bytecode_size == Size(Bytecode::k##Name, OperandScale::kSingle)) { \
159 return Bytecode::k##Name; \
162#undef RETURN_IF_DEBUG_BREAK_SIZE_MATCHES
169#define CASE(Name, ...) case Bytecode::k##Name:
181 switch (operand_type) {
182#define CASE(Name, _) \
183 case OperandType::k##Name: \
187#define CASE(Name, _) \
188 case OperandType::k##Name: \
198 switch (operand_type) {
199 case OperandType::kRegList:
200 case OperandType::kRegOutList:
210 case Bytecode::kCreateWithContext:
211 case Bytecode::kCreateBlockContext:
212 case Bytecode::kCreateCatchContext:
213 case Bytecode::kCreateRegExpLiteral:
214 case Bytecode::kGetIterator:
223 switch (operand_type) {
224#define CASE(Name, _) \
225 case OperandType::k##Name: \
230#define CASE(Name, _) \
231 case OperandType::k##Name: \
242 switch (operand_type) {
243#define CASE(Name, _) \
244 case OperandType::k##Name: \
249#define CASE(Name, _) \
250 case OperandType::k##Name: \
261 if (operand_scale == OperandScale::kSingle) {
266 case Bytecode::kDebugBreak0:
268 case Bytecode::kLdaZero:
269 case Bytecode::kLdaSmi:
270 case Bytecode::kLdaNull:
271 case Bytecode::kLdaTheHole:
272 case Bytecode::kLdaConstant:
273 case Bytecode::kLdaUndefined:
274 case Bytecode::kLdaGlobal:
275 case Bytecode::kGetNamedProperty:
276 case Bytecode::kGetKeyedProperty:
277 case Bytecode::kLdaContextSlot:
278 case Bytecode::kLdaImmutableContextSlot:
279 case Bytecode::kLdaCurrentContextSlot:
280 case Bytecode::kLdaImmutableCurrentContextSlot:
284 case Bytecode::kAddSmi:
285 case Bytecode::kSubSmi:
288 case Bytecode::kTypeOf:
289 case Bytecode::kCallAnyReceiver:
290 case Bytecode::kCallProperty:
291 case Bytecode::kCallProperty0:
292 case Bytecode::kCallProperty1:
293 case Bytecode::kCallProperty2:
294 case Bytecode::kCallUndefinedReceiver:
295 case Bytecode::kCallUndefinedReceiver0:
296 case Bytecode::kCallUndefinedReceiver1:
297 case Bytecode::kCallUndefinedReceiver2:
298 case Bytecode::kConstruct:
299 case Bytecode::kConstructWithSpread:
300 case Bytecode::kCreateObjectLiteral:
301 case Bytecode::kCreateArrayLiteral:
302 case Bytecode::kThrowReferenceErrorIfHole:
303 case Bytecode::kGetTemplateObject:
322 switch (operand_type) {
323#define CASE(Name, _) \
324 case OperandType::k##Name: \
325 return OperandTraits<OperandType::k##Name>::TypeInfoTraits::kIsUnsigned;
335 return (operand_scale == OperandScale::kSingle &&
336 (!
IsShortStar(bytecode) || bytecode == Bytecode::kStar0)) ||
#define REGISTER_INPUT_OPERAND_TYPE_LIST(V)
#define OPERAND_TYPE_LIST(V)
#define NON_REGISTER_OPERAND_TYPE_LIST(V)
#define REGISTER_OPERAND_TYPE_LIST(V)
#define REGISTER_OUTPUT_OPERAND_TYPE_LIST(V)
#define ASSERT_SHORT_STAR_RANGE(Name,...)
#define RETURN_IF_DEBUG_BREAK_SIZE_MATCHES(Name)
#define DEBUG_BREAK_PLAIN_BYTECODE_LIST(V)
#define SHORT_STAR_BYTECODE_LIST(V)
#define DEBUG_BREAK_BYTECODE_LIST(V)
#define BYTECODE_LIST(V, V_TSA)
static const int kOperandTypeCount
static const int kOperandCount[]
static OperandSize const kOperandKindSizes[3][BytecodeOperands::kOperandTypeCount]
static bool MakesCallAlongCriticalPath(Bytecode bytecode)
static constexpr bool IsCallRuntime(Bytecode bytecode)
static Bytecode OperandScaleToPrefixBytecode(OperandScale operand_scale)
static bool IsRegisterOutputOperandType(OperandType operand_type)
static const int *const kOperandOffsets[3][kBytecodeCount]
static bool OperandIsScalable(Bytecode bytecode, int operand_index)
static Bytecode GetDebugBreak(Bytecode bytecode)
static const OperandTypeInfo *const kOperandTypeInfos[]
static bool IsDebugBreak(Bytecode bytecode)
static bool IsRegisterOperandType(OperandType operand_type)
static constexpr bool IsCallOrConstruct(Bytecode bytecode)
static const uint8_t kBytecodeSizes[3][kBytecodeCount]
static int Size(Bytecode bytecode, OperandScale operand_scale)
static const ImplicitRegisterUse kImplicitRegisterUse[]
static bool IsRegisterListOperandType(OperandType operand_type)
static bool IsRegisterInputOperandType(OperandType operand_type)
static int NumberOfOperands(Bytecode bytecode)
static bool IsUnsignedOperandType(OperandType operand_type)
static constexpr bool IsShortStar(Bytecode bytecode)
static const OperandSize *const kOperandSizes[3][kBytecodeCount]
static const char * ToString(Bytecode bytecode)
static bool IsStarLookahead(Bytecode bytecode, OperandScale operand_scale)
static bool BytecodeHasHandler(Bytecode bytecode, OperandScale operand_scale)
static bool IsBytecodeWithScalableOperands(Bytecode bytecode)
static const OperandType *const kOperandTypes[]
std::ostream & operator<<(std::ostream &os, PaddingSpace padding)
#define DCHECK(condition)