5#ifndef V8_INTERPRETER_BYTECODES_H_
6#define V8_INTERPRETER_BYTECODES_H_
21namespace interpreter {
24#define SHORT_STAR_BYTECODE_LIST(V) \
25 V(Star15, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
26 V(Star14, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
27 V(Star13, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
28 V(Star12, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
29 V(Star11, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
30 V(Star10, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
31 V(Star9, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
32 V(Star8, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
33 V(Star7, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
34 V(Star6, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
35 V(Star5, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
36 V(Star4, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
37 V(Star3, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
38 V(Star2, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
39 V(Star1, ImplicitRegisterUse::kReadAccumulatorWriteShortStar) \
40 V(Star0, ImplicitRegisterUse::kReadAccumulatorWriteShortStar)
49#define BYTECODE_LIST_WITH_UNIQUE_HANDLERS_IMPL(V, V_TSA) \
51 V(Wide, ImplicitRegisterUse::kNone) \
52 V(ExtraWide, ImplicitRegisterUse::kNone) \
56 V(DebugBreakWide, ImplicitRegisterUse::kReadWriteAccumulator) \
57 V(DebugBreakExtraWide, ImplicitRegisterUse::kReadWriteAccumulator) \
58 V(DebugBreak0, ImplicitRegisterUse::kReadWriteAccumulator) \
59 V(DebugBreak1, ImplicitRegisterUse::kReadWriteAccumulator, \
61 V(DebugBreak2, ImplicitRegisterUse::kReadWriteAccumulator, \
62 OperandType::kReg, OperandType::kReg) \
63 V(DebugBreak3, ImplicitRegisterUse::kReadWriteAccumulator, \
64 OperandType::kReg, OperandType::kReg, OperandType::kReg) \
65 V(DebugBreak4, ImplicitRegisterUse::kReadWriteAccumulator, \
66 OperandType::kReg, OperandType::kReg, OperandType::kReg, \
68 V(DebugBreak5, ImplicitRegisterUse::kReadWriteAccumulator, \
69 OperandType::kRuntimeId, OperandType::kReg, OperandType::kReg) \
70 V(DebugBreak6, ImplicitRegisterUse::kReadWriteAccumulator, \
71 OperandType::kRuntimeId, OperandType::kReg, OperandType::kReg, \
76 V(Ldar, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg) \
77 V(LdaZero, ImplicitRegisterUse::kWriteAccumulator) \
78 V(LdaSmi, ImplicitRegisterUse::kWriteAccumulator, OperandType::kImm) \
79 V(LdaUndefined, ImplicitRegisterUse::kWriteAccumulator) \
80 V(LdaNull, ImplicitRegisterUse::kWriteAccumulator) \
81 V(LdaTheHole, ImplicitRegisterUse::kWriteAccumulator) \
82 V(LdaTrue, ImplicitRegisterUse::kWriteAccumulator) \
83 V(LdaFalse, ImplicitRegisterUse::kWriteAccumulator) \
84 V(LdaConstant, ImplicitRegisterUse::kWriteAccumulator, OperandType::kIdx) \
85 V(LdaContextSlot, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg, \
86 OperandType::kIdx, OperandType::kUImm) \
87 V(LdaScriptContextSlot, ImplicitRegisterUse::kWriteAccumulator, \
88 OperandType::kReg, OperandType::kIdx, OperandType::kUImm) \
89 V(LdaImmutableContextSlot, ImplicitRegisterUse::kWriteAccumulator, \
90 OperandType::kReg, OperandType::kIdx, OperandType::kUImm) \
91 V(LdaCurrentContextSlot, ImplicitRegisterUse::kWriteAccumulator, \
93 V(LdaCurrentScriptContextSlot, ImplicitRegisterUse::kWriteAccumulator, \
95 V(LdaImmutableCurrentContextSlot, ImplicitRegisterUse::kWriteAccumulator, \
98 V(Star, ImplicitRegisterUse::kReadAccumulator, OperandType::kRegOut) \
99 V(Mov, ImplicitRegisterUse::kNone, OperandType::kReg, OperandType::kRegOut) \
100 V(PushContext, ImplicitRegisterUse::kReadAccumulator, OperandType::kRegOut) \
101 V(PopContext, ImplicitRegisterUse::kNone, OperandType::kReg) \
103 V(TestReferenceEqual, ImplicitRegisterUse::kReadWriteAccumulator, \
105 V(TestUndetectable, ImplicitRegisterUse::kReadWriteAccumulator) \
106 V(TestNull, ImplicitRegisterUse::kReadWriteAccumulator) \
107 V(TestUndefined, ImplicitRegisterUse::kReadWriteAccumulator) \
108 V(TestTypeOf, ImplicitRegisterUse::kReadWriteAccumulator, \
109 OperandType::kFlag8) \
112 V(LdaGlobal, ImplicitRegisterUse::kWriteAccumulator, OperandType::kIdx, \
114 V(LdaGlobalInsideTypeof, ImplicitRegisterUse::kWriteAccumulator, \
115 OperandType::kIdx, OperandType::kIdx) \
116 V(StaGlobal, ImplicitRegisterUse::kReadAndClobberAccumulator, \
117 OperandType::kIdx, OperandType::kIdx) \
120 V(StaContextSlot, ImplicitRegisterUse::kReadAccumulator, OperandType::kReg, \
121 OperandType::kIdx, OperandType::kUImm) \
122 V(StaCurrentContextSlot, ImplicitRegisterUse::kReadAccumulator, \
124 V(StaScriptContextSlot, ImplicitRegisterUse::kReadAccumulator, \
125 OperandType::kReg, OperandType::kIdx, OperandType::kUImm) \
126 V(StaCurrentScriptContextSlot, ImplicitRegisterUse::kReadAccumulator, \
130 V(LdaLookupSlot, ImplicitRegisterUse::kWriteAccumulator, OperandType::kIdx) \
131 V(LdaLookupContextSlot, ImplicitRegisterUse::kWriteAccumulator, \
132 OperandType::kIdx, OperandType::kIdx, OperandType::kUImm) \
133 V(LdaLookupScriptContextSlot, ImplicitRegisterUse::kWriteAccumulator, \
134 OperandType::kIdx, OperandType::kIdx, OperandType::kUImm) \
135 V(LdaLookupGlobalSlot, ImplicitRegisterUse::kWriteAccumulator, \
136 OperandType::kIdx, OperandType::kIdx, OperandType::kUImm) \
137 V(LdaLookupSlotInsideTypeof, ImplicitRegisterUse::kWriteAccumulator, \
139 V(LdaLookupContextSlotInsideTypeof, ImplicitRegisterUse::kWriteAccumulator, \
140 OperandType::kIdx, OperandType::kIdx, OperandType::kUImm) \
141 V(LdaLookupScriptContextSlotInsideTypeof, \
142 ImplicitRegisterUse::kWriteAccumulator, OperandType::kIdx, \
143 OperandType::kIdx, OperandType::kUImm) \
144 V(LdaLookupGlobalSlotInsideTypeof, ImplicitRegisterUse::kWriteAccumulator, \
145 OperandType::kIdx, OperandType::kIdx, OperandType::kUImm) \
146 V(StaLookupSlot, ImplicitRegisterUse::kReadWriteAccumulator, \
147 OperandType::kIdx, OperandType::kFlag8) \
150 V(GetNamedProperty, ImplicitRegisterUse::kWriteAccumulator, \
151 OperandType::kReg, OperandType::kIdx, OperandType::kIdx) \
152 V(GetNamedPropertyFromSuper, ImplicitRegisterUse::kReadWriteAccumulator, \
153 OperandType::kReg, OperandType::kIdx, OperandType::kIdx) \
154 V(GetKeyedProperty, ImplicitRegisterUse::kReadWriteAccumulator, \
155 OperandType::kReg, OperandType::kIdx) \
156 V(GetEnumeratedKeyedProperty, ImplicitRegisterUse::kReadWriteAccumulator, \
157 OperandType::kReg, OperandType::kReg, OperandType::kReg, \
161 V(LdaModuleVariable, ImplicitRegisterUse::kWriteAccumulator, \
162 OperandType::kImm, OperandType::kUImm) \
163 V(StaModuleVariable, ImplicitRegisterUse::kReadAccumulator, \
164 OperandType::kImm, OperandType::kUImm) \
167 V(SetNamedProperty, ImplicitRegisterUse::kReadAndClobberAccumulator, \
168 OperandType::kReg, OperandType::kIdx, OperandType::kIdx) \
169 V(DefineNamedOwnProperty, ImplicitRegisterUse::kReadAndClobberAccumulator, \
170 OperandType::kReg, OperandType::kIdx, OperandType::kIdx) \
171 V(SetKeyedProperty, ImplicitRegisterUse::kReadAndClobberAccumulator, \
172 OperandType::kReg, OperandType::kReg, OperandType::kIdx) \
173 V(DefineKeyedOwnProperty, ImplicitRegisterUse::kReadAndClobberAccumulator, \
174 OperandType::kReg, OperandType::kReg, OperandType::kFlag8, \
176 V(StaInArrayLiteral, ImplicitRegisterUse::kReadAndClobberAccumulator, \
177 OperandType::kReg, OperandType::kReg, OperandType::kIdx) \
178 V(DefineKeyedOwnPropertyInLiteral, ImplicitRegisterUse::kReadAccumulator, \
179 OperandType::kReg, OperandType::kReg, OperandType::kFlag8, \
183 V(Add, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \
185 V(Sub, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \
187 V(Mul, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \
189 V(Div, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \
191 V(Mod, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \
193 V(Exp, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \
195 V(BitwiseOr, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \
197 V(BitwiseXor, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \
199 V(BitwiseAnd, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \
201 V(ShiftLeft, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \
203 V(ShiftRight, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \
205 V(ShiftRightLogical, ImplicitRegisterUse::kReadWriteAccumulator, \
206 OperandType::kReg, OperandType::kIdx) \
209 V(AddSmi, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kImm, \
211 V(SubSmi, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kImm, \
213 V(MulSmi, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kImm, \
215 V(DivSmi, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kImm, \
217 V(ModSmi, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kImm, \
219 V(ExpSmi, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kImm, \
221 V(BitwiseOrSmi, ImplicitRegisterUse::kReadWriteAccumulator, \
222 OperandType::kImm, OperandType::kIdx) \
223 V(BitwiseXorSmi, ImplicitRegisterUse::kReadWriteAccumulator, \
224 OperandType::kImm, OperandType::kIdx) \
225 V(BitwiseAndSmi, ImplicitRegisterUse::kReadWriteAccumulator, \
226 OperandType::kImm, OperandType::kIdx) \
227 V(ShiftLeftSmi, ImplicitRegisterUse::kReadWriteAccumulator, \
228 OperandType::kImm, OperandType::kIdx) \
229 V(ShiftRightSmi, ImplicitRegisterUse::kReadWriteAccumulator, \
230 OperandType::kImm, OperandType::kIdx) \
231 V(ShiftRightLogicalSmi, ImplicitRegisterUse::kReadWriteAccumulator, \
232 OperandType::kImm, OperandType::kIdx) \
235 V(Inc, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kIdx) \
236 V(Dec, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kIdx) \
237 V(Negate, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kIdx) \
238 V_TSA(BitwiseNot, ImplicitRegisterUse::kReadWriteAccumulator, \
240 V(ToBooleanLogicalNot, ImplicitRegisterUse::kReadWriteAccumulator) \
241 V(LogicalNot, ImplicitRegisterUse::kReadWriteAccumulator) \
242 V(TypeOf, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kIdx) \
243 V(DeletePropertyStrict, ImplicitRegisterUse::kReadWriteAccumulator, \
245 V(DeletePropertySloppy, ImplicitRegisterUse::kReadWriteAccumulator, \
249 V(GetSuperConstructor, ImplicitRegisterUse::kReadAccumulator, \
250 OperandType::kRegOut) \
251 V(FindNonDefaultConstructorOrConstruct, ImplicitRegisterUse::kNone, \
252 OperandType::kReg, OperandType::kReg, OperandType::kRegOutPair) \
255 V(CallAnyReceiver, ImplicitRegisterUse::kWriteAccumulator, \
256 OperandType::kReg, OperandType::kRegList, OperandType::kRegCount, \
258 V(CallProperty, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg, \
259 OperandType::kRegList, OperandType::kRegCount, OperandType::kIdx) \
260 V(CallProperty0, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg, \
261 OperandType::kReg, OperandType::kIdx) \
262 V(CallProperty1, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg, \
263 OperandType::kReg, OperandType::kReg, OperandType::kIdx) \
264 V(CallProperty2, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg, \
265 OperandType::kReg, OperandType::kReg, OperandType::kReg, \
267 V(CallUndefinedReceiver, ImplicitRegisterUse::kWriteAccumulator, \
268 OperandType::kReg, OperandType::kRegList, OperandType::kRegCount, \
270 V(CallUndefinedReceiver0, ImplicitRegisterUse::kWriteAccumulator, \
271 OperandType::kReg, OperandType::kIdx) \
272 V(CallUndefinedReceiver1, ImplicitRegisterUse::kWriteAccumulator, \
273 OperandType::kReg, OperandType::kReg, OperandType::kIdx) \
274 V(CallUndefinedReceiver2, ImplicitRegisterUse::kWriteAccumulator, \
275 OperandType::kReg, OperandType::kReg, OperandType::kReg, \
277 V(CallWithSpread, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg, \
278 OperandType::kRegList, OperandType::kRegCount, OperandType::kIdx) \
279 V(CallRuntime, ImplicitRegisterUse::kWriteAccumulator, \
280 OperandType::kRuntimeId, OperandType::kRegList, OperandType::kRegCount) \
281 V(CallRuntimeForPair, ImplicitRegisterUse::kClobberAccumulator, \
282 OperandType::kRuntimeId, OperandType::kRegList, OperandType::kRegCount, \
283 OperandType::kRegOutPair) \
284 V(CallJSRuntime, ImplicitRegisterUse::kWriteAccumulator, \
285 OperandType::kNativeContextIndex, OperandType::kRegList, \
286 OperandType::kRegCount) \
289 V(InvokeIntrinsic, ImplicitRegisterUse::kWriteAccumulator, \
290 OperandType::kIntrinsicId, OperandType::kRegList, OperandType::kRegCount) \
293 V(Construct, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \
294 OperandType::kRegList, OperandType::kRegCount, OperandType::kIdx) \
295 V(ConstructWithSpread, ImplicitRegisterUse::kReadWriteAccumulator, \
296 OperandType::kReg, OperandType::kRegList, OperandType::kRegCount, \
298 V(ConstructForwardAllArgs, ImplicitRegisterUse::kReadWriteAccumulator, \
299 OperandType::kReg, OperandType::kIdx) \
302 V(TestEqual, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \
304 V(TestEqualStrict, ImplicitRegisterUse::kReadWriteAccumulator, \
305 OperandType::kReg, OperandType::kIdx) \
306 V(TestLessThan, ImplicitRegisterUse::kReadWriteAccumulator, \
307 OperandType::kReg, OperandType::kIdx) \
308 V(TestGreaterThan, ImplicitRegisterUse::kReadWriteAccumulator, \
309 OperandType::kReg, OperandType::kIdx) \
310 V(TestLessThanOrEqual, ImplicitRegisterUse::kReadWriteAccumulator, \
311 OperandType::kReg, OperandType::kIdx) \
312 V(TestGreaterThanOrEqual, ImplicitRegisterUse::kReadWriteAccumulator, \
313 OperandType::kReg, OperandType::kIdx) \
314 V(TestInstanceOf, ImplicitRegisterUse::kReadWriteAccumulator, \
315 OperandType::kReg, OperandType::kIdx) \
316 V(TestIn, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \
320 V(ToName, ImplicitRegisterUse::kReadWriteAccumulator) \
321 V(ToNumber, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kIdx) \
322 V(ToNumeric, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kIdx) \
323 V(ToObject, ImplicitRegisterUse::kReadAccumulator, OperandType::kRegOut) \
324 V(ToString, ImplicitRegisterUse::kReadWriteAccumulator) \
325 V(ToBoolean, ImplicitRegisterUse::kReadWriteAccumulator) \
328 V(CreateRegExpLiteral, ImplicitRegisterUse::kWriteAccumulator, \
329 OperandType::kIdx, OperandType::kIdx, OperandType::kFlag16) \
330 V(CreateArrayLiteral, ImplicitRegisterUse::kWriteAccumulator, \
331 OperandType::kIdx, OperandType::kIdx, OperandType::kFlag8) \
332 V(CreateArrayFromIterable, ImplicitRegisterUse::kReadWriteAccumulator) \
333 V(CreateEmptyArrayLiteral, ImplicitRegisterUse::kWriteAccumulator, \
335 V(CreateObjectLiteral, ImplicitRegisterUse::kWriteAccumulator, \
336 OperandType::kIdx, OperandType::kIdx, OperandType::kFlag8) \
337 V(CreateEmptyObjectLiteral, ImplicitRegisterUse::kWriteAccumulator) \
338 V(CloneObject, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg, \
339 OperandType::kFlag8, OperandType::kIdx) \
342 V(GetTemplateObject, ImplicitRegisterUse::kWriteAccumulator, \
343 OperandType::kIdx, OperandType::kIdx) \
346 V(CreateClosure, ImplicitRegisterUse::kWriteAccumulator, OperandType::kIdx, \
347 OperandType::kIdx, OperandType::kFlag8) \
350 V(CreateBlockContext, ImplicitRegisterUse::kWriteAccumulator, \
352 V(CreateCatchContext, ImplicitRegisterUse::kWriteAccumulator, \
353 OperandType::kReg, OperandType::kIdx) \
354 V(CreateFunctionContext, ImplicitRegisterUse::kWriteAccumulator, \
355 OperandType::kIdx, OperandType::kUImm) \
356 V(CreateEvalContext, ImplicitRegisterUse::kWriteAccumulator, \
357 OperandType::kIdx, OperandType::kUImm) \
358 V(CreateWithContext, ImplicitRegisterUse::kWriteAccumulator, \
359 OperandType::kReg, OperandType::kIdx) \
362 V(CreateMappedArguments, ImplicitRegisterUse::kWriteAccumulator) \
363 V(CreateUnmappedArguments, ImplicitRegisterUse::kWriteAccumulator) \
364 V(CreateRestParameter, ImplicitRegisterUse::kWriteAccumulator) \
368 V(JumpLoop, ImplicitRegisterUse::kClobberAccumulator, OperandType::kUImm, \
369 OperandType::kImm, OperandType::kIdx) \
371 V(Jump, ImplicitRegisterUse::kNone, OperandType::kUImm) \
373 V(JumpConstant, ImplicitRegisterUse::kNone, OperandType::kIdx) \
376 V(JumpIfNullConstant, ImplicitRegisterUse::kReadAccumulator, \
378 V(JumpIfNotNullConstant, ImplicitRegisterUse::kReadAccumulator, \
380 V(JumpIfUndefinedConstant, ImplicitRegisterUse::kReadAccumulator, \
382 V(JumpIfNotUndefinedConstant, ImplicitRegisterUse::kReadAccumulator, \
384 V(JumpIfUndefinedOrNullConstant, ImplicitRegisterUse::kReadAccumulator, \
386 V(JumpIfTrueConstant, ImplicitRegisterUse::kReadAccumulator, \
388 V(JumpIfFalseConstant, ImplicitRegisterUse::kReadAccumulator, \
390 V(JumpIfJSReceiverConstant, ImplicitRegisterUse::kReadAccumulator, \
392 V(JumpIfForInDoneConstant, ImplicitRegisterUse::kNone, OperandType::kIdx, \
393 OperandType::kReg, OperandType::kReg) \
395 V(JumpIfToBooleanTrueConstant, ImplicitRegisterUse::kReadAccumulator, \
397 V(JumpIfToBooleanFalseConstant, ImplicitRegisterUse::kReadAccumulator, \
401 V(JumpIfToBooleanTrue, ImplicitRegisterUse::kReadAccumulator, \
402 OperandType::kUImm) \
403 V(JumpIfToBooleanFalse, ImplicitRegisterUse::kReadAccumulator, \
404 OperandType::kUImm) \
406 V(JumpIfTrue, ImplicitRegisterUse::kReadAccumulator, OperandType::kUImm) \
407 V(JumpIfFalse, ImplicitRegisterUse::kReadAccumulator, OperandType::kUImm) \
408 V(JumpIfNull, ImplicitRegisterUse::kReadAccumulator, OperandType::kUImm) \
409 V(JumpIfNotNull, ImplicitRegisterUse::kReadAccumulator, OperandType::kUImm) \
410 V(JumpIfUndefined, ImplicitRegisterUse::kReadAccumulator, \
411 OperandType::kUImm) \
412 V(JumpIfNotUndefined, ImplicitRegisterUse::kReadAccumulator, \
413 OperandType::kUImm) \
414 V(JumpIfUndefinedOrNull, ImplicitRegisterUse::kReadAccumulator, \
415 OperandType::kUImm) \
416 V(JumpIfJSReceiver, ImplicitRegisterUse::kReadAccumulator, \
417 OperandType::kUImm) \
418 V(JumpIfForInDone, ImplicitRegisterUse::kNone, OperandType::kUImm, \
419 OperandType::kReg, OperandType::kReg) \
422 V(SwitchOnSmiNoFeedback, ImplicitRegisterUse::kReadAccumulator, \
423 OperandType::kIdx, OperandType::kUImm, OperandType::kImm) \
426 V(ForInEnumerate, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg) \
427 V(ForInPrepare, ImplicitRegisterUse::kReadAndClobberAccumulator, \
428 OperandType::kRegOutTriple, OperandType::kIdx) \
429 V(ForInNext, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg, \
430 OperandType::kReg, OperandType::kRegPair, OperandType::kIdx) \
431 V(ForInStep, ImplicitRegisterUse::kNone, OperandType::kRegInOut) \
434 V(SetPendingMessage, ImplicitRegisterUse::kReadWriteAccumulator) \
437 V(Throw, ImplicitRegisterUse::kReadAccumulator) \
438 V(ReThrow, ImplicitRegisterUse::kReadAccumulator) \
439 V(Return, ImplicitRegisterUse::kReadAccumulator) \
440 V(ThrowReferenceErrorIfHole, ImplicitRegisterUse::kReadAccumulator, \
442 V(ThrowSuperNotCalledIfHole, ImplicitRegisterUse::kReadAccumulator) \
443 V(ThrowSuperAlreadyCalledIfNotHole, ImplicitRegisterUse::kReadAccumulator) \
444 V(ThrowIfNotSuperConstructor, ImplicitRegisterUse::kNone, OperandType::kReg) \
447 V(SwitchOnGeneratorState, ImplicitRegisterUse::kNone, OperandType::kReg, \
448 OperandType::kIdx, OperandType::kUImm) \
449 V(SuspendGenerator, ImplicitRegisterUse::kReadAccumulator, \
450 OperandType::kReg, OperandType::kRegList, OperandType::kRegCount, \
451 OperandType::kUImm) \
452 V(ResumeGenerator, ImplicitRegisterUse::kWriteAccumulator, \
453 OperandType::kReg, OperandType::kRegOutList, OperandType::kRegCount) \
456 V(GetIterator, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg, \
457 OperandType::kIdx, OperandType::kIdx) \
460 V(Debugger, ImplicitRegisterUse::kClobberAccumulator) \
463 V(IncBlockCounter, ImplicitRegisterUse::kNone, OperandType::kIdx) \
466 V(Abort, ImplicitRegisterUse::kNone, OperandType::kIdx)
468#ifdef V8_ENABLE_EXPERIMENTAL_TSA_BUILTINS
469#define BYTECODE_LIST_WITH_UNIQUE_HANDLERS(V, V_TSA) \
470 BYTECODE_LIST_WITH_UNIQUE_HANDLERS_IMPL(V, V_TSA)
472#define BYTECODE_LIST_WITH_UNIQUE_HANDLERS(V, V_TSA) \
473 BYTECODE_LIST_WITH_UNIQUE_HANDLERS_IMPL(V, V)
479#define BYTECODE_LIST(V, V_TSA) \
480 BYTECODE_LIST_WITH_UNIQUE_HANDLERS(V, V_TSA) \
483 SHORT_STAR_BYTECODE_LIST(V) \
486 V(Illegal, ImplicitRegisterUse::kNone)
489#define DEBUG_BREAK_PLAIN_BYTECODE_LIST(V) \
498#define DEBUG_BREAK_PREFIX_BYTECODE_LIST(V) \
500 V(DebugBreakExtraWide)
502#define DEBUG_BREAK_BYTECODE_LIST(V) \
503 DEBUG_BREAK_PLAIN_BYTECODE_LIST(V) \
504 DEBUG_BREAK_PREFIX_BYTECODE_LIST(V)
508#define JUMP_UNCONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) \
512#define JUMP_UNCONDITIONAL_CONSTANT_BYTECODE_LIST(V) V(JumpConstant)
514#define JUMP_TOBOOLEAN_CONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) \
515 V(JumpIfToBooleanTrue) \
516 V(JumpIfToBooleanFalse)
518#define JUMP_TOBOOLEAN_CONDITIONAL_CONSTANT_BYTECODE_LIST(V) \
519 V(JumpIfToBooleanTrueConstant) \
520 V(JumpIfToBooleanFalseConstant)
522#define JUMP_CONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) \
523 JUMP_TOBOOLEAN_CONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) \
529 V(JumpIfNotUndefined) \
530 V(JumpIfUndefinedOrNull) \
531 V(JumpIfJSReceiver) \
534#define JUMP_CONDITIONAL_CONSTANT_BYTECODE_LIST(V) \
535 JUMP_TOBOOLEAN_CONDITIONAL_CONSTANT_BYTECODE_LIST(V) \
536 V(JumpIfNullConstant) \
537 V(JumpIfNotNullConstant) \
538 V(JumpIfUndefinedConstant) \
539 V(JumpIfNotUndefinedConstant) \
540 V(JumpIfUndefinedOrNullConstant) \
541 V(JumpIfTrueConstant) \
542 V(JumpIfFalseConstant) \
543 V(JumpIfJSReceiverConstant) \
544 V(JumpIfForInDoneConstant)
546#define JUMP_CONSTANT_BYTECODE_LIST(V) \
547 JUMP_UNCONDITIONAL_CONSTANT_BYTECODE_LIST(V) \
548 JUMP_CONDITIONAL_CONSTANT_BYTECODE_LIST(V)
550#define JUMP_IMMEDIATE_BYTECODE_LIST(V) \
551 JUMP_UNCONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) \
552 JUMP_CONDITIONAL_IMMEDIATE_BYTECODE_LIST(V)
554#define JUMP_TO_BOOLEAN_BYTECODE_LIST(V) \
555 JUMP_TOBOOLEAN_CONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) \
556 JUMP_TOBOOLEAN_CONDITIONAL_CONSTANT_BYTECODE_LIST(V)
558#define JUMP_UNCONDITIONAL_BYTECODE_LIST(V) \
559 JUMP_UNCONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) \
560 JUMP_UNCONDITIONAL_CONSTANT_BYTECODE_LIST(V)
562#define JUMP_CONDITIONAL_BYTECODE_LIST(V) \
563 JUMP_CONDITIONAL_IMMEDIATE_BYTECODE_LIST(V) \
564 JUMP_CONDITIONAL_CONSTANT_BYTECODE_LIST(V)
566#define JUMP_FORWARD_BYTECODE_LIST(V) \
569 JUMP_CONDITIONAL_BYTECODE_LIST(V)
571#define JUMP_BYTECODE_LIST(V) \
572 JUMP_FORWARD_BYTECODE_LIST(V) \
575#define RETURN_BYTECODE_LIST(V) \
579#define UNCONDITIONAL_THROW_BYTECODE_LIST(V) \
585#define DECLARE_BYTECODE(Name, ...) k##Name,
587#undef DECLARE_BYTECODE
588#define COUNT_BYTECODE(x, ...) +1
600 static const int kMaxOperands = 5;
603 static const int kBytecodeCount =
static_cast<int>(Bytecode::kLast) + 1;
605 static const int kShortStarCount =
606 static_cast<int>(Bytecode::kLastShortStar) -
607 static_cast<int>(Bytecode::kFirstShortStar) + 1;
615 const char* separator =
".");
620 return static_cast<uint8_t
>(
bytecode);
633 switch (operand_scale) {
634 case OperandScale::kQuadruple:
635 return Bytecode::kExtraWide;
636 case OperandScale::kDouble:
637 return Bytecode::kWide;
645 return operand_scale != OperandScale::kSingle;
651#ifdef V8_TARGET_OS_ANDROID
658 if (bytecode == Bytecode::kWide || bytecode == Bytecode::kDebugBreakWide) {
659 return OperandScale::kDouble;
660 }
else if (bytecode == Bytecode::kExtraWide ||
661 bytecode == Bytecode::kDebugBreakExtraWide) {
662 return OperandScale::kQuadruple;
668 case Bytecode::kExtraWide:
669 case Bytecode::kDebugBreakExtraWide:
670 return OperandScale::kQuadruple;
671 case Bytecode::kWide:
672 case Bytecode::kDebugBreakWide:
673 return OperandScale::kDouble;
683 return kImplicitRegisterUse[
static_cast<size_t>(
bytecode)];
688 return BytecodeOperands::ReadsAccumulator(GetImplicitRegisterUse(bytecode));
693 return BytecodeOperands::WritesAccumulator(
694 GetImplicitRegisterUse(bytecode));
699 return BytecodeOperands::ClobbersAccumulator(
700 GetImplicitRegisterUse(bytecode));
705 return BytecodeOperands::WritesOrClobbersAccumulator(
706 GetImplicitRegisterUse(bytecode));
712 return BytecodeOperands::WritesImplicitRegister(
713 GetImplicitRegisterUse(bytecode));
719 static_assert(Bytecode::kLdar < Bytecode::kLdaImmutableCurrentContextSlot);
720 return bytecode >= Bytecode::kLdar &&
721 bytecode <= Bytecode::kLdaImmutableCurrentContextSlot;
727 static_assert(Bytecode::kTestReferenceEqual < Bytecode::kTestTypeOf);
728 return bytecode >= Bytecode::kTestReferenceEqual &&
729 bytecode <= Bytecode::kTestTypeOf;
733 return bytecode >= Bytecode::kFirstShortStar &&
734 bytecode <= Bytecode::kLastShortStar;
738 return bytecode == Bytecode::kStar || IsShortStar(bytecode);
744 return IsShortStar(bytecode) ||
745 (bytecode >= Bytecode::kStar && bytecode <= Bytecode::kPopContext);
751 return bytecode >= Bytecode::kJumpIfToBooleanTrue &&
752 bytecode <= Bytecode::kJumpIfForInDone;
758 return bytecode >= Bytecode::kJumpIfNullConstant &&
759 bytecode <= Bytecode::kJumpIfToBooleanFalseConstant;
765 return bytecode >= Bytecode::kJumpIfNullConstant &&
766 bytecode <= Bytecode::kJumpIfForInDone;
771 return bytecode >= Bytecode::kJumpLoop &&
772 bytecode <= Bytecode::kJumpConstant;
778 return bytecode == Bytecode::kJump || bytecode == Bytecode::kJumpLoop ||
779 IsConditionalJumpImmediate(bytecode);
785 return bytecode >= Bytecode::kJumpConstant &&
786 bytecode <= Bytecode::kJumpIfToBooleanFalseConstant;
792 return bytecode >= Bytecode::kJumpIfToBooleanTrueConstant &&
793 bytecode <= Bytecode::kJumpIfToBooleanFalse;
799 return bytecode >= Bytecode::kJumpLoop &&
800 bytecode <= Bytecode::kJumpIfForInDone;
806 return bytecode >= Bytecode::kJump &&
807 bytecode <= Bytecode::kJumpIfForInDone;
814 return IsJump(bytecode) && !IsJumpIfToBoolean(bytecode) &&
815 bytecode != Bytecode::kJumpLoop;
820 return bytecode == Bytecode::kSwitchOnSmiNoFeedback ||
821 bytecode == Bytecode::kSwitchOnGeneratorState;
827 return (IsAccumulatorLoadWithoutEffects(bytecode) ||
828 IsRegisterLoadWithoutEffects(bytecode) ||
829 IsCompareWithoutEffects(bytecode) ||
830 IsJumpWithoutEffects(bytecode) || IsSwitch(bytecode) ||
831 bytecode == Bytecode::kReturn);
836 return bytecode == Bytecode::kLdar || IsAnyStar(bytecode);
841 return bytecode == Bytecode::kCallAnyReceiver ||
842 bytecode == Bytecode::kCallProperty ||
843 bytecode == Bytecode::kCallProperty0 ||
844 bytecode == Bytecode::kCallProperty1 ||
845 bytecode == Bytecode::kCallProperty2 ||
846 bytecode == Bytecode::kCallUndefinedReceiver ||
847 bytecode == Bytecode::kCallUndefinedReceiver0 ||
848 bytecode == Bytecode::kCallUndefinedReceiver1 ||
849 bytecode == Bytecode::kCallUndefinedReceiver2 ||
850 bytecode == Bytecode::kConstruct ||
851 bytecode == Bytecode::kCallWithSpread ||
852 bytecode == Bytecode::kConstructWithSpread ||
853 bytecode == Bytecode::kConstructForwardAllArgs ||
854 bytecode == Bytecode::kCallJSRuntime;
859 return bytecode == Bytecode::kCallRuntime ||
860 bytecode == Bytecode::kCallRuntimeForPair ||
861 bytecode == Bytecode::kInvokeIntrinsic;
866 return bytecode == Bytecode::kExtraWide || bytecode == Bytecode::kWide ||
867 bytecode == Bytecode::kDebugBreakExtraWide ||
868 bytecode == Bytecode::kDebugBreakWide;
873#define OR_BYTECODE(NAME) || bytecode == Bytecode::k##NAME
880#define OR_BYTECODE(NAME) || bytecode == Bytecode::k##NAME
890 return kOperandCount[
static_cast<uint8_t
>(
bytecode)];
898 return GetOperandTypes(bytecode)[
i];
905 return kOperandTypes[
static_cast<size_t>(
bytecode)];
911 return kOperandTypeInfos[
static_cast<size_t>(
bytecode)][operand_index] ==
912 OperandTypeInfo::kScalableSignedByte;
918 return kOperandTypeInfos[
static_cast<size_t>(
bytecode)][operand_index] ==
919 OperandTypeInfo::kScalableUnsignedByte;
923 return OperandIsScalableSignedByte(bytecode, operand_index) ||
924 OperandIsScalableUnsignedByte(bytecode, operand_index);
928 static bool IsBytecodeWithScalableOperands(
Bytecode bytecode);
934 return GetOperandSizes(bytecode, operand_scale)[
i];
941 DCHECK_GE(operand_scale, OperandScale::kSingle);
942 DCHECK_LE(operand_scale, OperandScale::kLast);
943 static_assert(
static_cast<int>(OperandScale::kQuadruple) == 4 &&
944 OperandScale::kLast == OperandScale::kQuadruple);
945 int scale_index =
static_cast<int>(operand_scale) >> 1;
946 return kOperandSizes[scale_index][
static_cast<size_t>(
bytecode)];
954 DCHECK_GE(operand_scale, OperandScale::kSingle);
955 DCHECK_LE(operand_scale, OperandScale::kLast);
956 static_assert(
static_cast<int>(OperandScale::kQuadruple) == 4 &&
957 OperandScale::kLast == OperandScale::kQuadruple);
958 int scale_index =
static_cast<int>(operand_scale) >> 1;
959 return kOperandOffsets[scale_index][
static_cast<size_t>(
bytecode)][
i];
966 static_assert(
static_cast<int>(OperandScale::kQuadruple) == 4 &&
967 OperandScale::kLast == OperandScale::kQuadruple);
968 int scale_index =
static_cast<int>(operand_scale) >> 1;
969 return kBytecodeSizes[scale_index][
static_cast<size_t>(
bytecode)];
977 static bool MakesCallAlongCriticalPath(
Bytecode bytecode);
981 DCHECK(IsCallOrConstruct(bytecode) ||
982 bytecode == Bytecode::kInvokeIntrinsic);
984 case Bytecode::kCallProperty:
985 case Bytecode::kCallProperty0:
986 case Bytecode::kCallProperty1:
987 case Bytecode::kCallProperty2:
988 return ConvertReceiverMode::kNotNullOrUndefined;
989 case Bytecode::kCallUndefinedReceiver:
990 case Bytecode::kCallUndefinedReceiver0:
991 case Bytecode::kCallUndefinedReceiver1:
992 case Bytecode::kCallUndefinedReceiver2:
993 case Bytecode::kCallJSRuntime:
994 return ConvertReceiverMode::kNullOrUndefined;
995 case Bytecode::kCallAnyReceiver:
996 case Bytecode::kConstruct:
997 case Bytecode::kCallWithSpread:
998 case Bytecode::kConstructWithSpread:
999 case Bytecode::kInvokeIntrinsic:
1000 return ConvertReceiverMode::kAny;
1007 static bool IsDebugBreak(
Bytecode bytecode);
1010 static bool IsRegisterOperandType(
OperandType operand_type);
1013 static bool IsRegisterInputOperandType(
OperandType operand_type);
1016 static bool IsRegisterOutputOperandType(
OperandType operand_type);
1019 static bool IsRegisterListOperandType(
OperandType operand_type);
1030 switch (operand_type) {
1031 case OperandType::kReg:
1032 case OperandType::kRegOut:
1033 case OperandType::kRegInOut:
1035 case OperandType::kRegPair:
1036 case OperandType::kRegOutPair:
1038 case OperandType::kRegOutTriple:
1040 case OperandType::kRegList:
1041 case OperandType::kRegOutList:
1052 DCHECK_LE(operand_type, OperandType::kLast);
1053 DCHECK_GE(operand_scale, OperandScale::kSingle);
1054 DCHECK_LE(operand_scale, OperandScale::kLast);
1055 static_assert(
static_cast<int>(OperandScale::kQuadruple) == 4 &&
1056 OperandScale::kLast == OperandScale::kQuadruple);
1057 int scale_index =
static_cast<int>(operand_scale) >> 1;
1058 return kOperandKindSizes[scale_index][
static_cast<size_t>(operand_type)];
1065 static bool IsUnsignedOperandType(
OperandType operand_type);
1076 return OperandScale::kSingle;
1078 return OperandScale::kDouble;
1080 return OperandScale::kQuadruple;
1087 return OperandScale::kSingle;
1089 return OperandScale::kDouble;
1091 return OperandScale::kQuadruple;
1098 return OperandSize::kByte;
1100 return OperandSize::kShort;
1102 return OperandSize::kQuad;
1107 return reinterpret_cast<Address
>(
1108 const_cast<uint8_t*
>(&kBytecodeSizes[0][0]));
1114 static const int kOperandCount[];
1115 static const int kNumberOfRegisterOperands[];
1117 static const bool kIsScalable[];
1118 static const uint8_t kBytecodeSizes[3][kBytecodeCount];
1120 static const int*
const kOperandOffsets[3][kBytecodeCount];
1122 kOperandKindSizes[3][BytecodeOperands::kOperandTypeCount];
interpreter::Bytecode bytecode
#define OR_BYTECODE(NAME)
#define BYTECODE_LIST(V, V_TSA)
#define RETURN_BYTECODE_LIST(V)
#define UNCONDITIONAL_THROW_BYTECODE_LIST(V)
static bool ClobbersAccumulator(Bytecode bytecode)
static ImplicitRegisterUse GetImplicitRegisterUse(Bytecode bytecode)
static constexpr bool UnconditionallyThrows(Bytecode bytecode)
static constexpr bool IsJumpIfToBoolean(Bytecode bytecode)
static constexpr bool IsCompareWithoutEffects(Bytecode bytecode)
static constexpr bool Returns(Bytecode bytecode)
static const OperandType * GetOperandTypes(Bytecode bytecode)
static OperandScale ScaleForUnsignedOperand(uint32_t value)
static OperandSize GetOperandSize(Bytecode bytecode, int i, OperandScale operand_scale)
static constexpr bool IsConditionalJumpConstant(Bytecode bytecode)
static Bytecode FromByte(uint8_t value)
static OperandScale PrefixBytecodeToOperandScale(Bytecode bytecode)
static bool WritesAccumulator(Bytecode bytecode)
static constexpr bool IsAnyStar(Bytecode bytecode)
static constexpr bool IsConditionalJumpImmediate(Bytecode bytecode)
static int GetNumberOfRegistersRepresentedBy(OperandType operand_type)
static constexpr bool IsJumpImmediate(Bytecode bytecode)
static constexpr bool IsWithoutExternalSideEffects(Bytecode bytecode)
static constexpr bool IsForwardJump(Bytecode bytecode)
static constexpr bool IsCallRuntime(Bytecode bytecode)
static bool OperandIsScalableUnsignedByte(Bytecode bytecode, int operand_index)
static int GetOperandOffset(Bytecode bytecode, int i, OperandScale operand_scale)
static constexpr bool IsSwitch(Bytecode bytecode)
static constexpr bool IsJumpWithoutEffects(Bytecode bytecode)
static Bytecode OperandScaleToPrefixBytecode(OperandScale operand_scale)
static constexpr bool IsAccumulatorLoadWithoutEffects(Bytecode bytecode)
static Address bytecode_size_table_address()
static bool ReadsAccumulator(Bytecode bytecode)
static bool OperandIsScalable(Bytecode bytecode, int operand_index)
static OperandSize SizeOfOperand(OperandType operand_type, OperandScale operand_scale)
static constexpr bool IsCallOrConstruct(Bytecode bytecode)
static bool WritesImplicitRegister(Bytecode bytecode)
static uint8_t ToByte(Bytecode bytecode)
static OperandType GetOperandType(Bytecode bytecode, int i)
static constexpr bool IsJumpConstant(Bytecode bytecode)
static bool OperandIsScalableSignedByte(Bytecode bytecode, int operand_index)
static int Size(Bytecode bytecode, OperandScale operand_scale)
static constexpr bool IsPrefixScalingBytecode(Bytecode bytecode)
static OperandSize SizeForUnsignedOperand(uint32_t value)
static OperandScale ScaleForSignedOperand(int32_t value)
static constexpr bool IsRegisterLoadWithoutEffects(Bytecode bytecode)
static bool OperandScaleRequiresPrefixBytecode(OperandScale operand_scale)
static int NumberOfOperands(Bytecode bytecode)
static bool IsRuntimeIdOperandType(OperandType operand_type)
static constexpr bool IsConditionalJump(Bytecode bytecode)
static constexpr bool IsShortStar(Bytecode bytecode)
static constexpr bool IsLdarOrStar(Bytecode bytecode)
static ConvertReceiverMode GetReceiverMode(Bytecode bytecode)
static constexpr bool IsJump(Bytecode bytecode)
static bool WritesOrClobbersAccumulator(Bytecode bytecode)
static constexpr bool IsUnconditionalJump(Bytecode bytecode)
static const OperandSize * GetOperandSizes(Bytecode bytecode, OperandScale operand_scale)
constexpr const char * ToString(DataViewOp op)
std::ostream & operator<<(std::ostream &os, PaddingSpace padding)
DECLARE_BYTECODE(Name,...)
#define DCHECK_LE(v1, v2)
#define CHECK_LT(lhs, rhs)
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
#define V8_EXPORT_PRIVATE
std::unique_ptr< ValueMirror > value