25namespace interpreter {
52 feedback_vector_spec_(feedback_vector_spec),
53 bytecode_generated_(false),
54 constant_array_builder_(zone),
55 handler_table_builder_(zone),
58 local_register_count_(locals_count),
59 register_allocator_(fixed_register_count()),
60 bytecode_array_writer_(zone, &constant_array_builder_,
61 source_position_mode),
62 register_optimizer_(nullptr) {
90template <
typename IsolateT>
124template <
typename IsolateT>
137 LocalIsolate* isolate);
141 BytecodeSourceInfo source_position;
148 !
v8_flags.ignition_filter_expression_positions ||
154 return source_position;
159 if (!source_info.
is_valid())
return;
165 if (!node->source_info().is_valid()) {
168 node->source_info().is_expression()) {
171 node->set_source_info(source_position);
199 uint32_t operand =
static_cast<uint32_t
>(
reg.ToOperand());
205 uint32_t operand =
static_cast<uint32_t
>(
reg.ToOperand());
206 std::optional<Bytecode> short_code =
reg.TryToShortStar();
214 uint32_t operand0 =
static_cast<uint32_t
>(src.ToOperand());
215 uint32_t operand1 =
static_cast<uint32_t
>(dest.
ToOperand());
223template <OperandTypeInfo type_info>
224class UnsignedOperandHelper {
229 return static_cast<uint32_t
>(
value);
232 V8_INLINE static uint32_t Convert(BytecodeArrayBuilder* builder,
int value) {
234 return Convert(builder,
static_cast<size_t>(value));
238 static bool IsValid(
size_t value) {
240 case OperandTypeInfo::kFixedUnsignedByte:
242 case OperandTypeInfo::kFixedUnsignedShort:
244 case OperandTypeInfo::kScalableUnsignedByte:
252template <OperandType>
253class OperandHelper {};
255#define DEFINE_UNSIGNED_OPERAND_HELPER(Name, Type) \
257 class OperandHelper<OperandType::k##Name> \
258 : public UnsignedOperandHelper<Type> {};
261#undef DEFINE_UNSIGNED_OPERAND_HELPER
264class OperandHelper<OperandType::kImm> {
266 V8_INLINE static uint32_t Convert(BytecodeArrayBuilder* builder,
int value) {
267 return static_cast<uint32_t
>(
value);
272class OperandHelper<OperandType::kReg> {
274 V8_INLINE static uint32_t Convert(BytecodeArrayBuilder* builder,
276 return builder->GetInputRegisterOperand(
reg);
281class OperandHelper<OperandType::kRegList> {
283 V8_INLINE static uint32_t Convert(BytecodeArrayBuilder* builder,
284 RegisterList reg_list) {
285 return builder->GetInputRegisterListOperand(reg_list);
290class OperandHelper<OperandType::kRegPair> {
292 V8_INLINE static uint32_t Convert(BytecodeArrayBuilder* builder,
293 RegisterList reg_list) {
295 return builder->GetInputRegisterListOperand(reg_list);
300class OperandHelper<OperandType::kRegOut> {
302 V8_INLINE static uint32_t Convert(BytecodeArrayBuilder* builder,
304 return builder->GetOutputRegisterOperand(
reg);
309class OperandHelper<OperandType::kRegOutList> {
311 V8_INLINE static uint32_t Convert(BytecodeArrayBuilder* builder,
312 RegisterList reg_list) {
313 return builder->GetOutputRegisterListOperand(reg_list);
318class OperandHelper<OperandType::kRegOutPair> {
320 V8_INLINE static uint32_t Convert(BytecodeArrayBuilder* builder,
321 RegisterList reg_list) {
323 return builder->GetOutputRegisterListOperand(reg_list);
328class OperandHelper<OperandType::kRegOutTriple> {
330 V8_INLINE static uint32_t Convert(BytecodeArrayBuilder* builder,
331 RegisterList reg_list) {
333 return builder->GetOutputRegisterListOperand(reg_list);
338class OperandHelper<OperandType::kRegInOut> {
340 V8_INLINE static uint32_t Convert(BytecodeArrayBuilder* builder,
342 return builder->GetInputOutputRegisterOperand(
reg);
352 template <
typename... Operands>
354 Operands... operands) {
356 "too many operands for bytecode");
368 OperandHelper<operand_types>::Convert(builder, operands)...);
372#define DEFINE_BYTECODE_OUTPUT(name, ...) \
373 template <typename... Operands> \
374 BytecodeNode BytecodeArrayBuilder::Create##name##Node( \
375 Operands... operands) { \
376 return BytecodeNodeBuilder<Bytecode::k##name, __VA_ARGS__>::Make( \
377 this, operands...); \
380 template <typename... Operands> \
381 void BytecodeArrayBuilder::Output##name(Operands... operands) { \
382 BytecodeNode node(Create##name##Node(operands...)); \
386 template <typename... Operands> \
387 void BytecodeArrayBuilder::Output##name(BytecodeLabel* label, \
388 Operands... operands) { \
389 DCHECK(Bytecodes::IsForwardJump(Bytecode::k##name)); \
390 BytecodeNode node(Create##name##Node(operands...)); \
391 WriteJump(&node, label); \
394#undef DEFINE_BYTECODE_OUTPUT
397 int loop_depth,
int feedback_slot) {
415 OutputAdd(
reg, feedback_slot);
418 OutputSub(
reg, feedback_slot);
421 OutputMul(
reg, feedback_slot);
424 OutputDiv(
reg, feedback_slot);
427 OutputMod(
reg, feedback_slot);
430 OutputExp(
reg, feedback_slot);
433 OutputBitwiseOr(
reg, feedback_slot);
436 OutputBitwiseXor(
reg, feedback_slot);
439 OutputBitwiseAnd(
reg, feedback_slot);
442 OutputShiftLeft(
reg, feedback_slot);
445 OutputShiftRight(
reg, feedback_slot);
448 OutputShiftRightLogical(
reg, feedback_slot);
460 OutputAddSmi(
literal.value(), feedback_slot);
463 OutputSubSmi(
literal.value(), feedback_slot);
466 OutputMulSmi(
literal.value(), feedback_slot);
469 OutputDivSmi(
literal.value(), feedback_slot);
472 OutputModSmi(
literal.value(), feedback_slot);
475 OutputExpSmi(
literal.value(), feedback_slot);
478 OutputBitwiseOrSmi(
literal.value(), feedback_slot);
481 OutputBitwiseXorSmi(
literal.value(), feedback_slot);
484 OutputBitwiseAndSmi(
literal.value(), feedback_slot);
487 OutputShiftLeftSmi(
literal.value(), feedback_slot);
490 OutputShiftRightSmi(
literal.value(), feedback_slot);
493 OutputShiftRightLogicalSmi(
literal.value(), feedback_slot);
505 OutputInc(feedback_slot);
508 OutputDec(feedback_slot);
511 OutputToNumber(feedback_slot);
514 OutputNegate(feedback_slot);
517 OutputBitwiseNot(feedback_slot);
530 OutputToBooleanLogicalNot();
536 OutputTypeOf(feedback_slot);
541 OutputGetSuperConstructor(out);
548 OutputFindNonDefaultConstructorOrConstruct(this_function,
new_target, output);
556 OutputTestEqual(
reg, feedback_slot);
558 case Token::kEqStrict:
559 OutputTestEqualStrict(
reg, feedback_slot);
561 case Token::kLessThan:
562 OutputTestLessThan(
reg, feedback_slot);
564 case Token::kGreaterThan:
565 OutputTestGreaterThan(
reg, feedback_slot);
567 case Token::kLessThanEq:
568 OutputTestLessThanOrEqual(
reg, feedback_slot);
570 case Token::kGreaterThanEq:
571 OutputTestGreaterThanOrEqual(
reg, feedback_slot);
573 case Token::kInstanceOf:
574 OutputTestInstanceOf(
reg, feedback_slot);
577 OutputTestIn(
reg, feedback_slot);
586 OutputTestReferenceEqual(
reg);
591 OutputTestUndetectable();
596 OutputTestUndefined();
607 if (op == Token::kEq) {
622 DCHECK_NE(literal_flag, TestTypeOfFlags::LiteralFlag::kOther);
629 OutputLdaConstant(entry);
634 int32_t raw_smi = smi.value();
638 OutputLdaSmi(raw_smi);
650 OutputLdaConstant(entry);
658 OutputLdaConstant(entry);
665 OutputLdaConstant(entry);
671 OutputLdaConstant(entry);
677 OutputLdaConstant(entry);
682 OutputLdaUndefined();
758 switch (typeof_mode) {
760 OutputLdaGlobalInsideTypeof(name_index, feedback_slot);
763 OutputLdaGlobal(name_index, feedback_slot);
772 OutputStaGlobal(name_index, feedback_slot);
779 int slot_index = variable->index();
781 if (context.is_current_context() && depth == 0) {
782 OutputLdaImmutableCurrentContextSlot(slot_index);
784 OutputLdaImmutableContextSlot(context, slot_index, depth);
788 if (
v8_flags.script_context_mutable_heap_number &&
789 variable->scope()->is_script_scope()) {
790 if (context.is_current_context() && depth == 0) {
791 OutputLdaCurrentScriptContextSlot(slot_index);
793 OutputLdaScriptContextSlot(context, slot_index, depth);
796 if (context.is_current_context() && depth == 0) {
797 OutputLdaCurrentContextSlot(slot_index);
799 OutputLdaContextSlot(context, slot_index, depth);
809 int slot_index = variable->index();
810 if ((
v8_flags.script_context_mutable_heap_number ||
813 variable->scope()->is_script_scope()) {
814 if (context.is_current_context() && depth == 0) {
815 OutputStaCurrentScriptContextSlot(slot_index);
817 OutputStaScriptContextSlot(context, slot_index, depth);
820 if (context.is_current_context() && depth == 0) {
821 OutputStaCurrentContextSlot(slot_index);
823 OutputStaContextSlot(context, slot_index, depth);
832 switch (typeof_mode) {
834 OutputLdaLookupSlotInsideTypeof(name_index);
837 OutputLdaLookupSlot(name_index);
845 int slot_index,
int depth) {
847 switch (typeof_mode) {
849 if (
v8_flags.script_context_mutable_heap_number &&
851 OutputLdaLookupScriptContextSlotInsideTypeof(name_index, slot_index,
854 OutputLdaLookupContextSlotInsideTypeof(name_index, slot_index, depth);
858 if (
v8_flags.script_context_mutable_heap_number &&
860 OutputLdaLookupScriptContextSlot(name_index, slot_index, depth);
862 OutputLdaLookupContextSlot(name_index, slot_index, depth);
873 switch (typeof_mode) {
875 OutputLdaLookupGlobalSlotInsideTypeof(name_index, feedback_slot, depth);
878 OutputLdaLookupGlobalSlot(name_index, feedback_slot, depth);
890 OutputStaLookupSlot(name_index, flags);
897 OutputGetNamedProperty(
object, name_index, feedback_slot);
904 OutputGetNamedPropertyFromSuper(
object, name_index, feedback_slot);
909 Register object,
int feedback_slot) {
910 OutputGetKeyedProperty(
object, feedback_slot);
917 OutputGetEnumeratedKeyedProperty(
object, enum_index, cache_type,
923 Register object,
int feedback_slot) {
924 size_t name_index = IteratorSymbolConstantPoolEntry();
925 OutputGetNamedProperty(
object, name_index, feedback_slot);
930 Register object,
int load_feedback_slot,
int call_feedback_slot) {
931 OutputGetIterator(
object, load_feedback_slot, call_feedback_slot);
936 Register object,
int feedback_slot) {
937 size_t name_index = AsyncIteratorSymbolConstantPoolEntry();
938 OutputGetNamedProperty(
object, name_index, feedback_slot);
945 OutputDefineKeyedOwnPropertyInLiteral(
object, name, flags, feedback_slot);
950 Register object,
size_t name_index,
int feedback_slot,
956 OutputSetNamedProperty(
object, name_index, feedback_slot);
974 OutputDefineNamedOwnProperty(
object, name_index, feedback_slot);
985 OutputSetKeyedProperty(
object,
key, feedback_slot);
997 OutputDefineKeyedOwnProperty(
object,
key, flags, feedback_slot);
1003 OutputStaInArrayLiteral(array, index, feedback_slot);
1008 Register constructor,
int feedback_slot) {
1009 size_t name_index = ClassFieldsSymbolConstantPoolEntry();
1015 Register constructor,
int feedback_slot) {
1016 size_t name_index = ClassFieldsSymbolConstantPoolEntry();
1017 OutputGetNamedProperty(constructor, name_index, feedback_slot);
1022 size_t shared_function_info_entry,
int slot,
int flags) {
1023 OutputCreateClosure(shared_function_info_entry, slot, flags);
1028 const Scope* scope) {
1030 OutputCreateBlockContext(entry);
1037 OutputCreateCatchContext(exception, scope_index);
1042 const Scope* scope,
int slots) {
1044 OutputCreateFunctionContext(scope_index, slots);
1049 const Scope* scope,
int slots) {
1051 OutputCreateEvalContext(scope_index, slots);
1058 OutputCreateWithContext(
object, scope_index);
1066 OutputCreateMappedArguments();
1069 OutputCreateUnmappedArguments();
1072 OutputCreateRestParameter();
1083 OutputCreateRegExpLiteral(pattern_entry, literal_index, flags);
1088 int literal_index) {
1089 OutputCreateEmptyArrayLiteral(literal_index);
1094 size_t constant_elements_entry,
int literal_index,
int flags) {
1095 OutputCreateArrayLiteral(constant_elements_entry, literal_index, flags);
1100 OutputCreateArrayFromIterable();
1105 size_t constant_properties_entry,
int literal_index,
int flags) {
1106 OutputCreateObjectLiteral(constant_properties_entry, literal_index, flags);
1111 OutputCreateEmptyObjectLiteral();
1117 int feedback_slot) {
1118 OutputCloneObject(source, flags, feedback_slot);
1123 size_t template_object_description_entry,
int feedback_slot) {
1124 OutputGetTemplateObject(template_object_description_entry, feedback_slot);
1129 OutputPushContext(context);
1134 OutputPopContext(context);
1139 OutputToObject(out);
1165 OutputToNumber(feedback_slot);
1170 OutputToNumeric(feedback_slot);
1177 if (!
label->has_referrer_jump())
return *
this;
1247 OutputJump(
label, 0);
1255 OutputJumpIfTrue(
label, 0);
1258 OutputJumpIfToBooleanTrue(
label, 0);
1267 OutputJumpIfFalse(
label, 0);
1270 OutputJumpIfToBooleanFalse(
label, 0);
1277 OutputJumpIfNull(
label, 0);
1284 OutputJumpIfNotNull(
label, 0);
1291 OutputJumpIfUndefined(
label, 0);
1298 OutputJumpIfUndefinedOrNull(
label, 0);
1305 OutputJumpIfNotUndefined(
label, 0);
1312 if (op == Token::kEq) {
1330 if (op == Token::kEq) {
1348 OutputJumpIfJSReceiver(
label, 0);
1355 OutputJumpIfForInDone(
label, 0, index, cache_length);
1361 int feedback_slot) {
1385 OutputSetPendingMessage();
1400 DCHECK_LT(reason, AbortReason::kLastErrorMessage);
1401 DCHECK_GE(reason, AbortReason::kNoReason);
1402 OutputAbort(
static_cast<int>(reason));
1414 OutputThrowReferenceErrorIfHole(entry);
1419 OutputThrowSuperNotCalledIfHole();
1424 OutputThrowSuperAlreadyCalledIfNotHole();
1430 OutputThrowIfNotSuperConstructor(constructor);
1440 int coverage_array_slot) {
1441 OutputIncBlockCounter(coverage_array_slot);
1453 OutputForInPrepare(cache_info_triple, feedback_slot);
1459 int feedback_slot) {
1461 OutputForInNext(
receiver, index, cache_type_array_pair, feedback_slot);
1466 OutputForInStep(index);
1472 OutputStaModuleVariable(cell_index, depth);
1478 OutputLdaModuleVariable(cell_index, depth);
1506 int feedback_slot) {
1507 if (
args.register_count() == 1) {
1508 OutputCallProperty0(callable,
args[0], feedback_slot);
1509 }
else if (
args.register_count() == 2) {
1510 OutputCallProperty1(callable,
args[0],
args[1], feedback_slot);
1511 }
else if (
args.register_count() == 3) {
1512 OutputCallProperty2(callable,
args[0],
args[1],
args[2], feedback_slot);
1514 OutputCallProperty(callable,
args,
args.register_count(), feedback_slot);
1521 if (
args.register_count() == 0) {
1522 OutputCallUndefinedReceiver0(callable, feedback_slot);
1523 }
else if (
args.register_count() == 1) {
1524 OutputCallUndefinedReceiver1(callable,
args[0], feedback_slot);
1525 }
else if (
args.register_count() == 2) {
1526 OutputCallUndefinedReceiver2(callable,
args[0],
args[1], feedback_slot);
1528 OutputCallUndefinedReceiver(callable,
args,
args.register_count(),
1536 int feedback_slot) {
1537 OutputCallAnyReceiver(callable,
args,
args.register_count(), feedback_slot);
1543 int feedback_slot) {
1544 OutputCallWithSpread(callable,
args,
args.register_count(), feedback_slot);
1550 int feedback_slot_id) {
1551 OutputConstruct(constructor,
args,
args.register_count(), feedback_slot_id);
1557 OutputConstructWithSpread(constructor,
args,
args.register_count(),
1563 Register constructor,
int feedback_slot_id) {
1564 OutputConstructForwardAllArgs(constructor, feedback_slot_id);
1576 OutputInvokeIntrinsic(
static_cast<int>(intrinsic_id),
args,
1577 args.register_count());
1579 OutputCallRuntime(
static_cast<int>(function_id),
args,
1580 args.register_count());
1602 OutputCallRuntimeForPair(
static_cast<uint16_t
>(function_id),
args,
1603 args.register_count(), return_pair);
1614 OutputCallJSRuntime(context_index,
args,
args.register_count());
1621 OutputDeletePropertySloppy(
object);
1624 OutputDeletePropertyStrict(
object);
1651#define ENTRY_GETTER(NAME, ...) \
1652 size_t BytecodeArrayBuilder::NAME##ConstantPoolEntry() { \
1653 return constant_array_builder()->Insert##NAME(); \
1659 int size,
int case_value_base) {
1665 case_value_base,
zone());
1678 if (!
reg.is_valid()) {
1682 if (
reg.is_current_context() ||
reg.is_function_closure()) {
1684 }
else if (
reg.is_parameter()) {
1685 int parameter_index =
reg.ToParameterIndex();
1708template <Bytecode
bytecode, ImplicitRegisterUse implicit_register_use>
1718 return static_cast<uint32_t
>(
reg.ToOperand());
1724 return static_cast<uint32_t
>(
reg.ToOperand());
1733 return static_cast<uint32_t
>(
reg.ToOperand());
1741 return static_cast<uint32_t
>(reg_list.
first_register().ToOperand());
1749 return static_cast<uint32_t
>(reg_list.
first_register().ToOperand());
1764 return os <<
"AlreadyBoolean";
1766 return os <<
"ConvertToBoolean";
interpreter::Bytecode bytecode
#define ENTRY_GETTER(NAME,...)
#define DEFINE_UNSIGNED_OPERAND_HELPER(Name, Type)
#define DEFINE_BYTECODE_OUTPUT(name,...)
#define UNSIGNED_SCALABLE_SCALAR_OPERAND_TYPE_LIST(V)
#define UNSIGNED_FIXED_SCALAR_OPERAND_TYPE_LIST(V)
#define BYTECODE_LIST(V, V_TSA)
static FeedbackSlot ToSlot(intptr_t index)
static V8_EXPORT_PRIVATE const Function * FunctionForId(FunctionId id)
static constexpr Tagged< Smi > FromInt(int value)
BytecodeArrayBuilder & LoadLookupSlot(const AstRawString *name, TypeofMode typeof_mode)
BytecodeArrayBuilder(Zone *zone, int parameter_count, int locals_count, FeedbackVectorSpec *feedback_vector_spec=nullptr, SourcePositionTableBuilder::RecordingMode source_position_mode=SourcePositionTableBuilder::RECORD_SOURCE_POSITIONS)
BytecodeArrayBuilder & ThrowIfNotSuperConstructor(Register constructor)
BytecodeArrayBuilder & UnaryOperation(Token::Value op, int feedback_slot)
BytecodeArrayBuilder & CompareUndetectable()
uint32_t GetInputRegisterOperand(Register reg)
BytecodeArrayBuilder & ForInStep(Register index)
BytecodeArrayBuilder & StoreInArrayLiteral(Register array, Register index, int feedback_slot)
void PrepareToOutputBytecode()
BytecodeArrayBuilder & CreateEmptyObjectLiteral()
BytecodeArrayBuilder & CallJSRuntime(int context_index, RegisterList args)
BytecodeArrayBuilder & SetNamedProperty(Register object, const AstRawString *name, int feedback_slot, LanguageMode language_mode)
void SetDeferredSourceInfo(BytecodeSourceInfo source_info)
BytecodeArrayBuilder & TypeOf(int feedback_slot)
BytecodeArrayBuilder & ForInNext(Register receiver, Register index, RegisterList cache_type_array_pair, int feedback_slot)
BytecodeArrayBuilder & ReThrow()
BytecodeArrayBuilder & CallAnyReceiver(Register callable, RegisterList args, int feedback_slot)
BytecodeArrayBuilder & CreateCatchContext(Register exception, const Scope *scope)
BytecodeSourceInfo deferred_source_info_
BytecodeArrayBuilder & LoadIteratorProperty(Register object, int feedback_slot)
BytecodeArrayBuilder & GetTemplateObject(size_t template_object_description_entry, int feedback_slot)
BytecodeArrayBuilder & LoadAsyncIteratorProperty(Register object, int feedback_slot)
BytecodeArrayBuilder & ForInPrepare(RegisterList cache_info_triple, int feedback_slot)
BytecodeArrayBuilder & LoadClassFieldsInitializer(Register constructor, int feedback_slot)
BytecodeArrayBuilder & CreateBlockContext(const Scope *scope)
BytecodeArrayBuilder & LoadTheHole()
BytecodeArrayBuilder & ToNumber(int feedback_slot)
BytecodeArrayBuilder & Delete(Register object, LanguageMode language_mode)
bool RegisterIsValid(Register reg) const
BytecodeArrayBuilder & StoreContextSlot(Register context, Variable *variable, int depth)
BytecodeArrayBuilder & Abort(AbortReason reason)
BytecodeArrayBuilder & ToBoolean(ToBooleanMode mode)
BytecodeArrayBuilder & LoadGlobal(const AstRawString *name, int feedback_slot, TypeofMode typeof_mode)
uint16_t parameter_count_
BytecodeArrayBuilder & CallUndefinedReceiver(Register callable, RegisterList args, int feedback_slot)
BytecodeArrayBuilder & LoadModuleVariable(int cell_index, int depth)
uint32_t GetOutputRegisterListOperand(RegisterList reg_list)
BytecodeArrayBuilder & ToObject(Register out)
BytecodeArrayBuilder & SuspendGenerator(Register generator, RegisterList registers, int suspend_id)
BytecodeArrayBuilder & CreateClosure(size_t shared_function_info_entry, int slot, int flags)
V8_INLINE void OutputJumpLoop(BytecodeLoopHeader *loop_header, int loop_depth, int feedback_slot)
BytecodeArrayBuilder & GetIterator(Register object, int load_feedback_slot, int call_feedback_slot)
BytecodeArrayBuilder & JumpIfNotNil(BytecodeLabel *label, Token::Value op, NilValue nil)
Register Local(int index) const
BytecodeRegisterOptimizer * register_optimizer_
BytecodeArrayBuilder & LoadContextSlot(Register context, Variable *variable, int depth, ContextSlotMutability immutable)
void OutputMovRaw(Register src, Register dest)
void AttachOrEmitDeferredSourceInfo(BytecodeNode *node)
BytecodeArrayBuilder & ThrowSuperNotCalledIfHole()
BytecodeArrayBuilder & ThrowSuperAlreadyCalledIfNotHole()
BytecodeArrayBuilder & DefineKeyedOwnPropertyInLiteral(Register object, Register name, DefineKeyedOwnPropertyInLiteralFlags flags, int feedback_slot)
BytecodeArrayBuilder & JumpIfForInDone(BytecodeLabel *label, Register index, Register cache_length)
BytecodeArrayBuilder & LoadUndefined()
BytecodeArrayBuilder & JumpIfNull(BytecodeLabel *label)
BytecodeArrayBuilder & CompareNil(Token::Value op, NilValue nil)
bool RegisterListIsValid(RegisterList reg_list) const
BytecodeJumpTable * AllocateJumpTable(int size, int case_value_base)
BytecodeArrayBuilder & ToNumeric(int feedback_slot)
BytecodeArrayBuilder & LoadLiteral(Tagged< Smi > value)
BytecodeArrayBuilder & StoreAccumulatorInRegister(Register reg)
BytecodeArrayBuilder & LogicalNot(ToBooleanMode mode)
BytecodeArrayBuilder & Return()
V8_INLINE void OutputSwitchOnSmiNoFeedback(BytecodeJumpTable *jump_table)
BytecodeArrayBuilder & CreateRegExpLiteral(const AstRawString *pattern, int literal_index, int flags)
BytecodeArrayBuilder & CompareReference(Register reg)
void Write(BytecodeNode *node)
Register Receiver() const
bool RemainderOfBlockIsDead() const
BytecodeArrayBuilder & LoadTrue()
BytecodeArrayWriter bytecode_array_writer_
BytecodeArrayBuilder & LoadNamedProperty(Register object, const AstRawString *name, int feedback_slot)
BytecodeArrayBuilder & CompareNull()
int total_register_count() const
BytecodeArrayBuilder & MarkTryEnd(int handler_id)
BytecodeArrayBuilder & JumpIfFalse(ToBooleanMode mode, BytecodeLabel *label)
HandlerTableBuilder * handler_table_builder()
BytecodeArrayBuilder & ResumeGenerator(Register generator, RegisterList registers)
BytecodeArrayBuilder & MarkTryBegin(int handler_id, Register context)
void WriteJumpLoop(BytecodeNode *node, BytecodeLoopHeader *loop_header)
int local_register_count_
BytecodeArrayBuilder & Bind(BytecodeLabel *label)
BytecodeArrayBuilder & JumpIfUndefined(BytecodeLabel *label)
void EmitFunctionStartSourcePosition(int position)
BytecodeRegisterAllocator register_allocator_
BytecodeArrayBuilder & SwitchOnSmiNoFeedback(BytecodeJumpTable *jump_table)
BytecodeArrayBuilder & JumpIfTrue(ToBooleanMode mode, BytecodeLabel *label)
BytecodeSourceInfo latest_source_info_
BytecodeArrayBuilder & CallRuntimeForPair(Runtime::FunctionId function_id, RegisterList args, RegisterList return_pair)
BytecodeArrayBuilder & JumpIfNotNull(BytecodeLabel *label)
BytecodeArrayBuilder & CompareOperation(Token::Value op, Register reg, int feedback_slot)
BytecodeArrayBuilder & MarkHandler(int handler_id, HandlerTable::CatchPrediction will_catch)
BytecodeArrayBuilder & SetPendingMessage()
BytecodeArrayBuilder & ForInEnumerate(Register receiver)
ConstantArrayBuilder * constant_array_builder()
BytecodeArrayBuilder & CreateEvalContext(const Scope *scope, int slots)
Register Parameter(int parameter_index) const
BytecodeArrayBuilder & LoadNull()
BytecodeArrayBuilder & FindNonDefaultConstructorOrConstruct(Register this_function, Register new_target, RegisterList output)
BytecodeArrayBuilder & LoadKeyedProperty(Register object, int feedback_slot)
uint16_t max_arguments() const
BytecodeArrayBuilder & CreateFunctionContext(const Scope *scope, int slots)
BytecodeArrayBuilder & ThrowReferenceErrorIfHole(const AstRawString *name)
void WriteSwitch(BytecodeNode *node, BytecodeJumpTable *label)
BytecodeArrayBuilder & CloneObject(Register source, int flags, int feedback_slot)
uint32_t GetInputOutputRegisterOperand(Register reg)
BytecodeArrayBuilder & LoadLookupContextSlot(const AstRawString *name, TypeofMode typeof_mode, ContextKind context_kind, int slot_index, int depth)
BytecodeArrayBuilder & MoveRegister(Register from, Register to)
BytecodeArrayBuilder & PopContext(Register context)
uint32_t GetOutputRegisterOperand(Register reg)
BytecodeArrayBuilder & BinaryOperationSmiLiteral(Token::Value binop, Tagged< Smi > literal, int feedback_slot)
BytecodeArrayBuilder & JumpIfNotUndefined(BytecodeLabel *label)
size_t AllocateDeferredConstantPoolEntry()
BytecodeArrayBuilder & StoreClassFieldsInitializer(Register constructor, int feedback_slot)
uint32_t GetInputRegisterListOperand(RegisterList reg_list)
BytecodeArrayBuilder & CreateEmptyArrayLiteral(int literal_index)
BytecodeArrayBuilder & StoreLookupSlot(const AstRawString *name, LanguageMode language_mode, LookupHoistingMode lookup_hoisting_mode)
BytecodeArrayBuilder & CreateArrayFromIterable()
BytecodeArrayBuilder & StoreModuleVariable(int cell_index, int depth)
BytecodeArrayBuilder & ConstructForwardAllArgs(Register constructor, int feedback_slot)
BytecodeArrayBuilder & ToName()
void WriteJump(BytecodeNode *node, BytecodeLabel *label)
V8_INLINE BytecodeSourceInfo CurrentSourcePosition(Bytecode bytecode)
BytecodeArrayBuilder & SwitchOnGeneratorState(Register generator, BytecodeJumpTable *jump_table)
BytecodeArrayBuilder & CallWithSpread(Register callable, RegisterList args, int feedback_slot)
BytecodeArrayBuilder & GetSuperConstructor(Register out)
BytecodeArrayBuilder & ConstructWithSpread(Register constructor, RegisterList args, int feedback_slot)
BytecodeArrayBuilder & LoadEnumeratedKeyedProperty(Register object, Register enum_index, Register cache_type, int feedback_slot)
void OutputStarRaw(Register reg)
BytecodeArrayBuilder & DefineNamedOwnProperty(Register object, const AstRawString *name, int feedback_slot)
BytecodeArrayBuilder & JumpLoop(BytecodeLoopHeader *loop_header, int loop_depth, int position, int feedback_slot)
BytecodeArrayBuilder & LoadFalse()
BytecodeArrayBuilder & BinaryOperation(Token::Value binop, Register reg, int feedback_slot)
BytecodeArrayBuilder & LoadBoolean(bool value)
BytecodeArrayBuilder & StoreGlobal(const AstRawString *name, int feedback_slot)
void OutputLdarRaw(Register reg)
BytecodeArrayBuilder & SetKeyedProperty(Register object, Register key, int feedback_slot, LanguageMode language_mode)
DirectHandle< TrustedByteArray > ToSourcePositionTable(IsolateT *isolate)
BytecodeArrayBuilder & IncBlockCounter(int slot)
BytecodeArrayBuilder & CreateObjectLiteral(size_t constant_properties_entry, int literal_index, int flags)
BytecodeArrayBuilder & LoadAccumulatorWithRegister(Register reg)
BytecodeArrayBuilder & Jump(BytecodeLabel *label)
BytecodeArrayBuilder & CallProperty(Register callable, RegisterList args, int feedback_slot)
BytecodeRegisterAllocator * register_allocator()
Handle< BytecodeArray > ToBytecodeArray(IsolateT *isolate)
BytecodeArrayBuilder & LoadLookupGlobalSlot(const AstRawString *name, TypeofMode typeof_mode, int feedback_slot, int depth)
BytecodeArrayBuilder & DefineKeyedOwnProperty(Register object, Register key, DefineKeyedOwnPropertyFlags flags, int feedback_slot)
BytecodeArrayBuilder & ToString()
BytecodeArrayBuilder & PushContext(Register context)
size_t GetConstantPoolEntry(const AstRawString *raw_string)
BytecodeArrayBuilder & LoadConstantPoolEntry(size_t entry)
BytecodeArrayBuilder & Throw()
BytecodeArrayBuilder & CreateWithContext(Register object, const Scope *scope)
BytecodeArrayBuilder & Construct(Register constructor, RegisterList args, int feedback_slot)
BytecodeArrayBuilder & CreateArguments(CreateArgumentsType type)
BytecodeArrayBuilder & JumpIfJSReceiver(BytecodeLabel *label)
BytecodeArrayBuilder & Debugger()
BytecodeArrayBuilder & CompareUndefined()
BytecodeArrayBuilder & LoadNamedPropertyFromSuper(Register object, const AstRawString *name, int feedback_slot)
int fixed_register_count() const
BytecodeArrayBuilder & JumpIfUndefinedOrNull(BytecodeLabel *label)
BytecodeArrayBuilder & CompareTypeOf(TestTypeOfFlags::LiteralFlag literal_flag)
BytecodeArrayBuilder & CreateArrayLiteral(size_t constant_elements_entry, int literal_index, int flags)
uint16_t parameter_count() const
BytecodeArrayBuilder & JumpIfNil(BytecodeLabel *label, Token::Value op, NilValue nil)
const FeedbackVectorSpec * feedback_vector_spec() const
void SetDeferredConstantPoolEntry(size_t entry, Handle< Object > object)
BytecodeArrayBuilder & CallRuntime(Runtime::FunctionId function_id, RegisterList args)
void Write(BytecodeNode *node)
void BindLoopHeader(BytecodeLoopHeader *loop_header)
void SetFunctionEntrySourcePosition(int position)
void WriteSwitch(BytecodeNode *node, BytecodeJumpTable *jump_table)
void WriteJump(BytecodeNode *node, BytecodeLabel *label)
Handle< BytecodeArray > ToBytecodeArray(IsolateT *isolate, int register_count, uint16_t parameter_count, uint16_t max_arguments, DirectHandle< TrustedByteArray > handler_table)
DirectHandle< TrustedByteArray > ToSourcePositionTable(IsolateT *isolate)
void BindLabel(BytecodeLabel *label)
void BindTryRegionEnd(HandlerTableBuilder *handler_table_builder, int handler_id)
void BindHandlerTarget(HandlerTableBuilder *handler_table_builder, int handler_id)
void BindJumpTableEntry(BytecodeJumpTable *jump_table, int case_value)
void WriteJumpLoop(BytecodeNode *node, BytecodeLoopHeader *loop_header)
void BindTryRegionStart(HandlerTableBuilder *handler_table_builder, int handler_id)
size_t constant_pool_index() const
int case_value_base() const
static V8_INLINE BytecodeNode Make(BytecodeArrayBuilder *builder, Operands... operands)
static V8_INLINE BytecodeNode Create(BytecodeSourceInfo source_info)
bool RegisterIsLive(Register reg) const
void ResetTypeHintForAccumulator()
V8_INLINE void PrepareForBytecode()
RegisterList GetInputRegisterList(RegisterList reg_list)
bool EnsureAllRegistersAreFlushed() const
int maxiumum_register_index() const
bool IsAccumulatorReset()
void DoLdar(Register input)
void DoStar(Register output)
void DoMov(Register input, Register output)
void PrepareOutputRegisterList(RegisterList reg_list)
Register GetInputRegister(Register reg)
void PrepareOutputRegister(Register reg)
void ForceExpressionPosition(int source_position)
int source_position() const
bool is_statement() const
void MakeStatementPosition(int source_position)
static constexpr bool IsWithoutExternalSideEffects(Bytecode bytecode)
static const int kMaxOperands
static OperandSize SizeForUnsignedOperand(uint32_t value)
void SetDeferredAt(size_t index, Handle< Object > object)
size_t InsertJumpTable(size_t size)
size_t Insert(Tagged< Smi > smi)
void SetContextRegister(int handler_id, Register reg)
void SetPrediction(int handler_id, HandlerTable::CatchPrediction prediction)
DirectHandle< TrustedByteArray > ToHandlerTable(IsolateT *isolate)
static V8_EXPORT_PRIVATE bool IsSupported(Runtime::FunctionId function_id)
static IntrinsicId FromRuntimeId(Runtime::FunctionId function_id)
int register_count() const
const Register first_register() const
BytecodeArrayBuilder * builder_
void EmitStar(Register output) override
void EmitMov(Register input, Register output) override
~RegisterTransferWriter() override=default
RegisterTransferWriter(BytecodeArrayBuilder *builder)
void EmitLdar(Register input) override
static constexpr Register FromParameterIndex(int index)
constexpr int32_t ToOperand() const
static uint8_t Encode(LanguageMode language_mode, LookupHoistingMode lookup_hoisting_mode)
static uint8_t Encode(LiteralFlag literal_flag)
#define SINGLETON_CONSTANT_ENTRY_TYPES(V)
base::Vector< const DirectHandle< Object > > args
DirectHandle< Object > new_target
#define EXPORT_TEMPLATE_DEFINE(export)
FunctionLiteral * literal
RegListBase< RegisterT > registers
std::ostream & operator<<(std::ostream &os, PaddingSpace padding)
constexpr int kNoSourcePosition
bool DoubleToSmiInteger(double value, int *smi_int_value)
LanguageMode GetLanguageModeFromSlotKind(FeedbackSlotKind kind)
TypeofMode GetTypeofModeFromSlotKind(FeedbackSlotKind kind)
V8_EXPORT_PRIVATE FlagValues v8_flags
constexpr uint32_t kMaxUInt32
#define NON_EXPORTED_BASE(code)
#define DCHECK_LE(v1, v2)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK_NE(v1, v2)
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
#define DCHECK_EQ(v1, v2)
#define DCHECK_GT(v1, v2)
#define V8_EXPORT_PRIVATE