Chromium Code Reviews| Index: src/compiler/arm/code-generator-arm.cc |
| diff --git a/src/compiler/arm/code-generator-arm.cc b/src/compiler/arm/code-generator-arm.cc |
| index 474e41dc99c07d6e488bc3edff25a573b56176fe..584871944dea59771ee0b1ef416b91b216c4fdbd 100644 |
| --- a/src/compiler/arm/code-generator-arm.cc |
| +++ b/src/compiler/arm/code-generator-arm.cc |
| @@ -244,7 +244,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode { |
| : OMIT_REMEMBERED_SET; |
| SaveFPRegsMode const save_fp_mode = |
| frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs; |
| - if (!frame()->needs_frame()) { |
| + if (!frame_access_state()->access_frame_with_fp()) { |
|
danno
2016/03/16 18:18:11
Here and below, and on other ARM-like platforms, I
Mircea Trofin
2016/03/16 20:20:46
Ah, yes! I started from Intel and ended up cargo-c
|
| // We need to save and restore lr if the frame was elided. |
| __ Push(lr); |
| } |
| @@ -257,7 +257,7 @@ class OutOfLineRecordWrite final : public OutOfLineCode { |
| __ add(scratch1_, object_, Operand(index_)); |
| } |
| __ CallStub(&stub); |
| - if (!frame()->needs_frame()) { |
| + if (!frame_access_state()->access_frame_with_fp()) { |
| __ Pop(lr); |
| } |
| } |
| @@ -386,6 +386,9 @@ Condition FlagsConditionToCondition(FlagsCondition condition) { |
| DCHECK_EQ(LeaveCC, i.OutputSBit()); \ |
| } while (0) |
| +void CodeGenerator::AssembleDeconstructFrame() { |
| + __ LeaveFrame(StackFrame::MANUAL); |
| +} |
| void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
| int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
| @@ -402,7 +405,7 @@ void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) { |
| __ sub(sp, sp, Operand(-sp_slot_delta * kPointerSize)); |
| frame_access_state()->IncreaseSPDelta(-sp_slot_delta); |
| } |
| - if (frame()->needs_frame()) { |
| + if (frame_access_state()->access_frame_with_fp()) { |
| if (FLAG_enable_embedded_constant_pool) { |
| __ ldr(cp, MemOperand(fp, StandardFrameConstants::kConstantPoolOffset)); |
| } |
| @@ -580,7 +583,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
| DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| break; |
| case kArchParentFramePointer: |
| - if (frame_access_state()->frame()->needs_frame()) { |
| + if (frame_access_state()->access_frame_with_fp()) { |
| __ ldr(i.OutputRegister(), MemOperand(fp, 0)); |
| } else { |
| __ mov(i.OutputRegister(), fp); |
| @@ -1199,6 +1202,7 @@ void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { |
| void CodeGenerator::AssembleArchJump(RpoNumber target) { |
| + AssembleDeconstructFrameBetweenBlocks(); |
| if (!IsNextInAssemblyOrder(target)) __ b(GetLabel(target)); |
| } |
| @@ -1259,7 +1263,7 @@ void CodeGenerator::AssembleDeoptimizerCall( |
| void CodeGenerator::AssemblePrologue() { |
| CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| - if (frame()->needs_frame()) { |
| + if (frame_access_state()->access_frame_with_fp()) { |
| if (descriptor->IsCFunctionCall()) { |
| if (FLAG_enable_embedded_constant_pool) { |
| __ Push(lr, fp, pp); |
| @@ -1274,10 +1278,7 @@ void CodeGenerator::AssemblePrologue() { |
| } else { |
| __ StubPrologue(info()->GetOutputStackFrameType()); |
| } |
| - } else { |
| - frame()->SetElidedFrameSizeInSlots(0); |
| } |
| - frame_access_state()->SetFrameAccessToDefault(); |
| int stack_shrink_slots = frame()->GetSpillSlotCount(); |
| if (info()->is_osr()) { |
| @@ -1347,15 +1348,16 @@ void CodeGenerator::AssembleReturn() { |
| } |
| if (descriptor->IsCFunctionCall()) { |
| - __ LeaveFrame(StackFrame::MANUAL); |
| - } else if (frame()->needs_frame()) { |
| + AssembleDeconstructFrameWhenLeaving(); |
| + } else if (frame_access_state()->access_frame_with_fp()) { |
| // Canonicalize JSFunction return sites for now. |
| if (return_label_.is_bound()) { |
| + AssembleDeconstructFrameBetweenBlocks(); |
| __ b(&return_label_); |
| return; |
| } else { |
| __ bind(&return_label_); |
| - __ LeaveFrame(StackFrame::MANUAL); |
| + AssembleDeconstructFrameWhenLeaving(); |
| } |
| } |
| __ Ret(pop_count); |