5 #ifndef INCLUDED_FROM_MACRO_ASSEMBLER_H 6 #error This header must be included via macro-assembler.h 9 #ifndef V8_X64_MACRO_ASSEMBLER_X64_H_ 10 #define V8_X64_MACRO_ASSEMBLER_X64_H_ 12 #include "src/bailout-reason.h" 13 #include "src/base/flags.h" 14 #include "src/contexts.h" 15 #include "src/globals.h" 16 #include "src/x64/assembler-x64.h" 22 constexpr Register kReturnRegister0 = rax;
23 constexpr Register kReturnRegister1 = rdx;
24 constexpr Register kReturnRegister2 = r8;
25 constexpr Register kJSFunctionRegister = rdi;
26 constexpr Register kContextRegister = rsi;
27 constexpr Register kAllocateSizeRegister = rdx;
28 constexpr Register kSpeculationPoisonRegister = r12;
29 constexpr Register kInterpreterAccumulatorRegister = rax;
30 constexpr Register kInterpreterBytecodeOffsetRegister = r9;
31 constexpr Register kInterpreterBytecodeArrayRegister = r14;
32 constexpr Register kInterpreterDispatchTableRegister = r15;
34 constexpr Register kJavaScriptCallArgCountRegister = rax;
35 constexpr Register kJavaScriptCallCodeStartRegister = rcx;
36 constexpr Register kJavaScriptCallTargetRegister = kJSFunctionRegister;
37 constexpr Register kJavaScriptCallNewTargetRegister = rdx;
38 constexpr Register kJavaScriptCallExtraArg1Register = rbx;
40 constexpr Register kRuntimeCallFunctionRegister = rbx;
41 constexpr Register kRuntimeCallArgCountRegister = rax;
42 constexpr Register kRuntimeCallArgvRegister = r15;
43 constexpr Register kWasmInstanceRegister = rsi;
48 constexpr Register kScratchRegister = r10;
49 constexpr XMMRegister kScratchDoubleReg = xmm15;
50 constexpr Register kRootRegister = r13;
52 constexpr Register kOffHeapTrampolineRegister = kScratchRegister;
55 typedef Operand MemOperand;
57 class StringConstantBase;
59 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
60 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
64 : reg(index_register),
70 enum StackArgumentsAccessorReceiverMode {
71 ARGUMENTS_CONTAIN_RECEIVER,
72 ARGUMENTS_DONT_CONTAIN_RECEIVER
78 StackArgumentsAccessorReceiverMode receiver_mode =
79 ARGUMENTS_CONTAIN_RECEIVER,
80 int extra_displacement_to_last_argument = 0)
81 : base_reg_(base_reg),
82 argument_count_reg_(no_reg),
83 argument_count_immediate_(argument_count_immediate),
84 receiver_mode_(receiver_mode),
85 extra_displacement_to_last_argument_(
86 extra_displacement_to_last_argument) {}
89 StackArgumentsAccessorReceiverMode receiver_mode =
90 ARGUMENTS_CONTAIN_RECEIVER,
91 int extra_displacement_to_last_argument = 0)
92 : base_reg_(base_reg),
93 argument_count_reg_(argument_count_reg),
94 argument_count_immediate_(0),
95 receiver_mode_(receiver_mode),
96 extra_displacement_to_last_argument_(
97 extra_displacement_to_last_argument) {}
101 StackArgumentsAccessorReceiverMode receiver_mode =
102 ARGUMENTS_CONTAIN_RECEIVER,
103 int extra_displacement_to_last_argument = 0);
105 Operand GetArgumentOperand(
int index);
107 DCHECK(receiver_mode_ == ARGUMENTS_CONTAIN_RECEIVER);
108 return GetArgumentOperand(0);
114 const int argument_count_immediate_;
115 const StackArgumentsAccessorReceiverMode receiver_mode_;
116 const int extra_displacement_to_last_argument_;
126 TurboAssembler(Isolate* isolate,
const AssemblerOptions& options,
127 void* buffer,
int buffer_size,
128 CodeObjectRequired create_code_object)
129 : TurboAssemblerBase(isolate, options, buffer, buffer_size,
130 create_code_object) {}
132 template <
typename Dst,
typename... Args>
137 template <void (
Assembler::*avx)(Dst, Dst, Args...),
139 void emit(Dst dst, Args... args) {
140 if (CpuFeatures::IsSupported(AVX)) {
142 (assm->*avx)(dst, dst, args...);
144 (assm->*no_avx)(dst, args...);
149 template <void (
Assembler::*avx)(Dst, Args...),
151 void emit(Dst dst, Args... args) {
152 if (CpuFeatures::IsSupported(AVX)) {
154 (assm->*avx)(dst, args...);
156 (assm->*no_avx)(dst, args...);
161 #define AVX_OP(macro_name, name) \ 162 template <typename Dst, typename... Args> \ 163 void macro_name(Dst dst, Args... args) { \ 164 AvxHelper<Dst, Args...>{this} \ 165 .template emit<&Assembler::v##name, &Assembler::name>(dst, args...); \ 175 AVX_OP(Movaps, movaps)
176 AVX_OP(Movapd, movapd)
177 AVX_OP(Movups, movups)
178 AVX_OP(Movmskps, movmskps)
179 AVX_OP(Movmskpd, movmskpd)
182 AVX_OP(Pcmpeqd, pcmpeqd)
192 AVX_OP(Cmpeqps, cmpeqps)
193 AVX_OP(Cmpltps, cmpltps)
194 AVX_OP(Cmpleps, cmpleps)
195 AVX_OP(Cmpneqps, cmpneqps)
196 AVX_OP(Cmpnltps, cmpnltps)
197 AVX_OP(Cmpnleps, cmpnleps)
198 AVX_OP(Cmpeqpd, cmpeqpd)
199 AVX_OP(Cmpltpd, cmpltpd)
200 AVX_OP(Cmplepd, cmplepd)
201 AVX_OP(Cmpneqpd, cmpneqpd)
202 AVX_OP(Cmpnltpd, cmpnltpd)
203 AVX_OP(Cmpnlepd, cmpnlepd)
204 AVX_OP(Roundss, roundss)
205 AVX_OP(Roundsd, roundsd)
206 AVX_OP(Sqrtss, sqrtss)
207 AVX_OP(Sqrtsd, sqrtsd)
208 AVX_OP(Ucomiss, ucomiss)
209 AVX_OP(Ucomisd, ucomisd)
213 void PushReturnAddressFrom(
Register src) { pushq(src); }
214 void PopReturnAddressTo(
Register dst) { popq(dst); }
220 void Ret(
int bytes_dropped, Register scratch);
224 void Set(Operand dst, intptr_t x);
227 void LoadRoot(Register destination, RootIndex index)
override;
228 void LoadRoot(Operand destination, RootIndex index) {
229 LoadRoot(kScratchRegister, index);
230 movp(destination, kScratchRegister);
233 void Push(Register src);
234 void Push(Operand src);
235 void Push(Immediate value);
237 void Push(Handle<HeapObject> source);
246 void PrepareCallCFunction(
int num_arguments);
253 void CallCFunction(ExternalReference
function,
int num_arguments);
254 void CallCFunction(Register
function,
int num_arguments);
258 int ArgumentStackSlotsForCFunctionCall(
int num_arguments);
260 void CheckPageFlag(Register
object, Register scratch,
int mask, Condition cc,
261 Label* condition_met,
262 Label::Distance condition_met_distance = Label::kFar);
264 void Cvtss2sd(XMMRegister dst, XMMRegister src);
265 void Cvtss2sd(XMMRegister dst, Operand src);
266 void Cvtsd2ss(XMMRegister dst, XMMRegister src);
267 void Cvtsd2ss(XMMRegister dst, Operand src);
268 void Cvttsd2si(Register dst, XMMRegister src);
269 void Cvttsd2si(Register dst, Operand src);
270 void Cvttsd2siq(Register dst, XMMRegister src);
271 void Cvttsd2siq(Register dst, Operand src);
272 void Cvttss2si(Register dst, XMMRegister src);
273 void Cvttss2si(Register dst, Operand src);
274 void Cvttss2siq(Register dst, XMMRegister src);
275 void Cvttss2siq(Register dst, Operand src);
276 void Cvtqsi2ss(XMMRegister dst, Register src);
277 void Cvtqsi2ss(XMMRegister dst, Operand src);
278 void Cvtqsi2sd(XMMRegister dst, Register src);
279 void Cvtqsi2sd(XMMRegister dst, Operand src);
280 void Cvtlsi2ss(XMMRegister dst, Register src);
281 void Cvtlsi2ss(XMMRegister dst, Operand src);
282 void Cvtlui2ss(XMMRegister dst, Register src);
283 void Cvtlui2ss(XMMRegister dst, Operand src);
284 void Cvtlui2sd(XMMRegister dst, Register src);
285 void Cvtlui2sd(XMMRegister dst, Operand src);
286 void Cvtqui2ss(XMMRegister dst, Register src);
287 void Cvtqui2ss(XMMRegister dst, Operand src);
288 void Cvtqui2sd(XMMRegister dst, Register src);
289 void Cvtqui2sd(XMMRegister dst, Operand src);
290 void Cvttsd2uiq(Register dst, Operand src, Label* fail =
nullptr);
291 void Cvttsd2uiq(Register dst, XMMRegister src, Label* fail =
nullptr);
292 void Cvttss2uiq(Register dst, Operand src, Label* fail =
nullptr);
293 void Cvttss2uiq(Register dst, XMMRegister src, Label* fail =
nullptr);
298 void Cvtlsi2sd(XMMRegister dst, Register src);
299 void Cvtlsi2sd(XMMRegister dst, Operand src);
301 void Lzcntq(Register dst, Register src);
302 void Lzcntq(Register dst, Operand src);
303 void Lzcntl(Register dst, Register src);
304 void Lzcntl(Register dst, Operand src);
305 void Tzcntq(Register dst, Register src);
306 void Tzcntq(Register dst, Operand src);
307 void Tzcntl(Register dst, Register src);
308 void Tzcntl(Register dst, Operand src);
309 void Popcntl(Register dst, Register src);
310 void Popcntl(Register dst, Operand src);
311 void Popcntq(Register dst, Register src);
312 void Popcntq(Register dst, Operand src);
315 Condition CheckSmi(Register src);
316 Condition CheckSmi(Operand src);
319 void JumpIfSmi(Register src, Label* on_smi,
320 Label::Distance near_jump = Label::kFar);
322 void JumpIfEqual(Register a, int32_t b, Label* dest) {
323 cmpl(a, Immediate(b));
327 void JumpIfLessThan(Register a, int32_t b, Label* dest) {
328 cmpl(a, Immediate(b));
332 void Move(Register dst, Smi source);
334 void Move(Operand dst, Smi source) {
335 Register constant = GetSmiConstant(source);
339 void Move(Register dst, ExternalReference ext);
341 void Move(XMMRegister dst,
uint32_t src);
342 void Move(XMMRegister dst, uint64_t src);
343 void Move(XMMRegister dst,
float src) { Move(dst, bit_cast<uint32_t>(src)); }
344 void Move(XMMRegister dst,
double src) { Move(dst, bit_cast<uint64_t>(src)); }
347 void Move(Register target, Register source);
349 void Move(Register dst, Handle<HeapObject> source,
350 RelocInfo::Mode rmode = RelocInfo::EMBEDDED_OBJECT);
351 void Move(Operand dst, Handle<HeapObject> source,
352 RelocInfo::Mode rmode = RelocInfo::EMBEDDED_OBJECT);
355 void Move(Register dst, Address ptr, RelocInfo::Mode rmode) {
358 DCHECK(rmode > RelocInfo::LAST_GCED_ENUM);
359 movp(dst, ptr, rmode);
362 void MoveStringConstant(Register result,
const StringConstantBase*
string,
363 RelocInfo::Mode rmode = RelocInfo::EMBEDDED_OBJECT);
366 void SmiUntag(Register dst, Register src);
367 void SmiUntag(Register dst, Operand src);
371 void LoadAddress(Register destination, ExternalReference source);
373 void LoadFromConstantsTable(Register destination,
374 int constant_index)
override;
375 void LoadRootRegisterOffset(Register destination, intptr_t offset)
override;
376 void LoadRootRelative(Register destination, int32_t offset)
override;
384 Operand ExternalReferenceAsOperand(ExternalReference reference,
385 Register scratch = kScratchRegister);
387 void Call(Register reg) { call(reg); }
388 void Call(Operand op);
389 void Call(Handle<Code> code_object, RelocInfo::Mode rmode);
390 void Call(Address destination, RelocInfo::Mode rmode);
391 void Call(ExternalReference ext);
392 void Call(Label* target) { call(target); }
394 void RetpolineCall(Register reg);
395 void RetpolineCall(Address destination, RelocInfo::Mode rmode);
397 void Jump(Address destination, RelocInfo::Mode rmode);
398 void Jump(ExternalReference ext);
399 void Jump(Operand op);
400 void Jump(Handle<Code> code_object, RelocInfo::Mode rmode,
401 Condition cc = always);
403 void RetpolineJump(Register reg);
405 void CallForDeoptimization(Address target,
int deopt_id,
406 RelocInfo::Mode rmode) {
412 void Pextrd(Register dst, XMMRegister src, int8_t imm8);
413 void Pinsrd(XMMRegister dst, Register src, int8_t imm8);
414 void Pinsrd(XMMRegister dst, Operand src, int8_t imm8);
416 void CompareRoot(Register with, RootIndex index);
417 void CompareRoot(Operand with, RootIndex index);
420 void StubPrologue(StackFrame::Type type);
425 void Assert(Condition cc, AbortReason reason);
429 void AssertUnreachable(AbortReason reason);
433 void AssertZeroExtended(Register reg);
436 void Check(Condition cc, AbortReason reason);
439 void Abort(AbortReason msg);
442 void CheckStackAlignment();
445 void EnterFrame(StackFrame::Type type);
446 void EnterFrame(StackFrame::Type type,
bool load_constant_pool_pointer_reg) {
450 void LeaveFrame(StackFrame::Type type);
456 void PrepareForTailCall(
const ParameterCount& callee_args_count,
457 Register caller_args_count_reg, Register scratch0,
460 inline bool AllowThisStubCall(CodeStub* stub);
464 void CallRuntimeWithCEntry(Runtime::FunctionId fid, Register centry);
466 void InitializeRootRegister() {
467 ExternalReference isolate_root = ExternalReference::isolate_root(isolate());
468 Move(kRootRegister, isolate_root);
471 void SaveRegisters(RegList registers);
472 void RestoreRegisters(RegList registers);
474 void CallRecordWriteStub(Register
object, Register address,
475 RememberedSetAction remembered_set_action,
476 SaveFPRegsMode fp_mode);
477 void CallRecordWriteStub(Register
object, Register address,
478 RememberedSetAction remembered_set_action,
479 SaveFPRegsMode fp_mode, Address wasm_target);
481 void MoveNumber(Register dst,
double value);
482 void MoveNonSmi(Register dst,
double value);
486 int RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
487 Register exclusion1 = no_reg,
488 Register exclusion2 = no_reg,
489 Register exclusion3 = no_reg)
const;
498 int PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
499 Register exclusion2 = no_reg,
500 Register exclusion3 = no_reg);
503 int PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1 = no_reg,
504 Register exclusion2 = no_reg,
505 Register exclusion3 = no_reg);
509 void ComputeCodeStartAddress(Register dst);
511 void ResetSpeculationPoisonRegister();
517 void DecompressTaggedSigned(Register destination, Operand field_operand,
518 Register scratch_for_debug);
519 void DecompressTaggedPointer(Register destination, Operand field_operand,
520 Register scratch_for_debug);
521 void DecompressAnyTagged(Register destination, Operand field_operand,
522 Register scratch, Register scratch_for_debug);
525 static const int kSmiShift = kSmiTagSize + kSmiShiftSize;
527 int heap_object_count = 0;
531 Register GetSmiConstant(Smi value);
533 void CallRecordWriteStub(Register
object, Register address,
534 RememberedSetAction remembered_set_action,
535 SaveFPRegsMode fp_mode, Handle<Code> code_target,
536 Address wasm_target);
540 class MacroAssembler :
public TurboAssembler {
542 MacroAssembler(
const AssemblerOptions& options,
void* buffer,
int size)
543 : TurboAssembler(options, buffer, size) {}
545 MacroAssembler(Isolate* isolate,
void* buffer,
int size,
546 CodeObjectRequired create_code_object)
547 : MacroAssembler(isolate, AssemblerOptions::Default(isolate), buffer,
548 size, create_code_object) {}
550 MacroAssembler(Isolate* isolate,
const AssemblerOptions& options,
551 void* buffer,
int size, CodeObjectRequired create_code_object);
559 void Load(Register destination, ExternalReference source);
560 void Store(ExternalReference destination, Register source);
563 void PushAddress(ExternalReference source);
569 void PushRoot(RootIndex index);
572 void JumpIfRoot(Register with, RootIndex index, Label* if_equal,
573 Label::Distance if_equal_distance = Label::kFar) {
574 CompareRoot(with, index);
575 j(equal, if_equal, if_equal_distance);
577 void JumpIfRoot(Operand with, RootIndex index, Label* if_equal,
578 Label::Distance if_equal_distance = Label::kFar) {
579 CompareRoot(with, index);
580 j(equal, if_equal, if_equal_distance);
584 void JumpIfNotRoot(Register with, RootIndex index, Label* if_not_equal,
585 Label::Distance if_not_equal_distance = Label::kFar) {
586 CompareRoot(with, index);
587 j(not_equal, if_not_equal, if_not_equal_distance);
589 void JumpIfNotRoot(Operand with, RootIndex index, Label* if_not_equal,
590 Label::Distance if_not_equal_distance = Label::kFar) {
591 CompareRoot(with, index);
592 j(not_equal, if_not_equal, if_not_equal_distance);
603 void RecordWriteField(
604 Register
object,
int offset, Register value, Register scratch,
605 SaveFPRegsMode save_fp,
606 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
607 SmiCheck smi_check = INLINE_SMI_CHECK);
615 Register
object, Register address, Register value, SaveFPRegsMode save_fp,
616 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
617 SmiCheck smi_check = INLINE_SMI_CHECK);
620 void MaybeDropFrames();
629 void EnterExitFrame(
int arg_stack_space = 0,
bool save_doubles =
false,
630 StackFrame::Type frame_type = StackFrame::EXIT);
634 void EnterApiExitFrame(
int arg_stack_space);
639 void LeaveExitFrame(
bool save_doubles =
false,
bool pop_arguments =
true);
643 void LeaveApiExitFrame();
646 void PushSafepointRegisters() { Pushad(); }
647 void PopSafepointRegisters() { Popad(); }
653 void InvokeFunctionCode(Register
function, Register new_target,
654 const ParameterCount& expected,
655 const ParameterCount& actual, InvokeFlag flag);
658 void CheckDebugHook(Register fun, Register new_target,
659 const ParameterCount& expected,
660 const ParameterCount& actual);
664 void InvokeFunction(Register
function, Register new_target,
665 const ParameterCount& actual, InvokeFlag flag);
667 void InvokeFunction(Register
function, Register new_target,
668 const ParameterCount& expected,
669 const ParameterCount& actual, InvokeFlag flag);
675 void SmiTag(Register dst, Register src);
679 void SmiCompare(Register smi1, Register smi2);
680 void SmiCompare(Register dst, Smi src);
681 void SmiCompare(Register dst, Operand src);
682 void SmiCompare(Operand dst, Register src);
683 void SmiCompare(Operand dst, Smi src);
692 void JumpIfNotSmi(Register src,
694 Label::Distance near_jump = Label::kFar);
697 void JumpIfNotSmi(Operand src, Label* on_not_smi,
698 Label::Distance near_jump = Label::kFar);
707 void SmiAddConstant(Operand dst, Smi constant);
719 SmiIndex SmiToIndex(Register dst, Register src,
int shift);
725 void Load(Register dst, Operand src, Representation r);
726 void Store(Operand dst, Register src, Representation r);
728 void Cmp(Register dst, Handle<Object> source);
729 void Cmp(Operand dst, Handle<Object> source);
730 void Cmp(Register dst, Smi src);
731 void Cmp(Operand dst, Smi src);
735 void Drop(
int stack_elements);
739 void DropUnderReturnAddress(
int stack_elements,
740 Register scratch = kScratchRegister);
742 void PushQuad(Operand src);
743 void PushImm32(int32_t imm32);
744 void Pop(Register dst);
745 void Pop(Operand dst);
746 void PopQuad(Operand dst);
750 void Absps(XMMRegister dst);
751 void Negps(XMMRegister dst);
752 void Abspd(XMMRegister dst);
753 void Negpd(XMMRegister dst);
755 void JumpToInstructionStream(Address entry);
768 void CmpObjectType(Register heap_object, InstanceType type, Register map);
772 void CmpInstanceType(Register map, InstanceType type);
774 void DoubleToI(Register result_reg, XMMRegister input_reg,
775 XMMRegister scratch, Label* lost_precision, Label* is_nan,
776 Label::Distance dst = Label::kFar);
778 template<
typename Field>
779 void DecodeField(Register reg) {
780 static const int shift = Field::kShift;
781 static const int mask = Field::kMask >> Field::kShift;
783 shrp(reg, Immediate(shift));
785 andp(reg, Immediate(mask));
789 void AssertNotSmi(Register
object);
792 void AssertSmi(Register
object);
793 void AssertSmi(Operand
object);
796 void AssertConstructor(Register
object);
799 void AssertFunction(Register
object);
803 void AssertBoundFunction(Register
object);
807 void AssertGeneratorObject(Register
object);
811 void AssertUndefinedOrAllocationSite(Register
object);
817 void PushStackHandler();
820 void PopStackHandler();
826 void LoadGlobalProxy(Register dst) {
827 LoadNativeContextSlot(Context::GLOBAL_PROXY_INDEX, dst);
831 void LoadNativeContextSlot(
int index, Register dst);
839 void CallStub(CodeStub* stub);
842 void TailCallStub(CodeStub* stub);
845 void CallRuntime(
const Runtime::Function* f,
847 SaveFPRegsMode save_doubles = kDontSaveFPRegs);
850 void CallRuntime(Runtime::FunctionId fid,
851 SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
852 const Runtime::Function*
function = Runtime::FunctionForId(fid);
853 CallRuntime(
function, function->nargs, save_doubles);
857 void CallRuntime(Runtime::FunctionId fid,
int num_arguments,
858 SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
859 CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
863 void TailCallRuntime(Runtime::FunctionId fid);
866 void JumpToExternalReference(
const ExternalReference& ext,
867 bool builtin_exit_frame =
false);
871 void IncrementCounter(StatsCounter* counter,
int value);
872 void DecrementCounter(StatsCounter* counter,
int value);
876 void LoadWeakValue(Register in_out, Label* target_if_cleared);
881 static int SafepointRegisterStackIndex(Register reg) {
882 return SafepointRegisterStackIndex(reg.code());
888 static const int kSafepointPushRegisterIndices[Register::kNumRegisters];
889 static const int kNumSafepointSavedRegisters = 12;
892 void InvokePrologue(
const ParameterCount& expected,
893 const ParameterCount& actual, Label* done,
894 bool* definitely_mismatches, InvokeFlag flag,
895 Label::Distance near_jump);
897 void EnterExitFramePrologue(
bool save_rax, StackFrame::Type frame_type);
901 void EnterExitFrameEpilogue(
int arg_stack_space,
bool save_doubles);
903 void LeaveExitFrameEpilogue();
906 void InNewSpace(Register
object,
910 Label::Distance distance = Label::kFar);
913 static int SafepointRegisterStackIndex(
int reg_code) {
914 return kNumSafepointRegisters - kSafepointPushRegisterIndices[reg_code] - 1;
919 friend class StandardFrame;
926 inline Operand FieldOperand(Register
object,
int offset) {
927 return Operand(
object, offset - kHeapObjectTag);
932 inline Operand FieldOperand(Register
object,
936 return Operand(
object, index, scale, offset - kHeapObjectTag);
940 inline Operand ContextOperand(Register context,
int index) {
941 return Operand(context, Context::SlotOffset(index));
945 inline Operand ContextOperand(Register context, Register index) {
946 return Operand(context, index, times_pointer_size, Context::SlotOffset(0));
950 inline Operand NativeContextOperand() {
951 return ContextOperand(rsi, Context::NATIVE_CONTEXT_INDEX);
956 inline Operand StackSpaceOperand(
int index) {
958 const int kShaddowSpace = 4;
959 return Operand(rsp, (index + kShaddowSpace) * kPointerSize);
961 return Operand(rsp, index * kPointerSize);
966 inline Operand StackOperandForReturnAddress(int32_t disp) {
967 return Operand(rsp, disp);
970 #define ACCESS_MASM(masm) masm-> 975 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_