Chromium Code Reviews| Index: src/compiler/ppc/code-generator-ppc.cc |
| diff --git a/src/compiler/ppc/code-generator-ppc.cc b/src/compiler/ppc/code-generator-ppc.cc |
| index 51a8950a84dff355bb2a286a30e179fa6189a4c0..bb4bade1e107b2922d3b7dc95c1902bc50a3ab03 100644 |
| --- a/src/compiler/ppc/code-generator-ppc.cc |
| +++ b/src/compiler/ppc/code-generator-ppc.cc |
| @@ -694,8 +694,6 @@ void CodeGenerator::AssembleDeconstructFrame() { |
| __ LeaveFrame(StackFrame::MANUAL); |
| } |
| -void CodeGenerator::AssembleSetupStackPointer() {} |
| - |
| void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
| int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
| if (sp_slot_delta > 0) { |
| @@ -1754,8 +1752,35 @@ void CodeGenerator::AssembleDeoptimizerCall( |
| __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
| } |
| +void CodeGenerator::FinishFrame(Frame* frame) { |
| + CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| + const RegList double_saves = descriptor->CalleeSavedFPRegisters(); |
| + |
| + // Save callee-saved Double registers. |
| + if (double_saves != 0) { |
| + frame->AlignSavedCalleeRegisterSlots(); |
| + __ MultiPushDoubles(double_saves); |
|
MTBrandyberry
2016/04/20 17:47:38
Don't think we want to push here.
|
| + DCHECK(kNumCalleeSavedDoubles == |
| + base::bits::CountPopulation32(double_saves)); |
| + frame->AllocateSavedCalleeRegisterSlots(kNumCalleeSavedDoubles * |
| + (kDoubleSize / kPointerSize)); |
| + } |
| + // Save callee-saved registers. |
| + const RegList saves = |
| + FLAG_enable_embedded_constant_pool |
| + ? descriptor->CalleeSavedRegisters() & ~kConstantPoolRegister.bit() |
| + : descriptor->CalleeSavedRegisters(); |
| + if (saves != 0) { |
| + __ MultiPush(saves); |
|
MTBrandyberry
2016/04/20 17:47:38
Ditto.
|
| + // register save area does not include the fp or constant pool pointer. |
| + const int num_saves = |
| + kNumCalleeSaved - 1 - (FLAG_enable_embedded_constant_pool ? 1 : 0); |
| + DCHECK(num_saves == base::bits::CountPopulation32(saves)); |
| + frame->AllocateSavedCalleeRegisterSlots(num_saves); |
| + } |
| +} |
| -void CodeGenerator::AssemblePrologue() { |
| +void CodeGenerator::AssembleConstructFrame() { |
| CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| if (frame_access_state()->has_frame()) { |
| if (descriptor->IsCFunctionCall()) { |
| @@ -1779,7 +1804,7 @@ void CodeGenerator::AssemblePrologue() { |
| } |
| } |
| - int stack_shrink_slots = frame()->GetSpillSlotCount(); |
| + int shrink_slots = frame()->GetSpillSlotCount(); |
| if (info()->is_osr()) { |
| // TurboFan OSR-compiled functions cannot be entered directly. |
| __ Abort(kShouldNotDirectlyEnterOsrFunction); |
| @@ -1790,15 +1815,12 @@ void CodeGenerator::AssemblePrologue() { |
| // remaining stack slots. |
| if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
| osr_pc_offset_ = __ pc_offset(); |
| - stack_shrink_slots -= OsrHelper(info()).UnoptimizedFrameSlots(); |
| + shrink_slots -= OsrHelper(info()).UnoptimizedFrameSlots(); |
| } |
| const RegList double_saves = descriptor->CalleeSavedFPRegisters(); |
| - if (double_saves != 0) { |
| - stack_shrink_slots += frame()->AlignSavedCalleeRegisterSlots(); |
| - } |
| - if (stack_shrink_slots > 0) { |
| - __ Add(sp, sp, -stack_shrink_slots * kPointerSize, r0); |
| + if (shrink_slots > 0) { |
| + __ Add(sp, sp, -shrink_slots * kPointerSize, r0); |
| } |
| // Save callee-saved Double registers. |
| @@ -1806,8 +1828,6 @@ void CodeGenerator::AssemblePrologue() { |
| __ MultiPushDoubles(double_saves); |
| DCHECK(kNumCalleeSavedDoubles == |
| base::bits::CountPopulation32(double_saves)); |
| - frame()->AllocateSavedCalleeRegisterSlots(kNumCalleeSavedDoubles * |
| - (kDoubleSize / kPointerSize)); |
| } |
| // Save callee-saved registers. |
| @@ -1818,10 +1838,6 @@ void CodeGenerator::AssemblePrologue() { |
| if (saves != 0) { |
| __ MultiPush(saves); |
| // register save area does not include the fp or constant pool pointer. |
| - const int num_saves = |
| - kNumCalleeSaved - 1 - (FLAG_enable_embedded_constant_pool ? 1 : 0); |
| - DCHECK(num_saves == base::bits::CountPopulation32(saves)); |
| - frame()->AllocateSavedCalleeRegisterSlots(num_saves); |
| } |
| } |