| Index: src/compiler/arm64/code-generator-arm64.cc
|
| diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc
|
| index ee1315989e0ad1e36458de31757b7e854b981177..b03eb5520ed178011ea3db09158164597e514aee 100644
|
| --- a/src/compiler/arm64/code-generator-arm64.cc
|
| +++ b/src/compiler/arm64/code-generator-arm64.cc
|
| @@ -205,11 +205,13 @@ class Arm64OperandConverter final : public InstructionOperandConverter {
|
| MemOperand ToMemOperand(InstructionOperand* op, MacroAssembler* masm) const {
|
| DCHECK(op != NULL);
|
| DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot());
|
| - FrameOffset offset =
|
| - linkage()->GetFrameOffset(AllocatedOperand::cast(op)->index(), frame());
|
| + FrameOffset offset = linkage()->GetFrameOffset(
|
| + AllocatedOperand::cast(op)->index(), frame_access_state());
|
| if (offset.from_frame_pointer()) {
|
| int from_sp =
|
| - offset.offset() + (frame()->GetSpToFpSlotCount() * kPointerSize);
|
| + offset.offset() +
|
| + ((frame()->GetSpToFpSlotCount() + frame_access_state()->sp_delta()) *
|
| + kPointerSize);
|
| // Convert FP-offsets to SP-offsets if it results in better code.
|
| if (Assembler::IsImmLSUnscaled(from_sp) ||
|
| Assembler::IsImmLSScaled(from_sp, LSDoubleWord)) {
|
| @@ -477,6 +479,7 @@ void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) {
|
| }
|
| __ Pop(fp, lr);
|
| }
|
| + frame_access_state()->UseDefaultFrameAccess();
|
| }
|
|
|
|
|
| @@ -490,8 +493,10 @@ void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) {
|
| total_discarded_slots -= stack_param_delta;
|
| if (total_discarded_slots < 0) {
|
| __ Sub(jssp, jssp, Operand(-total_discarded_slots * kPointerSize));
|
| + frame_access_state()->IncreaseSPDelta(-total_discarded_slots);
|
| }
|
| }
|
| + frame_access_state()->UseSPToAccessFrame();
|
| }
|
|
|
|
|
| @@ -510,7 +515,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
|
| __ Add(target, target, Code::kHeaderSize - kHeapObjectTag);
|
| __ Call(target);
|
| }
|
| - frame()->ClearOutgoingParameterSlots();
|
| + frame_access_state()->ClearSPDelta();
|
| RecordCallPosition(instr);
|
| break;
|
| }
|
| @@ -525,7 +530,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
|
| __ Add(target, target, Code::kHeaderSize - kHeapObjectTag);
|
| __ Jump(target);
|
| }
|
| - frame()->ClearOutgoingParameterSlots();
|
| + frame_access_state()->ClearSPDelta();
|
| break;
|
| }
|
| case kArchCallJSFunction: {
|
| @@ -541,7 +546,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
|
| }
|
| __ Ldr(x10, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
|
| __ Call(x10);
|
| - frame()->ClearOutgoingParameterSlots();
|
| + frame_access_state()->ClearSPDelta();
|
| RecordCallPosition(instr);
|
| break;
|
| }
|
| @@ -559,7 +564,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
|
| AssembleDeconstructActivationRecord(stack_param_delta);
|
| __ Ldr(x10, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
|
| __ Jump(x10);
|
| - frame()->ClearOutgoingParameterSlots();
|
| + frame_access_state()->ClearSPDelta();
|
| break;
|
| }
|
| case kArchLazyBailout: {
|
| @@ -587,7 +592,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
|
| }
|
| // CallCFunction only supports register arguments so we never need to call
|
| // frame()->ClearOutgoingParameterSlots() here.
|
| - DCHECK(frame()->GetOutgoingParameterSlotCount() == 0);
|
| + DCHECK(frame_access_state()->sp_delta() == 0);
|
| break;
|
| }
|
| case kArchJmp:
|
| @@ -873,7 +878,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
|
| break;
|
| case kArm64ClaimForCallArguments: {
|
| __ Claim(i.InputInt32(0));
|
| - frame()->AllocateOutgoingParameterSlots(i.InputInt32(0));
|
| + frame_access_state()->IncreaseSPDelta(i.InputInt32(0));
|
| break;
|
| }
|
| case kArm64Poke: {
|
| @@ -1283,12 +1288,13 @@ void CodeGenerator::AssemblePrologue() {
|
| CompilationInfo* info = this->info();
|
| __ SetStackPointer(jssp);
|
| __ Prologue(info->IsCodePreAgingActive());
|
| - } else if (needs_frame_) {
|
| + } else if (frame()->needs_frame()) {
|
| __ SetStackPointer(jssp);
|
| __ StubPrologue();
|
| } else {
|
| frame()->SetElidedFrameSizeInSlots(0);
|
| }
|
| + frame_access_state()->UseDefaultFrameAccess();
|
|
|
| int stack_shrink_slots = frame()->GetSpillSlotCount();
|
| if (info()->is_osr()) {
|
| @@ -1358,7 +1364,7 @@ void CodeGenerator::AssembleReturn() {
|
| if (descriptor->kind() == CallDescriptor::kCallAddress) {
|
| __ Mov(csp, fp);
|
| __ Pop(fp, lr);
|
| - } else if (descriptor->IsJSFunctionCall() || needs_frame_) {
|
| + } else if (descriptor->IsJSFunctionCall() || frame()->needs_frame()) {
|
| // Canonicalize JSFunction return sites for now.
|
| if (return_label_.is_bound()) {
|
| __ B(&return_label_);
|
|
|