Commit 528a6037 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[cleanup][x64] Fix kPointerSize usages in src/builtins/x64

Bug: v8:8477, v8:8562
Change-Id: I37361ded733d21a5814a2a23a4155d7e8b562446
Reviewed-on: https://chromium-review.googlesource.com/c/1384092Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58361}
parent 50f6baf4
...@@ -102,14 +102,14 @@ void Generate_JSBuiltinsConstructStubHelper(MacroAssembler* masm) { ...@@ -102,14 +102,14 @@ void Generate_JSBuiltinsConstructStubHelper(MacroAssembler* masm) {
Label loop, entry; Label loop, entry;
__ movp(rcx, rax); __ movp(rcx, rax);
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- rax: number of arguments (untagged) // -- rax: number of arguments (untagged)
// -- rdi: constructor function // -- rdi: constructor function
// -- rdx: new target // -- rdx: new target
// -- rbx: pointer to last argument // -- rbx: pointer to last argument
// -- rcx: counter // -- rcx: counter
// -- sp[0*kPointerSize]: the hole (receiver) // -- sp[0*kSystemPointerSize]: the hole (receiver)
// -- sp[1*kPointerSize]: number of arguments (tagged) // -- sp[1*kSystemPointerSize]: number of arguments (tagged)
// -- sp[2*kPointerSize]: context // -- sp[2*kSystemPointerSize]: context
// ----------------------------------- // -----------------------------------
__ jmp(&entry); __ jmp(&entry);
__ bind(&loop); __ bind(&loop);
...@@ -135,8 +135,8 @@ void Generate_JSBuiltinsConstructStubHelper(MacroAssembler* masm) { ...@@ -135,8 +135,8 @@ void Generate_JSBuiltinsConstructStubHelper(MacroAssembler* masm) {
// Remove caller arguments from the stack and return. // Remove caller arguments from the stack and return.
__ PopReturnAddressTo(rcx); __ PopReturnAddressTo(rcx);
SmiIndex index = masm->SmiToIndex(rbx, rbx, kPointerSizeLog2); SmiIndex index = masm->SmiToIndex(rbx, rbx, kSystemPointerSizeLog2);
__ leap(rsp, Operand(rsp, index.reg, index.scale, 1 * kPointerSize)); __ leap(rsp, Operand(rsp, index.reg, index.scale, 1 * kSystemPointerSize));
__ PushReturnAddressFrom(rcx); __ PushReturnAddressFrom(rcx);
__ ret(0); __ ret(0);
...@@ -154,7 +154,7 @@ void Generate_StackOverflowCheck( ...@@ -154,7 +154,7 @@ void Generate_StackOverflowCheck(
// Make scratch the space we have left. The stack might already be overflowed // Make scratch the space we have left. The stack might already be overflowed
// here which will cause scratch to become negative. // here which will cause scratch to become negative.
__ subp(scratch, kScratchRegister); __ subp(scratch, kScratchRegister);
__ sarp(scratch, Immediate(kPointerSizeLog2)); __ sarp(scratch, Immediate(kSystemPointerSizeLog2));
// Check if the arguments will overflow the stack. // Check if the arguments will overflow the stack.
__ cmpp(scratch, num_args); __ cmpp(scratch, num_args);
// Signed comparison. // Signed comparison.
...@@ -187,11 +187,11 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { ...@@ -187,11 +187,11 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
__ Push(rdx); __ Push(rdx);
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- sp[0*kPointerSize]: new target // -- sp[0*kSystemPointerSize]: new target
// -- sp[1*kPointerSize]: padding // -- sp[1*kSystemPointerSize]: padding
// -- rdi and sp[2*kPointerSize]: constructor function // -- rdi and sp[2*kSystemPointerSize]: constructor function
// -- sp[3*kPointerSize]: argument count // -- sp[3*kSystemPointerSize]: argument count
// -- sp[4*kPointerSize]: context // -- sp[4*kSystemPointerSize]: context
// ----------------------------------- // -----------------------------------
Register decompr_scratch_for_debug = Register decompr_scratch_for_debug =
...@@ -216,11 +216,11 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { ...@@ -216,11 +216,11 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- rax implicit receiver // -- rax implicit receiver
// -- Slot 4 / sp[0*kPointerSize] new target // -- Slot 4 / sp[0*kSystemPointerSize] new target
// -- Slot 3 / sp[1*kPointerSize] padding // -- Slot 3 / sp[1*kSystemPointerSize] padding
// -- Slot 2 / sp[2*kPointerSize] constructor function // -- Slot 2 / sp[2*kSystemPointerSize] constructor function
// -- Slot 1 / sp[3*kPointerSize] number of arguments (tagged) // -- Slot 1 / sp[3*kSystemPointerSize] number of arguments (tagged)
// -- Slot 0 / sp[4*kPointerSize] context // -- Slot 0 / sp[4*kSystemPointerSize] context
// ----------------------------------- // -----------------------------------
// Deoptimizer enters here. // Deoptimizer enters here.
masm->isolate()->heap()->SetConstructStubCreateDeoptPCOffset( masm->isolate()->heap()->SetConstructStubCreateDeoptPCOffset(
...@@ -237,12 +237,12 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { ...@@ -237,12 +237,12 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
__ Push(rax); __ Push(rax);
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- sp[0*kPointerSize] implicit receiver // -- sp[0*kSystemPointerSize] implicit receiver
// -- sp[1*kPointerSize] implicit receiver // -- sp[1*kSystemPointerSize] implicit receiver
// -- sp[2*kPointerSize] padding // -- sp[2*kSystemPointerSize] padding
// -- sp[3*kPointerSize] constructor function // -- sp[3*kSystemPointerSize] constructor function
// -- sp[4*kPointerSize] number of arguments (tagged) // -- sp[4*kSystemPointerSize] number of arguments (tagged)
// -- sp[5*kPointerSize] context // -- sp[5*kSystemPointerSize] context
// ----------------------------------- // -----------------------------------
// Restore constructor function and argument count. // Restore constructor function and argument count.
...@@ -271,16 +271,16 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { ...@@ -271,16 +271,16 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
Label loop, entry; Label loop, entry;
__ movp(rcx, rax); __ movp(rcx, rax);
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- rax: number of arguments (untagged) // -- rax: number of arguments (untagged)
// -- rdx: new target // -- rdx: new target
// -- rbx: pointer to last argument // -- rbx: pointer to last argument
// -- rcx: counter (tagged) // -- rcx: counter (tagged)
// -- sp[0*kPointerSize]: implicit receiver // -- sp[0*kSystemPointerSize]: implicit receiver
// -- sp[1*kPointerSize]: implicit receiver // -- sp[1*kSystemPointerSize]: implicit receiver
// -- sp[2*kPointerSize]: padding // -- sp[2*kSystemPointerSize]: padding
// -- rdi and sp[3*kPointerSize]: constructor function // -- rdi and sp[3*kSystemPointerSize]: constructor function
// -- sp[4*kPointerSize]: number of arguments (tagged) // -- sp[4*kSystemPointerSize]: number of arguments (tagged)
// -- sp[5*kPointerSize]: context // -- sp[5*kSystemPointerSize]: context
// ----------------------------------- // -----------------------------------
__ jmp(&entry, Label::kNear); __ jmp(&entry, Label::kNear);
__ bind(&loop); __ bind(&loop);
...@@ -295,11 +295,11 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { ...@@ -295,11 +295,11 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- rax constructor result // -- rax constructor result
// -- sp[0*kPointerSize] implicit receiver // -- sp[0*kSystemPointerSize] implicit receiver
// -- sp[1*kPointerSize] padding // -- sp[1*kSystemPointerSize] padding
// -- sp[2*kPointerSize] constructor function // -- sp[2*kSystemPointerSize] constructor function
// -- sp[3*kPointerSize] number of arguments // -- sp[3*kSystemPointerSize] number of arguments
// -- sp[4*kPointerSize] context // -- sp[4*kSystemPointerSize] context
// ----------------------------------- // -----------------------------------
// Store offset of return address for deoptimizer. // Store offset of return address for deoptimizer.
...@@ -336,7 +336,7 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { ...@@ -336,7 +336,7 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
// Throw away the result of the constructor invocation and use the // Throw away the result of the constructor invocation and use the
// on-stack receiver as the result. // on-stack receiver as the result.
__ bind(&use_receiver); __ bind(&use_receiver);
__ movp(rax, Operand(rsp, 0 * kPointerSize)); __ movp(rax, Operand(rsp, 0 * kSystemPointerSize));
__ JumpIfRoot(rax, RootIndex::kTheHoleValue, &do_throw, Label::kNear); __ JumpIfRoot(rax, RootIndex::kTheHoleValue, &do_throw, Label::kNear);
__ bind(&leave_frame); __ bind(&leave_frame);
...@@ -346,8 +346,8 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { ...@@ -346,8 +346,8 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
} }
// Remove caller arguments from the stack and return. // Remove caller arguments from the stack and return.
__ PopReturnAddressTo(rcx); __ PopReturnAddressTo(rcx);
SmiIndex index = masm->SmiToIndex(rbx, rbx, kPointerSizeLog2); SmiIndex index = masm->SmiToIndex(rbx, rbx, kSystemPointerSizeLog2);
__ leap(rsp, Operand(rsp, index.reg, index.scale, 1 * kPointerSize)); __ leap(rsp, Operand(rsp, index.reg, index.scale, 1 * kSystemPointerSize));
__ PushReturnAddressFrom(rcx); __ PushReturnAddressFrom(rcx);
__ ret(0); __ ret(0);
} }
...@@ -385,7 +385,7 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type, ...@@ -385,7 +385,7 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type,
__ Push(Immediate(StackFrame::TypeToMarker(type))); __ Push(Immediate(StackFrame::TypeToMarker(type)));
// Reserve a slot for the context. It is filled after the root register has // Reserve a slot for the context. It is filled after the root register has
// been set up. // been set up.
__ subp(rsp, Immediate(kPointerSize)); __ subp(rsp, Immediate(kSystemPointerSize));
// Save callee-saved registers (X64/X32/Win64 calling conventions). // Save callee-saved registers (X64/X32/Win64 calling conventions).
__ pushq(r12); __ pushq(r12);
__ pushq(r13); __ pushq(r13);
...@@ -440,7 +440,7 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type, ...@@ -440,7 +440,7 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type,
ExternalReference context_address = ExternalReference::Create( ExternalReference context_address = ExternalReference::Create(
IsolateAddressId::kContextAddress, masm->isolate()); IsolateAddressId::kContextAddress, masm->isolate());
__ Load(kScratchRegister, context_address); __ Load(kScratchRegister, context_address);
static constexpr int kOffsetToContextSlot = -2 * kPointerSize; static constexpr int kOffsetToContextSlot = -2 * kSystemPointerSize;
__ movp(Operand(rbp, kOffsetToContextSlot), kScratchRegister); __ movp(Operand(rbp, kOffsetToContextSlot), kScratchRegister);
// If this is the outermost JS call, set js_entry_sp value. // If this is the outermost JS call, set js_entry_sp value.
...@@ -529,7 +529,7 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type, ...@@ -529,7 +529,7 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type,
__ popq(r14); __ popq(r14);
__ popq(r13); __ popq(r13);
__ popq(r12); __ popq(r12);
__ addp(rsp, Immediate(2 * kPointerSize)); // remove markers __ addp(rsp, Immediate(2 * kSystemPointerSize)); // remove markers
// Restore frame pointer and return. // Restore frame pointer and return.
__ popq(rbp); __ popq(rbp);
...@@ -636,8 +636,8 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, ...@@ -636,8 +636,8 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
#endif // _WIN64 #endif // _WIN64
// Current stack contents: // Current stack contents:
// [rsp + 2 * kPointerSize ... ] : Internal frame // [rsp + 2 * kSystemPointerSize ... ] : Internal frame
// [rsp + kPointerSize] : function // [rsp + kSystemPointerSize] : function
// [rsp] : receiver // [rsp] : receiver
// Current register contents: // Current register contents:
// rax : argc // rax : argc
...@@ -1186,7 +1186,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1186,7 +1186,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ Push(rax); __ Push(rax);
// Continue loop if not done. // Continue loop if not done.
__ bind(&loop_check); __ bind(&loop_check);
__ subp(rcx, Immediate(kPointerSize)); __ subp(rcx, Immediate(kSystemPointerSize));
__ j(greater_equal, &loop_header, Label::kNear); __ j(greater_equal, &loop_header, Label::kNear);
} }
...@@ -1256,7 +1256,7 @@ static void Generate_InterpreterPushArgs(MacroAssembler* masm, ...@@ -1256,7 +1256,7 @@ static void Generate_InterpreterPushArgs(MacroAssembler* masm,
Register scratch) { Register scratch) {
// Find the address of the last argument. // Find the address of the last argument.
__ Move(scratch, num_args); __ Move(scratch, num_args);
__ shlp(scratch, Immediate(kPointerSizeLog2)); __ shlp(scratch, Immediate(kSystemPointerSizeLog2));
__ negp(scratch); __ negp(scratch);
__ addp(scratch, start_address); __ addp(scratch, start_address);
...@@ -1265,7 +1265,7 @@ static void Generate_InterpreterPushArgs(MacroAssembler* masm, ...@@ -1265,7 +1265,7 @@ static void Generate_InterpreterPushArgs(MacroAssembler* masm,
__ j(always, &loop_check, Label::kNear); __ j(always, &loop_check, Label::kNear);
__ bind(&loop_header); __ bind(&loop_header);
__ Push(Operand(start_address, 0)); __ Push(Operand(start_address, 0));
__ subp(start_address, Immediate(kPointerSize)); __ subp(start_address, Immediate(kSystemPointerSize));
__ bind(&loop_check); __ bind(&loop_check);
__ cmpp(start_address, scratch); __ cmpp(start_address, scratch);
__ j(greater, &loop_header, Label::kNear); __ j(greater, &loop_header, Label::kNear);
...@@ -1531,8 +1531,8 @@ void Builtins::Generate_InstantiateAsmJs(MacroAssembler* masm) { ...@@ -1531,8 +1531,8 @@ void Builtins::Generate_InstantiateAsmJs(MacroAssembler* masm) {
__ j(not_equal, &over, Label::kNear); __ j(not_equal, &over, Label::kNear);
} }
for (int i = j - 1; i >= 0; --i) { for (int i = j - 1; i >= 0; --i) {
__ Push(Operand( __ Push(Operand(rbp, StandardFrameConstants::kCallerSPOffset +
rbp, StandardFrameConstants::kCallerSPOffset + i * kPointerSize)); i * kSystemPointerSize));
} }
for (int i = 0; i < 3 - j; ++i) { for (int i = 0; i < 3 - j; ++i) {
__ PushRoot(RootIndex::kUndefinedValue); __ PushRoot(RootIndex::kUndefinedValue);
...@@ -1586,10 +1586,11 @@ void Generate_ContinueToBuiltinHelper(MacroAssembler* masm, ...@@ -1586,10 +1586,11 @@ void Generate_ContinueToBuiltinHelper(MacroAssembler* masm,
if (with_result) { if (with_result) {
// Overwrite the hole inserted by the deoptimizer with the return value from // Overwrite the hole inserted by the deoptimizer with the return value from
// the LAZY deopt point. // the LAZY deopt point.
__ movq(Operand(rsp, __ movq(
config->num_allocatable_general_registers() * kPointerSize + Operand(rsp, config->num_allocatable_general_registers() *
BuiltinContinuationFrameConstants::kFixedFrameSize), kSystemPointerSize +
rax); BuiltinContinuationFrameConstants::kFixedFrameSize),
rax);
} }
for (int i = allocatable_register_count - 1; i >= 0; --i) { for (int i = allocatable_register_count - 1; i >= 0; --i) {
int code = config->GetAllocatableGeneralCode(i); int code = config->GetAllocatableGeneralCode(i);
...@@ -1602,9 +1603,10 @@ void Generate_ContinueToBuiltinHelper(MacroAssembler* masm, ...@@ -1602,9 +1603,10 @@ void Generate_ContinueToBuiltinHelper(MacroAssembler* masm,
rbp, rbp,
Operand(rsp, BuiltinContinuationFrameConstants::kFixedFrameSizeFromFp)); Operand(rsp, BuiltinContinuationFrameConstants::kFixedFrameSizeFromFp));
const int offsetToPC = const int offsetToPC =
BuiltinContinuationFrameConstants::kFixedFrameSizeFromFp - kPointerSize; BuiltinContinuationFrameConstants::kFixedFrameSizeFromFp -
kSystemPointerSize;
__ popq(Operand(rsp, offsetToPC)); __ popq(Operand(rsp, offsetToPC));
__ Drop(offsetToPC / kPointerSize); __ Drop(offsetToPC / kSystemPointerSize);
__ addq(Operand(rsp, 0), Immediate(Code::kHeaderSize - kHeapObjectTag)); __ addq(Operand(rsp, 0), Immediate(Code::kHeaderSize - kHeapObjectTag));
__ Ret(); __ Ret();
} }
...@@ -1638,7 +1640,7 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) { ...@@ -1638,7 +1640,7 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
DCHECK_EQ(kInterpreterAccumulatorRegister.code(), rax.code()); DCHECK_EQ(kInterpreterAccumulatorRegister.code(), rax.code());
__ movp(rax, Operand(rsp, kPCOnStackSize)); __ movp(rax, Operand(rsp, kPCOnStackSize));
__ ret(1 * kPointerSize); // Remove rax. __ ret(1 * kSystemPointerSize); // Remove rax.
} }
// static // static
...@@ -1671,7 +1673,7 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { ...@@ -1671,7 +1673,7 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
} }
__ bind(&no_this_arg); __ bind(&no_this_arg);
__ PopReturnAddressTo(rcx); __ PopReturnAddressTo(rcx);
__ leap(rsp, Operand(rsp, rax, times_pointer_size, kPointerSize)); __ leap(rsp, Operand(rsp, rax, times_pointer_size, kSystemPointerSize));
__ Push(rdx); __ Push(rdx);
__ PushReturnAddressFrom(rcx); __ PushReturnAddressFrom(rcx);
} }
...@@ -1787,7 +1789,7 @@ void Builtins::Generate_ReflectApply(MacroAssembler* masm) { ...@@ -1787,7 +1789,7 @@ void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
__ movp(rbx, args.GetArgumentOperand(3)); // argumentsList __ movp(rbx, args.GetArgumentOperand(3)); // argumentsList
__ bind(&done); __ bind(&done);
__ PopReturnAddressTo(rcx); __ PopReturnAddressTo(rcx);
__ leap(rsp, Operand(rsp, rax, times_pointer_size, kPointerSize)); __ leap(rsp, Operand(rsp, rax, times_pointer_size, kSystemPointerSize));
__ Push(rdx); __ Push(rdx);
__ PushReturnAddressFrom(rcx); __ PushReturnAddressFrom(rcx);
} }
...@@ -1839,7 +1841,7 @@ void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) { ...@@ -1839,7 +1841,7 @@ void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
__ movp(rdx, args.GetArgumentOperand(3)); // new.target __ movp(rdx, args.GetArgumentOperand(3)); // new.target
__ bind(&done); __ bind(&done);
__ PopReturnAddressTo(rcx); __ PopReturnAddressTo(rcx);
__ leap(rsp, Operand(rsp, rax, times_pointer_size, kPointerSize)); __ leap(rsp, Operand(rsp, rax, times_pointer_size, kSystemPointerSize));
__ PushRoot(RootIndex::kUndefinedValue); __ PushRoot(RootIndex::kUndefinedValue);
__ PushReturnAddressFrom(rcx); __ PushReturnAddressFrom(rcx);
} }
...@@ -1924,8 +1926,8 @@ static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { ...@@ -1924,8 +1926,8 @@ static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
// Remove caller arguments from the stack. // Remove caller arguments from the stack.
__ PopReturnAddressTo(rcx); __ PopReturnAddressTo(rcx);
SmiIndex index = masm->SmiToIndex(rbx, rbx, kPointerSizeLog2); SmiIndex index = masm->SmiToIndex(rbx, rbx, kSystemPointerSizeLog2);
__ leap(rsp, Operand(rsp, index.reg, index.scale, 1 * kPointerSize)); __ leap(rsp, Operand(rsp, index.reg, index.scale, 1 * kSystemPointerSize));
__ PushReturnAddressFrom(rcx); __ PushReturnAddressFrom(rcx);
} }
...@@ -1961,7 +1963,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { ...@@ -1961,7 +1963,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
__ bind(&copy); __ bind(&copy);
__ incp(r8); __ incp(r8);
__ Push(Operand(rax, 0)); __ Push(Operand(rax, 0));
__ subp(rax, Immediate(kPointerSize)); __ subp(rax, Immediate(kSystemPointerSize));
__ cmpp(r8, rbx); __ cmpp(r8, rbx);
__ j(less, &copy); __ j(less, &copy);
__ jmp(&invoke); __ jmp(&invoke);
...@@ -1983,7 +1985,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { ...@@ -1983,7 +1985,7 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
__ bind(&copy); __ bind(&copy);
__ incp(r8); __ incp(r8);
__ Push(Operand(rdi, 0)); __ Push(Operand(rdi, 0));
__ subp(rdi, Immediate(kPointerSize)); __ subp(rdi, Immediate(kSystemPointerSize));
__ cmpp(r8, rax); __ cmpp(r8, rax);
__ j(less, &copy); __ j(less, &copy);
...@@ -3143,7 +3145,7 @@ int Offset(ExternalReference ref0, ExternalReference ref1) { ...@@ -3143,7 +3145,7 @@ int Offset(ExternalReference ref0, ExternalReference ref1) {
// Calls an API function. Allocates HandleScope, extracts returned value // Calls an API function. Allocates HandleScope, extracts returned value
// from handle and propagates exceptions. Clobbers r14, r15, rbx and // from handle and propagates exceptions. Clobbers r14, r15, rbx and
// caller-save registers. Restores context. On return removes // caller-save registers. Restores context. On return removes
// stack_space * kPointerSize (GCed). // stack_space * kSystemPointerSize (GCed).
void CallApiFunctionAndReturn(MacroAssembler* masm, Register function_address, void CallApiFunctionAndReturn(MacroAssembler* masm, Register function_address,
ExternalReference thunk_ref, ExternalReference thunk_ref,
Register thunk_last_arg, int stack_space, Register thunk_last_arg, int stack_space,
...@@ -3280,7 +3282,7 @@ void CallApiFunctionAndReturn(MacroAssembler* masm, Register function_address, ...@@ -3280,7 +3282,7 @@ void CallApiFunctionAndReturn(MacroAssembler* masm, Register function_address,
if (stack_space_operand == nullptr) { if (stack_space_operand == nullptr) {
DCHECK_NE(stack_space, 0); DCHECK_NE(stack_space, 0);
__ ret(stack_space * kPointerSize); __ ret(stack_space * kSystemPointerSize);
} else { } else {
DCHECK_EQ(stack_space, 0); DCHECK_EQ(stack_space, 0);
__ PopReturnAddressTo(rcx); __ PopReturnAddressTo(rcx);
...@@ -3333,9 +3335,9 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) { ...@@ -3333,9 +3335,9 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) {
DCHECK(!AreAliased(api_function_address, argc, kScratchRegister)); DCHECK(!AreAliased(api_function_address, argc, kScratchRegister));
// Stack offsets (without argc). // Stack offsets (without argc).
static constexpr int kReceiverOffset = kPointerSize; static constexpr int kReceiverOffset = kSystemPointerSize;
static constexpr int kHolderOffset = kReceiverOffset + kPointerSize; static constexpr int kHolderOffset = kReceiverOffset + kSystemPointerSize;
static constexpr int kCallDataOffset = kHolderOffset + kPointerSize; static constexpr int kCallDataOffset = kHolderOffset + kSystemPointerSize;
// Extra stack arguments are: the receiver, kHolder, kCallData. // Extra stack arguments are: the receiver, kHolder, kCallData.
static constexpr int kExtraStackArgumentCount = 3; static constexpr int kExtraStackArgumentCount = 3;
...@@ -3356,48 +3358,49 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) { ...@@ -3356,48 +3358,49 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) {
// rsp[0]: return address // rsp[0]: return address
// //
// Target state: // Target state:
// rsp[0 * kPointerSize]: return address // rsp[0 * kSystemPointerSize]: return address
// rsp[1 * kPointerSize]: kHolder // rsp[1 * kSystemPointerSize]: kHolder
// rsp[2 * kPointerSize]: kIsolate // rsp[2 * kSystemPointerSize]: kIsolate
// rsp[3 * kPointerSize]: undefined (kReturnValueDefaultValue) // rsp[3 * kSystemPointerSize]: undefined (kReturnValueDefaultValue)
// rsp[4 * kPointerSize]: undefined (kReturnValue) // rsp[4 * kSystemPointerSize]: undefined (kReturnValue)
// rsp[5 * kPointerSize]: kData // rsp[5 * kSystemPointerSize]: kData
// rsp[6 * kPointerSize]: undefined (kNewTarget) // rsp[6 * kSystemPointerSize]: undefined (kNewTarget)
// Reserve space on the stack. // Reserve space on the stack.
__ subp(rsp, Immediate(FCA::kArgsLength * kPointerSize)); __ subp(rsp, Immediate(FCA::kArgsLength * kSystemPointerSize));
// Return address (the old stack location is overwritten later on). // Return address (the old stack location is overwritten later on).
__ movp(kScratchRegister, Operand(rsp, FCA::kArgsLength * kPointerSize)); __ movp(kScratchRegister,
__ movp(Operand(rsp, 0 * kPointerSize), kScratchRegister); Operand(rsp, FCA::kArgsLength * kSystemPointerSize));
__ movp(Operand(rsp, 0 * kSystemPointerSize), kScratchRegister);
// kHolder. // kHolder.
__ movp(kScratchRegister, __ movp(kScratchRegister,
Operand(rsp, argc, times_pointer_size, Operand(rsp, argc, times_pointer_size,
FCA::kArgsLength * kPointerSize + kHolderOffset)); FCA::kArgsLength * kSystemPointerSize + kHolderOffset));
__ movp(Operand(rsp, 1 * kPointerSize), kScratchRegister); __ movp(Operand(rsp, 1 * kSystemPointerSize), kScratchRegister);
// kIsolate. // kIsolate.
__ Move(kScratchRegister, __ Move(kScratchRegister,
ExternalReference::isolate_address(masm->isolate())); ExternalReference::isolate_address(masm->isolate()));
__ movp(Operand(rsp, 2 * kPointerSize), kScratchRegister); __ movp(Operand(rsp, 2 * kSystemPointerSize), kScratchRegister);
// kReturnValueDefaultValue, kReturnValue, and kNewTarget. // kReturnValueDefaultValue, kReturnValue, and kNewTarget.
__ LoadRoot(kScratchRegister, RootIndex::kUndefinedValue); __ LoadRoot(kScratchRegister, RootIndex::kUndefinedValue);
__ movp(Operand(rsp, 3 * kPointerSize), kScratchRegister); __ movp(Operand(rsp, 3 * kSystemPointerSize), kScratchRegister);
__ movp(Operand(rsp, 4 * kPointerSize), kScratchRegister); __ movp(Operand(rsp, 4 * kSystemPointerSize), kScratchRegister);
__ movp(Operand(rsp, 6 * kPointerSize), kScratchRegister); __ movp(Operand(rsp, 6 * kSystemPointerSize), kScratchRegister);
// kData. // kData.
__ movp(kScratchRegister, __ movp(kScratchRegister,
Operand(rsp, argc, times_pointer_size, Operand(rsp, argc, times_pointer_size,
FCA::kArgsLength * kPointerSize + kCallDataOffset)); FCA::kArgsLength * kSystemPointerSize + kCallDataOffset));
__ movp(Operand(rsp, 5 * kPointerSize), kScratchRegister); __ movp(Operand(rsp, 5 * kSystemPointerSize), kScratchRegister);
// Keep a pointer to kHolder (= implicit_args) in a scratch register. // Keep a pointer to kHolder (= implicit_args) in a scratch register.
// We use it below to set up the FunctionCallbackInfo object. // We use it below to set up the FunctionCallbackInfo object.
Register scratch = rbx; Register scratch = rbx;
__ leap(scratch, Operand(rsp, 1 * kPointerSize)); __ leap(scratch, Operand(rsp, 1 * kSystemPointerSize));
// Allocate the v8::Arguments structure in the arguments' space since // Allocate the v8::Arguments structure in the arguments' space since
// it's not controlled by GC. // it's not controlled by GC.
...@@ -3410,7 +3413,7 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) { ...@@ -3410,7 +3413,7 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) {
// FunctionCallbackInfo::values_ (points at the first varargs argument passed // FunctionCallbackInfo::values_ (points at the first varargs argument passed
// on the stack). // on the stack).
__ leap(scratch, Operand(scratch, argc, times_pointer_size, __ leap(scratch, Operand(scratch, argc, times_pointer_size,
(FCA::kArgsLength - 1) * kPointerSize)); (FCA::kArgsLength - 1) * kSystemPointerSize));
__ movp(StackSpaceOperand(1), scratch); __ movp(StackSpaceOperand(1), scratch);
// FunctionCallbackInfo::length_. // FunctionCallbackInfo::length_.
...@@ -3418,10 +3421,10 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) { ...@@ -3418,10 +3421,10 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) {
// We also store the number of bytes to drop from the stack after returning // We also store the number of bytes to drop from the stack after returning
// from the API function here. // from the API function here.
__ leaq( __ leaq(kScratchRegister,
kScratchRegister, Operand(argc, times_pointer_size,
Operand(argc, times_pointer_size, (FCA::kArgsLength + kExtraStackArgumentCount) *
(FCA::kArgsLength + kExtraStackArgumentCount) * kPointerSize)); kSystemPointerSize));
__ movp(StackSpaceOperand(3), kScratchRegister); __ movp(StackSpaceOperand(3), kScratchRegister);
Register arguments_arg = arg_reg_1; Register arguments_arg = arg_reg_1;
...@@ -3440,7 +3443,8 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) { ...@@ -3440,7 +3443,8 @@ void Builtins::Generate_CallApiCallback(MacroAssembler* masm) {
// the stored ebp (pushed by EnterApiExitFrame), and the return address. // the stored ebp (pushed by EnterApiExitFrame), and the return address.
static constexpr int kStackSlotsAboveFCA = 2; static constexpr int kStackSlotsAboveFCA = 2;
Operand return_value_operand( Operand return_value_operand(
rbp, (kStackSlotsAboveFCA + FCA::kReturnValueOffset) * kPointerSize); rbp,
(kStackSlotsAboveFCA + FCA::kReturnValueOffset) * kSystemPointerSize);
static constexpr int kUseStackSpaceOperand = 0; static constexpr int kUseStackSpaceOperand = 0;
Operand stack_space_operand = StackSpaceOperand(3); Operand stack_space_operand = StackSpaceOperand(3);
...@@ -3500,7 +3504,7 @@ void Builtins::Generate_CallApiGetter(MacroAssembler* masm) { ...@@ -3500,7 +3504,7 @@ void Builtins::Generate_CallApiGetter(MacroAssembler* masm) {
const int kArgStackSpace = 1; const int kArgStackSpace = 1;
// Load address of v8::PropertyAccessorInfo::args_ array. // Load address of v8::PropertyAccessorInfo::args_ array.
__ leap(scratch, Operand(rsp, 2 * kPointerSize)); __ leap(scratch, Operand(rsp, 2 * kSystemPointerSize));
__ EnterApiExitFrame(kArgStackSpace); __ EnterApiExitFrame(kArgStackSpace);
...@@ -3509,7 +3513,7 @@ void Builtins::Generate_CallApiGetter(MacroAssembler* masm) { ...@@ -3509,7 +3513,7 @@ void Builtins::Generate_CallApiGetter(MacroAssembler* masm) {
Operand info_object = StackSpaceOperand(0); Operand info_object = StackSpaceOperand(0);
__ movp(info_object, scratch); __ movp(info_object, scratch);
__ leap(name_arg, Operand(scratch, -kPointerSize)); __ leap(name_arg, Operand(scratch, -kSystemPointerSize));
// The context register (rsi) has been saved in EnterApiExitFrame and // The context register (rsi) has been saved in EnterApiExitFrame and
// could be used to pass arguments. // could be used to pass arguments.
__ leap(accessor_info_arg, info_object); __ leap(accessor_info_arg, info_object);
...@@ -3529,7 +3533,8 @@ void Builtins::Generate_CallApiGetter(MacroAssembler* masm) { ...@@ -3529,7 +3533,8 @@ void Builtins::Generate_CallApiGetter(MacroAssembler* masm) {
// +3 is to skip prolog, return address and name handle. // +3 is to skip prolog, return address and name handle.
Operand return_value_operand( Operand return_value_operand(
rbp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); rbp,
(PropertyCallbackArguments::kReturnValueOffset + 3) * kSystemPointerSize);
Operand* const kUseStackSpaceConstant = nullptr; Operand* const kUseStackSpaceConstant = nullptr;
CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg,
kStackUnwindSpace, kUseStackSpaceConstant, kStackUnwindSpace, kUseStackSpaceConstant,
......
...@@ -50,7 +50,7 @@ namespace internal { ...@@ -50,7 +50,7 @@ namespace internal {
// //
class CommonFrameConstants : public AllStatic { class CommonFrameConstants : public AllStatic {
public: public:
static constexpr int kCallerFPOffset = 0 * kPointerSize; static constexpr int kCallerFPOffset = 0 * kSystemPointerSize;
static constexpr int kCallerPCOffset = kCallerFPOffset + 1 * kFPOnStackSize; static constexpr int kCallerPCOffset = kCallerFPOffset + 1 * kFPOnStackSize;
static constexpr int kCallerSPOffset = kCallerPCOffset + 1 * kPCOnStackSize; static constexpr int kCallerSPOffset = kCallerPCOffset + 1 * kPCOnStackSize;
...@@ -60,13 +60,13 @@ class CommonFrameConstants : public AllStatic { ...@@ -60,13 +60,13 @@ class CommonFrameConstants : public AllStatic {
// is the last object pointer. // is the last object pointer.
static constexpr int kFixedFrameSizeAboveFp = kPCOnStackSize + kFPOnStackSize; static constexpr int kFixedFrameSizeAboveFp = kPCOnStackSize + kFPOnStackSize;
static constexpr int kFixedSlotCountAboveFp = static constexpr int kFixedSlotCountAboveFp =
kFixedFrameSizeAboveFp / kPointerSize; kFixedFrameSizeAboveFp / kSystemPointerSize;
static constexpr int kCPSlotSize = static constexpr int kCPSlotSize =
FLAG_enable_embedded_constant_pool ? kPointerSize : 0; FLAG_enable_embedded_constant_pool ? kSystemPointerSize : 0;
static constexpr int kCPSlotCount = kCPSlotSize / kPointerSize; static constexpr int kCPSlotCount = kCPSlotSize / kSystemPointerSize;
static constexpr int kConstantPoolOffset = static constexpr int kConstantPoolOffset =
kCPSlotSize ? -1 * kPointerSize : 0; kCPSlotSize ? -1 * kSystemPointerSize : 0;
static constexpr int kContextOrFrameTypeSize = kPointerSize; static constexpr int kContextOrFrameTypeSize = kSystemPointerSize;
static constexpr int kContextOrFrameTypeOffset = static constexpr int kContextOrFrameTypeOffset =
-(kCPSlotSize + kContextOrFrameTypeSize); -(kCPSlotSize + kContextOrFrameTypeSize);
}; };
...@@ -104,15 +104,17 @@ class CommonFrameConstants : public AllStatic { ...@@ -104,15 +104,17 @@ class CommonFrameConstants : public AllStatic {
// //
class StandardFrameConstants : public CommonFrameConstants { class StandardFrameConstants : public CommonFrameConstants {
public: public:
static constexpr int kFixedFrameSizeFromFp = 2 * kPointerSize + kCPSlotSize; static constexpr int kFixedFrameSizeFromFp =
2 * kSystemPointerSize + kCPSlotSize;
static constexpr int kFixedFrameSize = static constexpr int kFixedFrameSize =
kFixedFrameSizeAboveFp + kFixedFrameSizeFromFp; kFixedFrameSizeAboveFp + kFixedFrameSizeFromFp;
static constexpr int kFixedSlotCountFromFp = static constexpr int kFixedSlotCountFromFp =
kFixedFrameSizeFromFp / kPointerSize; kFixedFrameSizeFromFp / kSystemPointerSize;
static constexpr int kFixedSlotCount = kFixedFrameSize / kPointerSize; static constexpr int kFixedSlotCount = kFixedFrameSize / kSystemPointerSize;
static constexpr int kContextOffset = kContextOrFrameTypeOffset; static constexpr int kContextOffset = kContextOrFrameTypeOffset;
static constexpr int kFunctionOffset = -2 * kPointerSize - kCPSlotSize; static constexpr int kFunctionOffset = -2 * kSystemPointerSize - kCPSlotSize;
static constexpr int kExpressionsOffset = -3 * kPointerSize - kCPSlotSize; static constexpr int kExpressionsOffset =
-3 * kSystemPointerSize - kCPSlotSize;
static constexpr int kLastObjectOffset = kContextOffset; static constexpr int kLastObjectOffset = kContextOffset;
}; };
...@@ -152,10 +154,10 @@ class StandardFrameConstants : public CommonFrameConstants { ...@@ -152,10 +154,10 @@ class StandardFrameConstants : public CommonFrameConstants {
// //
class OptimizedBuiltinFrameConstants : public StandardFrameConstants { class OptimizedBuiltinFrameConstants : public StandardFrameConstants {
public: public:
static constexpr int kArgCSize = kPointerSize; static constexpr int kArgCSize = kSystemPointerSize;
static constexpr int kArgCOffset = -3 * kPointerSize - kCPSlotSize; static constexpr int kArgCOffset = -3 * kSystemPointerSize - kCPSlotSize;
static constexpr int kFixedFrameSize = kFixedFrameSizeAboveFp - kArgCOffset; static constexpr int kFixedFrameSize = kFixedFrameSizeAboveFp - kArgCOffset;
static constexpr int kFixedSlotCount = kFixedFrameSize / kPointerSize; static constexpr int kFixedSlotCount = kFixedFrameSize / kSystemPointerSize;
}; };
// TypedFrames have a SMI type maker value below the saved FP/constant pool to // TypedFrames have a SMI type maker value below the saved FP/constant pool to
...@@ -195,27 +197,28 @@ class TypedFrameConstants : public CommonFrameConstants { ...@@ -195,27 +197,28 @@ class TypedFrameConstants : public CommonFrameConstants {
static constexpr int kFrameTypeOffset = kContextOrFrameTypeOffset; static constexpr int kFrameTypeOffset = kContextOrFrameTypeOffset;
static constexpr int kFixedFrameSizeFromFp = kCPSlotSize + kFrameTypeSize; static constexpr int kFixedFrameSizeFromFp = kCPSlotSize + kFrameTypeSize;
static constexpr int kFixedSlotCountFromFp = static constexpr int kFixedSlotCountFromFp =
kFixedFrameSizeFromFp / kPointerSize; kFixedFrameSizeFromFp / kSystemPointerSize;
static constexpr int kFixedFrameSize = static constexpr int kFixedFrameSize =
StandardFrameConstants::kFixedFrameSizeAboveFp + kFixedFrameSizeFromFp; StandardFrameConstants::kFixedFrameSizeAboveFp + kFixedFrameSizeFromFp;
static constexpr int kFixedSlotCount = kFixedFrameSize / kPointerSize; static constexpr int kFixedSlotCount = kFixedFrameSize / kSystemPointerSize;
static constexpr int kFirstPushedFrameValueOffset = static constexpr int kFirstPushedFrameValueOffset =
-StandardFrameConstants::kCPSlotSize - kFrameTypeSize - kPointerSize; -StandardFrameConstants::kCPSlotSize - kFrameTypeSize -
kSystemPointerSize;
}; };
#define TYPED_FRAME_PUSHED_VALUE_OFFSET(x) \ #define TYPED_FRAME_PUSHED_VALUE_OFFSET(x) \
(TypedFrameConstants::kFirstPushedFrameValueOffset - (x)*kPointerSize) (TypedFrameConstants::kFirstPushedFrameValueOffset - (x)*kSystemPointerSize)
#define TYPED_FRAME_SIZE(count) \ #define TYPED_FRAME_SIZE(count) \
(TypedFrameConstants::kFixedFrameSize + (count)*kPointerSize) (TypedFrameConstants::kFixedFrameSize + (count)*kSystemPointerSize)
#define TYPED_FRAME_SIZE_FROM_SP(count) \ #define TYPED_FRAME_SIZE_FROM_SP(count) \
(TypedFrameConstants::kFixedFrameSizeFromFp + (count)*kPointerSize) (TypedFrameConstants::kFixedFrameSizeFromFp + (count)*kSystemPointerSize)
#define DEFINE_TYPED_FRAME_SIZES(count) \ #define DEFINE_TYPED_FRAME_SIZES(count) \
static constexpr int kFixedFrameSize = TYPED_FRAME_SIZE(count); \ static constexpr int kFixedFrameSize = TYPED_FRAME_SIZE(count); \
static constexpr int kFixedSlotCount = kFixedFrameSize / kPointerSize; \ static constexpr int kFixedSlotCount = kFixedFrameSize / kSystemPointerSize; \
static constexpr int kFixedFrameSizeFromFp = \ static constexpr int kFixedFrameSizeFromFp = \
TYPED_FRAME_SIZE_FROM_SP(count); \ TYPED_FRAME_SIZE_FROM_SP(count); \
static constexpr int kFixedSlotCountFromFp = \ static constexpr int kFixedSlotCountFromFp = \
kFixedFrameSizeFromFp / kPointerSize kFixedFrameSizeFromFp / kSystemPointerSize
class ArgumentsAdaptorFrameConstants : public TypedFrameConstants { class ArgumentsAdaptorFrameConstants : public TypedFrameConstants {
public: public:
...@@ -278,11 +281,14 @@ class BuiltinContinuationFrameConstants : public TypedFrameConstants { ...@@ -278,11 +281,14 @@ class BuiltinContinuationFrameConstants : public TypedFrameConstants {
// Behaves like an exit frame but with target and new target args. // Behaves like an exit frame but with target and new target args.
class BuiltinExitFrameConstants : public CommonFrameConstants { class BuiltinExitFrameConstants : public CommonFrameConstants {
public: public:
static constexpr int kNewTargetOffset = kCallerPCOffset + 1 * kPointerSize; static constexpr int kNewTargetOffset =
static constexpr int kTargetOffset = kNewTargetOffset + 1 * kPointerSize; kCallerPCOffset + 1 * kSystemPointerSize;
static constexpr int kArgcOffset = kTargetOffset + 1 * kPointerSize; static constexpr int kTargetOffset =
static constexpr int kPaddingOffset = kArgcOffset + 1 * kPointerSize; kNewTargetOffset + 1 * kSystemPointerSize;
static constexpr int kFirstArgumentOffset = kPaddingOffset + 1 * kPointerSize; static constexpr int kArgcOffset = kTargetOffset + 1 * kSystemPointerSize;
static constexpr int kPaddingOffset = kArgcOffset + 1 * kSystemPointerSize;
static constexpr int kFirstArgumentOffset =
kPaddingOffset + 1 * kSystemPointerSize;
static constexpr int kNumExtraArgsWithReceiver = 5; static constexpr int kNumExtraArgsWithReceiver = 5;
}; };
...@@ -290,9 +296,9 @@ class InterpreterFrameConstants : public AllStatic { ...@@ -290,9 +296,9 @@ class InterpreterFrameConstants : public AllStatic {
public: public:
// Fixed frame includes bytecode array and bytecode offset. // Fixed frame includes bytecode array and bytecode offset.
static constexpr int kFixedFrameSize = static constexpr int kFixedFrameSize =
StandardFrameConstants::kFixedFrameSize + 2 * kPointerSize; StandardFrameConstants::kFixedFrameSize + 2 * kSystemPointerSize;
static constexpr int kFixedFrameSizeFromFp = static constexpr int kFixedFrameSizeFromFp =
StandardFrameConstants::kFixedFrameSizeFromFp + 2 * kPointerSize; StandardFrameConstants::kFixedFrameSizeFromFp + 2 * kSystemPointerSize;
// FP-relative. // FP-relative.
static constexpr int kLastParamFromFp = static constexpr int kLastParamFromFp =
...@@ -300,18 +306,18 @@ class InterpreterFrameConstants : public AllStatic { ...@@ -300,18 +306,18 @@ class InterpreterFrameConstants : public AllStatic {
static constexpr int kCallerPCOffsetFromFp = static constexpr int kCallerPCOffsetFromFp =
StandardFrameConstants::kCallerPCOffset; StandardFrameConstants::kCallerPCOffset;
static constexpr int kBytecodeArrayFromFp = static constexpr int kBytecodeArrayFromFp =
-StandardFrameConstants::kFixedFrameSizeFromFp - 1 * kPointerSize; -StandardFrameConstants::kFixedFrameSizeFromFp - 1 * kSystemPointerSize;
static constexpr int kBytecodeOffsetFromFp = static constexpr int kBytecodeOffsetFromFp =
-StandardFrameConstants::kFixedFrameSizeFromFp - 2 * kPointerSize; -StandardFrameConstants::kFixedFrameSizeFromFp - 2 * kSystemPointerSize;
static constexpr int kRegisterFileFromFp = static constexpr int kRegisterFileFromFp =
-StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kPointerSize; -StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kSystemPointerSize;
static constexpr int kExpressionsOffset = kRegisterFileFromFp; static constexpr int kExpressionsOffset = kRegisterFileFromFp;
// Number of fixed slots in addition to a {StandardFrame}. // Number of fixed slots in addition to a {StandardFrame}.
static constexpr int kExtraSlotCount = static constexpr int kExtraSlotCount =
InterpreterFrameConstants::kFixedFrameSize / kPointerSize - InterpreterFrameConstants::kFixedFrameSize / kSystemPointerSize -
StandardFrameConstants::kFixedFrameSize / kPointerSize; StandardFrameConstants::kFixedFrameSize / kSystemPointerSize;
// Expression index for {StandardFrame::GetExpressionAddress}. // Expression index for {StandardFrame::GetExpressionAddress}.
static constexpr int kBytecodeArrayExpressionIndex = -2; static constexpr int kBytecodeArrayExpressionIndex = -2;
...@@ -326,12 +332,12 @@ class InterpreterFrameConstants : public AllStatic { ...@@ -326,12 +332,12 @@ class InterpreterFrameConstants : public AllStatic {
inline static int FPOffsetToFrameSlot(int frame_offset) { inline static int FPOffsetToFrameSlot(int frame_offset) {
return StandardFrameConstants::kFixedSlotCountAboveFp - 1 - return StandardFrameConstants::kFixedSlotCountAboveFp - 1 -
frame_offset / kPointerSize; frame_offset / kSystemPointerSize;
} }
inline static int FrameSlotToFPOffset(int slot) { inline static int FrameSlotToFPOffset(int slot) {
return (StandardFrameConstants::kFixedSlotCountAboveFp - 1 - slot) * return (StandardFrameConstants::kFixedSlotCountAboveFp - 1 - slot) *
kPointerSize; kSystemPointerSize;
} }
} // namespace internal } // namespace internal
......
...@@ -126,7 +126,7 @@ class Immediate { ...@@ -126,7 +126,7 @@ class Immediate {
friend class Assembler; friend class Assembler;
}; };
ASSERT_TRIVIALLY_COPYABLE(Immediate); ASSERT_TRIVIALLY_COPYABLE(Immediate);
static_assert(sizeof(Immediate) <= kPointerSize, static_assert(sizeof(Immediate) <= kSystemPointerSize,
"Immediate must be small enough to pass it by value"); "Immediate must be small enough to pass it by value");
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment