5#ifndef V8_MAGLEV_ARM64_MAGLEV_ASSEMBLER_ARM64_INL_H_
6#define V8_MAGLEV_ARM64_MAGLEV_ASSEMBLER_ARM64_INL_H_
43class MaglevAssembler::TemporaryRegisterScope
44 :
public TemporaryRegisterScopeBase<TemporaryRegisterScope> {
45 using Base = TemporaryRegisterScopeBase<TemporaryRegisterScope>;
48 struct SavedData :
public Base::SavedData {
105 MaglevAssembler::TemporaryRegisterScope temps(
masm_);
106 Register temp = temps.AcquireScratch();
107 masm_->Move(temp, map);
109 masm_->JumpIf(cond, if_true, distance);
127template <
typename Arg>
135 if (input.operand().IsConstant()) {
139 compiler::AllocatedOperand::cast(input.operand());
147template <
typename Arg>
162 const Input& input) {
163 if (input.operand().IsConstant()) {
165 input.node()->LoadToRegister(masm,
reg);
169 compiler::AllocatedOperand::cast(input.operand());
171 return ToRegister(input);
180template <
typename... Args>
188template <
typename Arg,
typename... Args>
193 arg_count =
static_cast<int>(std::distance(arg.begin(), arg.end()));
199template <
typename... Args>
202template <
typename... Args>
207template <
typename... Args>
213struct PushAllHelper<> {
218template <
typename T,
typename... Args>
222 for (
auto iter = range.begin(),
end = range.end(); iter !=
end; ++iter) {
223 value_type val1 = *iter;
226 PushAll(masm, val1,
args...);
229 value_type val2 = *iter;
230 masm->
Push(val1, val2);
232 PushAll(masm,
args...);
235template <
typename T,
typename... Args>
236inline void PushIteratorReverse(MaglevAssembler* masm,
237 base::iterator_range<T> range, Args...
args) {
238 using value_type =
typename base::iterator_range<T>::value_type;
239 using difference_type =
typename base::iterator_range<T>::difference_type;
240 difference_type count = std::distance(range.begin(), range.end());
242 auto iter = range.rbegin();
243 auto end = range.rend();
244 if (count % 2 != 0) {
245 PushAllReverse(masm, *iter,
args...);
250 while (iter !=
end) {
251 value_type val1 = *iter;
253 value_type val2 = *iter;
255 masm->Push(val1, val2);
259template <
typename Arg1,
typename Arg2>
265 masm->MacroAssembler::Push(ToRegister(masm, &temps, arg1),
266 ToRegister(masm, &temps, arg2));
275 masm->MacroAssembler::Push(ToRegister(masm, &temps, arg1),
padreg);
279 masm->MacroAssembler::str(ToRegister(masm, &temps, arg2),
MemOperand(sp));
283template <
typename Arg>
289 FATAL(
"Unaligned push");
296 PushAllReverse(masm, arg,
padreg);
301template <
typename Arg1,
typename Arg2,
typename... Args>
307 if (arg2.begin() != arg2.end()) {
308 auto val = *arg2.begin();
311 base::make_iterator_range(std::next(arg2.begin()), arg2.end()),
314 PushAll(masm, arg1,
args...);
318 PushAll(masm,
args...);
326 if (arg2.begin() != arg2.end()) {
327 auto val = *arg2.begin();
330 base::make_iterator_range(std::next(arg2.begin()), arg2.end()),
334 PushAllReverse(masm, arg1,
args...);
337 PushAllReverse(masm,
args...);
345template <
typename... T>
347 const int push_count = detail::CountPushHelper<T...>::Count(vals...);
348 if (push_count % 2 == 0) {
355template <
typename... T>
365 if (block->is_start_block_of_switch_case()) {
368 Bind(block->label());
375 Adds(dst.W(), src.W(), src.W());
385 Adds(wzr, obj.W(), obj.W());
390 int value, Label* fail,
407 int value, Label* fail,
429 if (input.operand().IsRegister()) {
432 DCHECK(input.operand().IsStackSlot());
433 TemporaryRegisterScope temps(
this);
434 Register scratch = temps.AcquireScratch();
449 const compiler::AllocatedOperand& operand) {
454 const compiler::InstructionOperand& operand) {
469 TemporaryRegisterScope scope(
this);
476 Add(data_pointer, data_pointer, base);
480 Register data_pointer, Register index,
int element_size) {
481 Add(data_pointer, data_pointer,
493 Register index,
int scale,
503#ifdef V8_ENABLE_SANDBOX
510#ifdef V8_ENABLE_SANDBOX
522 AbortReason::kUnexpectedNegativeValue);
535 Register
result, Register array, Register index) {
539 AbortReason::kUnexpectedNegativeValue);
549 MaglevAssembler::TemporaryRegisterScope temps(
this);
550 Register scratch = temps.AcquireScratch();
553 AbortReason::kUnexpectedValue);
555 AbortReason::kUnexpectedNegativeValue);
563 TemporaryRegisterScope temps(
this);
564 Register scratch = temps.AcquireScratch();
573 }
else if (size == 2) {
584 Ldrb(
result.W(), operand);
585 }
else if (size == 2) {
586 Ldrh(
result.W(), operand);
599 Register slot_reg, Register
object, Register index) {
611 Register array, Register index, Register value) {
612 TemporaryRegisterScope temps(
this);
613 Register scratch = temps.AcquireScratch();
627 TemporaryRegisterScope temps(
this);
628 Register scratch = temps.AcquireScratch();
639 TemporaryRegisterScope scope(
this);
640 Register scratch = scope.AcquireScratch().W();
641 Move(scratch, value);
647 DCHECK(size == 1 || size == 2 || size == 4);
649 Strb(value.W(), operand);
650 }
else if (size == 2) {
651 Strh(value.W(), operand);
654 Str(value.W(), operand);
658#ifdef V8_ENABLE_SANDBOX
660inline void MaglevAssembler::StoreTrustedPointerFieldNoWriteBarrier(
661 Register
object,
int offset, Register value) {
672 }
else if (size == 4) {
688 Add(
reg.W(),
reg.W(), Immediate(amount));
716 DCHECK(location.IsImmediateOffset());
717 Add(dst.X(), location.base(), Immediate(location.offset()));
763 Mov(dst.W(), Immediate(
i));
766 Mov(dst.W(), Immediate(
i));
775 Fmov(dst, n.get_scalar());
778 Mov(dst, Operand(obj));
781#ifdef V8_COMPRESS_POINTERS
784 Mov(dst, Operand(obj));
801 TemporaryRegisterScope temps(
this);
803 Fcvt(scratch.S(), src);
804 Str(scratch.S(), dst);
820 TemporaryRegisterScope temps(
this);
821 Register scratch = temps.AcquireScratch();
823 Rev(scratch, scratch);
833 TemporaryRegisterScope temps(
this);
834 Register scratch = temps.AcquireScratch();
836 Rev(scratch, scratch);
841 Mov(dst, Operand(src.W(),
SXTW));
844 Neg(val.W(), val.W());
849 Label* max, Label* done) {
850 TemporaryRegisterScope temps(
this);
853 Fcmp(scratch, value);
857 Move(scratch, 255.0);
858 Fcmp(value, scratch);
861 Frintn(scratch, value);
866template <
typename NodeT>
876 Tst(scratch.W(), Immediate(JSArrayBuffer::WasDetachedBit::kMask));
885 Register map, Register scratch) {
887 And(scratch.W(), scratch.W(),
888 Map::Bits1::IsUndetectableBit::kMask | Map::Bits1::IsCallableBit::kMask);
889 Cmp(scratch.W(), Map::Bits1::IsCallableBit::kMask);
894 Register map, Register scratch) {
896 Tst(scratch.W(), Immediate(Map::Bits1::IsUndetectableBit::kMask |
897 Map::Bits1::IsCallableBit::kMask));
902 Register heap_object) {
903 LoadMap(instance_type, heap_object);
904 Ldrh(instance_type.W(),
911 TemporaryRegisterScope temps(
this);
912 Register scratch = temps.AcquireScratch();
921 TemporaryRegisterScope temps(
this);
922 Register scratch = temps.AcquireScratch();
930 TemporaryRegisterScope temps(
this);
931 Register scratch = temps.AcquireScratch();
938 Register heap_object,
InstanceType type, Label* if_true,
939 Label::Distance true_distance,
bool fallthrough_when_true, Label* if_false,
941 TemporaryRegisterScope temps(
this);
942 Register scratch = temps.AcquireScratch();
944 Branch(
kEqual, if_true, true_distance, fallthrough_when_true, if_false,
945 false_distance, fallthrough_when_false);
953 TemporaryRegisterScope temps(
this);
954 Register scratch = temps.AcquireScratch();
962 TemporaryRegisterScope temps(
this);
963 Register scratch = temps.AcquireScratch();
972 TemporaryRegisterScope temps(
this);
973 Register scratch = temps.AcquireScratch();
981 Label* if_true,
Label::Distance true_distance,
bool fallthrough_when_true,
983 bool fallthrough_when_false) {
984 TemporaryRegisterScope temps(
this);
985 Register scratch = temps.AcquireScratch();
988 if_false, false_distance, fallthrough_when_false);
991#if V8_STATIC_ROOTS_BOOL
992inline void MaglevAssembler::JumpIfObjectInRange(Register heap_object,
998 DCHECK_LE(lower_limit, StaticReadOnlyRoot::kLastAllocatedRoot);
999 DCHECK_LE(higher_limit, StaticReadOnlyRoot::kLastAllocatedRoot);
1000 TemporaryRegisterScope temps(
this);
1001 Register scratch = temps.AcquireScratch();
1003 CompareRange(heap_object, scratch, lower_limit, higher_limit);
1007inline void MaglevAssembler::JumpIfObjectNotInRange(Register heap_object,
1013 DCHECK_LE(lower_limit, StaticReadOnlyRoot::kLastAllocatedRoot);
1014 DCHECK_LE(higher_limit, StaticReadOnlyRoot::kLastAllocatedRoot);
1015 TemporaryRegisterScope temps(
this);
1016 Register scratch = temps.AcquireScratch();
1018 CompareRange(heap_object, scratch, lower_limit, higher_limit);
1022inline void MaglevAssembler::AssertObjectInRange(Register heap_object,
1027 DCHECK_LE(lower_limit, StaticReadOnlyRoot::kLastAllocatedRoot);
1028 DCHECK_LE(higher_limit, StaticReadOnlyRoot::kLastAllocatedRoot);
1029 TemporaryRegisterScope temps(
this);
1030 Register scratch = temps.AcquireScratch();
1032 CompareRange(heap_object, scratch, lower_limit, higher_limit);
1039 TemporaryRegisterScope temps(
this);
1040 Register scratch = temps.AcquireScratch();
1059 TemporaryRegisterScope temps(
this);
1060 Register scratch = temps.AcquireScratch();
1065 Register map, Register instance_type_out,
InstanceType lower_limit,
1077 JumpIf(cond, target, distance);
1082 BasicBlock* if_true, BasicBlock* if_false, BasicBlock* next_block,
1083 BasicBlock* nan_failed) {
1086 Branch(cond, if_true, if_false, next_block);
1090 int num_double_registers) {}
1129 Label* if_not_equal,
1157 ZoneLabelRef is_not_hole(
this);
1162 ZoneLabelRef is_hole, ZoneLabelRef is_not_hole) {
1163 masm->Umov(scratch.W(), value.V2S(), 1);
1166 masm->Jump(*is_not_hole);
1168 value, scratch, is_hole, is_not_hole));
1176 Umov(scratch.W(), value.V2S(), 1);
1183 MaglevAssembler::TemporaryRegisterScope temps(
this);
1184 Register upper_bits = temps.AcquireScratch();
1185 DCHECK(operand.IsImmediateOffset() && operand.shift_amount() == 0);
1188 operand.addrmode()));
1234 Cmp(r1.W(), r2.W());
1240 Cmp(r1.W(), Immediate(value));
1245 Register r1, int32_t value,
Condition cond, Label* if_true,
1246 Label::Distance true_distance,
bool fallthrough_when_true, Label* if_false,
1248 Cmp(r1.W(), Immediate(value));
1249 Branch(cond, if_true, true_distance, fallthrough_when_true, if_false,
1250 false_distance, fallthrough_when_false);
1254 Register r1, Register value,
Condition cond, Label* if_true,
1255 Label::Distance true_distance,
bool fallthrough_when_true, Label* if_false,
1257 Cmp(r1.W(), value.W());
1258 Branch(cond, if_true, true_distance, fallthrough_when_true, if_false,
1259 false_distance, fallthrough_when_false);
1263 Register r1, int32_t value,
Condition cond, Label* if_true,
1264 Label::Distance true_distance,
bool fallthrough_when_true, Label* if_false,
1266 Cmp(r1.X(), Immediate(value));
1267 Branch(cond, if_true, true_distance, fallthrough_when_true, if_false,
1268 false_distance, fallthrough_when_false);
1305 Handle<HeapObject> obj,
1312 JumpIf(cond, target, distance);
1321 JumpIf(cond, target, distance);
1333 TemporaryRegisterScope temps(
this);
1335 Ldr(value_double, operand);
1346 TemporaryRegisterScope temps(
this);
1347 Register value = temps.AcquireScratch().W();
1348 Ldr(value, operand);
1354 TemporaryRegisterScope temps(
this);
1355 Register value = temps.AcquireScratch().W();
1367 TemporaryRegisterScope temps(
this);
1368 Register value = temps.AcquireScratch().W();
1369 Ldr(value, operand);
1375 TemporaryRegisterScope temps(
this);
1376 Register value = temps.AcquireScratch().W();
1382 Register heap_number) {
1387 Register heap_number) {
1392 Register heap_number) {
1415 TemporaryRegisterScope temps(
this);
1416 Register scratch = temps.AcquireScratch();
1422 Assert(
eq, AbortReason::kStackAccessBelowStackPointer);
1427 int stack_check_offset) {
1428 TemporaryRegisterScope temps(
this);
1431 stack_cmp_reg = temps.AcquireScratch();
1432 Sub(stack_cmp_reg, sp, stack_check_offset);
1434 Register interrupt_stack_limit = temps.AcquireScratch();
1436 Cmp(stack_cmp_reg, interrupt_stack_limit);
1444template <
typename NodeT>
1460 return Ldr(dst.
W(), src);
1465 return Ldr(dst, src);
1475 return Str(src.W(), dst);
1480 return Str(src, dst);
#define Assert(condition)
interpreter::OperandScale scale
typename std::iterator_traits< iterator >::value_type value_type
void bl(int branch_offset, Condition cond=al, RelocInfo::Mode rmode=RelocInfo::NO_INFO)
void ForceConstantPoolEmissionWithoutJump()
static constexpr size_t kMaxSizeInHeap
Tagged_t ReadOnlyRootPtr(RootIndex index)
void JumpIfRoot(Register with, RootIndex index, Label *if_equal)
void LoadStackLimit(Register destination, StackLimitKind kind)
void Fcvt(const VRegister &fd, const VRegister &fn)
void Cmp(const Register &rn, int imm)
void CompareInstanceType(Register map, Register type_reg, InstanceType type)
void Orr(const Register &rd, const Register &rn, const Operand &operand)
void Neg(const Register &rd, const Operand &operand)
void Add(const Register &rd, const Register &rn, const Operand &operand)
void IsObjectType(Register heap_object, Register scratch1, Register scratch2, InstanceType type)
void Adds(const Register &rd, const Register &rn, const Operand &operand)
void Bind(Label *label, BranchTargetIdentifier id=BranchTargetIdentifier::kNone)
void AssertNotSmi(Register object, AbortReason reason=AbortReason::kOperandIsASmi) NOOP_UNLESS_DEBUG_CODE
static CPURegList DefaultTmpList()
void JumpIfNotRoot(Register with, RootIndex index, Label *if_not_equal)
void CompareAndBranch(const Register &lhs, const Operand &rhs, Condition cond, Label *label)
void Fmov(VRegister fd, VRegister fn)
void CompareRoot(Register obj, RootIndex index)
void Move(Register dst, Tagged< Smi > smi)
void Lsr(const Register &rd, const Register &rn, unsigned shift)
void Tst(const Register &rn, const Operand &operand)
void Sxth(const Register &rd, const Register &rn)
void JumpIfSmi(Register value, Label *smi_label)
void LoadSandboxedPointerField(Register destination, MemOperand field_operand)
void TestAndBranchIfAllClear(const Register ®, const uint64_t bit_pattern, Label *label)
void Scvtf(const VRegister &fd, const Register &rn, unsigned fbits=0)
void JumpIfJSAnyIsNotPrimitive(Register heap_object, Register scratch, Label *target, Label::Distance distance=Label::kFar, Condition condition=Condition::kUnsignedGreaterThanEqual)
void CompareTaggedAndBranch(const Register &lhs, const Operand &rhs, Condition cond, Label *label)
void Lsl(const Register &rd, const Register &rn, unsigned shift)
void SmiTag(Register reg, SBit s=LeaveCC)
void EnterExitFrame(Register scratch, int stack_space, StackFrame::Type frame_type)
void Ldr(const CPURegister &rt, const Operand &imm)
void AssertSmi(Register object, AbortReason reason=AbortReason::kOperandIsNotASmi) NOOP_UNLESS_DEBUG_CODE
void Mov(const Register &rd, const Operand &operand, DiscardMoveMode discard_mode=kDontDiscardForSameWReg)
void And(Register dst, Register src1, const Operand &src2, Condition cond=al)
void IsObjectTypeInRange(Register heap_object, Register scratch, InstanceType lower_limit, InstanceType higher_limit)
void Umov(const Register &rd, const VRegister &vn, int vn_index)
void Fcmp(const VRegister &fn, const VRegister &fm)
void StoreTaggedField(const Register &value, const MemOperand &dst_field_operand)
void Ucvtf(const VRegister &fd, const Register &rn, unsigned fbits=0)
void LoadTaggedField(const Register &destination, const MemOperand &field_operand)
void CompareRange(Register value, Register scratch, unsigned lower_limit, unsigned higher_limit)
void Subs(const Register &rd, const Register &rn, const Operand &operand)
void Rev(const Register &rd, const Register &rn)
void JumpIfNotSmi(Register value, Label *not_smi_label)
void LoadCompressedMap(Register dst, Register object)
void CmpTagged(const Register &r1, const Register &r2)
void TestAndBranchIfAnySet(const Register ®, const uint64_t bit_pattern, Label *label)
void StoreTrustedPointerField(Register value, MemOperand dst_field_operand)
void Sub(const Register &rd, const Register &rn, const Operand &operand)
void Rev16(const Register &rd, const Register &rn)
void CompareInstanceTypeRange(Register map, Register type_reg, Register scratch, InstanceType lower_limit, InstanceType higher_limit)
void BindJumpTarget(Label *label)
void Rev32(const Register &rd, const Register &rn)
void LoadMap(Register destination, Register object)
static CPURegList DefaultFPTmpList()
void LoadTaggedFieldWithoutDecompressing(const Register &destination, const MemOperand &field_operand)
static Operand EmbeddedHeapNumber(double number)
constexpr bool has(RegisterT reg) const
@ COMPRESSED_EMBEDDED_OBJECT
static constexpr bool IsReadOnly(RootIndex root_index)
static constexpr Tagged< Smi > FromInt(int value)
static constexpr int kFixedFrameSizeFromFp
CPURegList * AvailableFP()
void SetAvailable(RegList available)
void Include(const Register ®1, const Register ®2=no_reg)
void SetAvailableFP(const CPURegList &list)
static LocationOperand * cast(InstructionOperand *op)
DoubleRegList available_double_
SavedData CopyForDeferBase()
Register AcquireScratch()
DoubleRegister AcquireScratchDouble()
UseScratchRegisterScope scratch_scope_
void ResetToDefaultImpl()
TemporaryRegisterScope(MaglevAssembler *masm)
void IncludeScratch(Register reg)
TemporaryRegisterScope(MaglevAssembler *masm, const SavedData &saved_data)
void CompareMapWithRoot(Register object, RootIndex index, Register scratch)
void LoadFixedArrayElement(Register result, Register array, Register index)
void CompareInstanceType(Register map, InstanceType instance_type)
void SmiAddConstant(Register dst, Register src, int value, Label *fail, Label::Distance distance=Label::kFar)
void JumpIfByte(Condition cc, Register value, int32_t byte, Label *target, Label::Distance distance=Label::kFar)
void JumpIfNotNan(DoubleRegister value, Label *target, Label::Distance distance=Label::kFar)
Condition IsNotCallableNorUndetactable(Register map, Register scratch)
void JumpIfRoot(Register with, RootIndex index, Label *if_equal, Label::Distance distance=Label::kFar)
void ToUint8Clamped(Register result, DoubleRegister value, Label *min, Label *max, Label *done)
Condition IsCallableAndNotUndetectable(Register map, Register scratch)
void LoadFloat32(DoubleRegister dst, MemOperand src)
void JumpIfNotObjectType(Register heap_object, InstanceType type, Label *target, Label::Distance distance=Label::kFar)
void ReverseByteOrderAndStoreUnalignedFloat64(Register base, Register index, DoubleRegister src)
void AssertStackSizeCorrect()
void IncrementInt32(Register reg)
void IntPtrToDouble(DoubleRegister result, Register src)
void Branch(Condition condition, BasicBlock *if_true, BasicBlock *if_false, BasicBlock *next_block)
void AndInt32(Register reg, int mask)
void AddInt32(Register reg, int amount)
MemOperand GetStackSlot(const compiler::AllocatedOperand &operand)
void StoreField(MemOperand operand, Register value, int element_size)
void LoadSignedField(Register result, MemOperand operand, int element_size)
void DecrementInt32(Register reg)
void JumpIfSmi(Register src, Label *on_smi, Label::Distance near_jump=Label::kFar)
MaglevAssembler(Isolate *isolate, Zone *zone, MaglevCodeGenState *code_gen_state)
void TestUint8AndJumpIfAllClear(MemOperand operand, uint8_t mask, Label *target, Label::Distance distance=Label::kFar)
void AssertObjectTypeInRange(Register heap_object, InstanceType lower_limit, InstanceType higher_limit, AbortReason reason)
void CompareInt32AndAssert(Register r1, Register r2, Condition cond, AbortReason reason)
void CompareDoubleAndJumpIfZeroOrNaN(DoubleRegister reg, Label *target, Label::Distance distance=Label::kFar)
void LoadFixedDoubleArrayElement(DoubleRegister result, Register array, Register index)
void LoadUnsignedField(Register result, MemOperand operand, int element_size)
void JumpIfObjectTypeInRange(Register heap_object, InstanceType lower_limit, InstanceType higher_limit, Label *target, Label::Distance distance=Label::kFar)
void CheckInt32IsSmi(Register obj, Label *fail, Register scratch=Register::no_reg())
void PushReverse(T... vals)
void ReverseByteOrder(Register value, int element_size)
Condition FunctionEntryStackCheck(int stack_check_offset)
void EmitEagerDeoptStress(Label *label)
void LoadHeapNumberValue(DoubleRegister result, Register heap_number)
void Jump(Label *target, Label::Distance distance=Label::kFar)
MemOperand DataViewElementOperand(Register data_pointer, Register index)
void StoreTaggedSignedField(Register object, int offset, Register value)
void CompareSmiAndJumpIf(Register r1, Tagged< Smi > value, Condition cond, Label *target, Label::Distance distance=Label::kFar)
TemporaryRegisterScope * scratch_register_scope() const
void TestUint8AndJumpIfAnySet(MemOperand operand, uint8_t mask, Label *target, Label::Distance distance=Label::kFar)
void MoveRepr(MachineRepresentation repr, Dest dst, Source src)
void StoreFixedDoubleArrayElement(Register array, Register index, DoubleRegister value)
void SmiTagInt32AndSetFlags(Register dst, Register src)
void BindBlock(BasicBlock *block)
void LoadInstanceType(Register instance_type, Register heap_object)
void StoreHeapInt32Value(Register value, Register heap_number)
void LoadInt32(Register dst, MemOperand src)
void StoreFixedArrayElementNoWriteBarrier(Register array, Register index, Register value)
void LoadAddress(Register dst, MemOperand location)
void JumpIfJSAnyIsNotPrimitive(Register heap_object, Label *target, Label::Distance distance=Label::kFar)
void LoadBoundedSizeFromObject(Register result, Register object, int offset)
void SetSlotAddressForTaggedField(Register slot_reg, Register object, int offset)
void CompareFloat64AndBranch(DoubleRegister src1, DoubleRegister src2, Condition cond, BasicBlock *if_true, BasicBlock *if_false, BasicBlock *next_block, BasicBlock *nan_failed)
void CompareTaggedAndJumpIf(Register reg, Tagged< Smi > smi, Condition cond, Label *target, Label::Distance distance=Label::kFar)
void StoreInt32Field(Register object, int offset, int32_t value)
Register GetFramePointer()
void BranchOnObjectTypeInRange(Register heap_object, InstanceType lower_limit, InstanceType higher_limit, Label *if_true, Label::Distance true_distance, bool fallthrough_when_true, Label *if_false, Label::Distance false_distance, bool fallthrough_when_false)
void LoadExternalPointerField(Register result, MemOperand operand)
void StoreInt32(MemOperand dst, Register src)
void BuildTypedArrayDataPointer(Register data_pointer, Register object)
void JumpIfObjectTypeNotInRange(Register heap_object, InstanceType lower_limit, InstanceType higher_limit, Label *target, Label::Distance distance=Label::kFar)
void ShiftLeft(Register reg, int amount)
void JumpIfNotRoot(Register with, RootIndex index, Label *if_not_equal, Label::Distance distance=Label::kFar)
void EmitEnterExitFrame(int extra_slots, StackFrame::Type frame_type, Register c_function, Register scratch)
void BranchOnObjectType(Register heap_object, InstanceType type, Label *if_true, Label::Distance true_distance, bool fallthrough_when_true, Label *if_false, Label::Distance false_distance, bool fallthrough_when_false)
void LoadHeapInt32Value(Register result, Register heap_number)
void CompareInstanceTypeRange(Register map, InstanceType lower_limit, InstanceType higher_limit)
void Move(StackSlot dst, Register src)
void SignExtend32To64Bits(Register dst, Register src)
void LoadFixedArrayElementWithoutDecompressing(Register result, Register array, Register index)
void LoadUnalignedFloat64AndReverseByteOrder(DoubleRegister dst, Register base, Register index)
void IncrementAddress(Register reg, int32_t delta)
Label * MakeDeferredCode(Function &&deferred_code_gen, Args &&... args)
void JumpIfNan(DoubleRegister value, Label *target, Label::Distance distance=Label::kFar)
void TruncateDoubleToInt32(Register dst, DoubleRegister src)
void JumpIfNotSmi(Register src, Label *on_not_smi, Label::Distance near_jump=Label::kFar)
MemOperand TypedArrayElementOperand(Register data_pointer, Register index, int element_size)
MaglevCompilationInfo * compilation_info() const
void TestInt32AndJumpIfAllClear(Register r1, int32_t mask, Label *target, Label::Distance distance=Label::kFar)
int GetFramePointerOffsetForStackSlot(const compiler::AllocatedOperand &operand)
void CompareInt32AndJumpIf(Register r1, Register r2, Condition cond, Label *target, Label::Distance distance=Label::kFar)
MaglevCodeGenState * code_gen_state() const
void SetSlotAddressForFixedArrayElement(Register slot_reg, Register object, Register index)
void LoadTaggedFieldByIndex(Register result, Register object, Register index, int scale, int offset)
void CompareIntPtrAndJumpIf(Register r1, Register r2, Condition cond, Label *target, Label::Distance distance=Label::kFar)
void CompareInt32AndBranch(Register r1, int32_t value, Condition cond, BasicBlock *if_true, BasicBlock *if_false, BasicBlock *next_block)
void CompareSmiAndAssert(Register r1, Tagged< Smi > value, Condition cond, AbortReason reason)
void JumpIf(Condition cond, Label *target, Label::Distance distance=Label::kFar)
void LoadFloat64(DoubleRegister dst, MemOperand src)
void LoadUnalignedFloat64(DoubleRegister dst, Register base, Register index)
void LoadTaggedFieldWithoutDecompressing(Register result, Register object, int offset)
Condition IsRootConstant(Input input, RootIndex root_index)
void StoreFloat32(MemOperand dst, DoubleRegister src)
void EmitEagerDeoptIf(Condition cond, DeoptimizeReason reason, NodeT *node)
void StoreFloat64(MemOperand dst, DoubleRegister src)
void NegateInt32(Register val)
bool IsDeoptLabel(Label *label)
void EmitEagerDeoptIfNotEqual(DeoptimizeReason reason, NodeT *node)
void StoreTaggedFieldNoWriteBarrier(Register object, int offset, Register value)
MemOperand ToMemOperand(const compiler::InstructionOperand &operand)
void MoveHeapNumber(Register dst, double value)
void LoadTaggedField(Register result, MemOperand operand)
void LoadByte(Register dst, MemOperand src)
void MoveTagged(Register dst, Handle< HeapObject > obj)
void JumpIfNotHoleNan(DoubleRegister value, Register scratch, Label *target, Label::Distance distance=Label::kFar)
void DeoptIfBufferDetached(Register array, Register scratch, NodeT *node)
void StoreUnalignedFloat64(Register base, Register index, DoubleRegister src)
void TestInt32AndJumpIfAnySet(Register r1, int32_t mask, Label *target, Label::Distance distance=Label::kFar)
void JumpIfHoleNan(DoubleRegister value, Register scratch, Label *target, Label::Distance distance=Label::kFar)
void Uint32ToDouble(DoubleRegister result, Register src)
void CompareFloat64AndJumpIf(DoubleRegister src1, DoubleRegister src2, Condition cond, Label *target, Label *nan_failed, Label::Distance distance=Label::kFar)
void CompareIntPtrAndBranch(Register r1, int32_t value, Condition cond, BasicBlock *if_true, BasicBlock *if_false, BasicBlock *next_block)
void Int32ToDouble(DoubleRegister result, Register src)
void JumpIfObjectType(Register heap_object, InstanceType type, Label *target, Label::Distance distance=Label::kFar)
void AssertObjectType(Register heap_object, InstanceType type, AbortReason reason)
void SmiSubConstant(Register dst, Register src, int value, Label *fail, Label::Distance distance=Label::kFar)
void OrInt32(Register reg, int mask)
void BindJumpTarget(Label *label)
void JumpToDeopt(Label *target)
MemOperand StackSlotOperand(StackSlot slot)
void CompareByteAndJumpIf(MemOperand left, int8_t right, Condition cond, Register scratch, Label *target, Label::Distance distance=Label::kFar)
void PrepareCallCFunction(int num_reg_arguments, int num_double_registers=0)
void MaybeEmitPlaceHolderForDeopt()
static int TemporaryCount(size_t map_count)
MapCompare(MaglevAssembler *masm, Register object, size_t map_count)
void Generate(Handle< Map > map, Condition cond, Label *if_true, Label::Distance distance=Label::kFar)
static ZoneLabelRef UnsafeFromLabelPointer(Label *label)
#define COMPRESS_POINTERS_BOOL
base::Vector< const DirectHandle< Object > > args
ZoneVector< RpoNumber > & result
base::SmallVector< int32_t, 1 > stack_slots
MaglevAssembler *const masm_
void PushAllReverse(BaselineAssembler *basm, Args... args)
void PushAllReverse(MaglevAssembler *masm, Args... args)
void PushAligned(MaglevAssembler *masm, Arg1 arg1, Arg2 arg2)
bool AlreadyInARegister(Arg arg)
void PushAll(MaglevAssembler *masm, Args... args)
void PushIterator(MaglevAssembler *masm, base::iterator_range< T > range, Args... args)
void PushIteratorReverse(MaglevAssembler *masm, base::iterator_range< T > range, Args... args)
constexpr Condition ConditionForNaN()
constexpr Condition ConditionFor(Operation operation)
int ShiftFromScale(int n)
Register ToRegister(const compiler::InstructionOperand &operand)
constexpr Condition ConditionForFloat64(Operation operation)
NodeTMixin< Node, Derived > NodeT
constexpr int kTaggedSize
@ kUnsignedGreaterThanEqual
DwVfpRegister DoubleRegister
MemOperand FieldMemOperand(Register object, int offset)
constexpr int kSystemPointerSize
constexpr int kStackLimitSlackForDeoptimizationInBytes
constexpr int kTaggedSizeLog2
constexpr bool SmiValuesAre31Bits()
Condition NegateCondition(Condition cond)
V8_EXPORT_PRIVATE FlagValues v8_flags
constexpr bool SmiValuesAre32Bits()
constexpr uint32_t kHoleNanUpper32
constexpr int kDoubleSizeLog2
constexpr int kDoubleSize
constexpr Register padreg
constexpr bool PointerCompressionIsEnabled()
#define DCHECK_LE(v1, v2)
#define DCHECK_NE(v1, v2)
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
constexpr T RoundUp(T x, intptr_t m)
CPURegList available_scratch_
CPURegList available_fp_scratch_
static int Count(Arg arg, Args... args)
static void Push(MaglevAssembler *masm, Arg1 arg1, Arg2 arg2, Args... args)
static void PushReverse(MaglevAssembler *masm, Arg1 arg1, Arg2 arg2, Args... args)
static void PushReverse(MaglevAssembler *masm, Arg arg)
static void Push(MaglevAssembler *masm, Arg arg)
static void PushReverse(MaglevAssembler *masm)
static void Push(MaglevAssembler *masm)
#define OFFSET_OF_DATA_START(Type)
#define V8_STATIC_ROOTS_BOOL