Index: src/compiler/ia32/code-generator-ia32.cc |
diff --git a/src/compiler/ia32/code-generator-ia32.cc b/src/compiler/ia32/code-generator-ia32.cc |
index b355d24941551e72a9035e8a8b9ef53343ed844f..6b821d93f50ff1ec8ed5d60836f0fd4467a06189 100644 |
--- a/src/compiler/ia32/code-generator-ia32.cc |
+++ b/src/compiler/ia32/code-generator-ia32.cc |
@@ -335,8 +335,6 @@ void CodeGenerator::AssembleDeconstructFrame() { |
__ pop(ebp); |
} |
-void CodeGenerator::AssembleSetupStackPointer() {} |
- |
void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
if (sp_slot_delta > 0) { |
@@ -1610,8 +1608,26 @@ void CodeGenerator::AssembleDeoptimizerCall( |
// | RET | args | caller frame | |
// ^ esp ^ ebp |
+void CodeGenerator::FinishFrame(Frame* frame) { |
+ CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
+ int stack_shrink_slots = frame->GetSpillSlotCount(); |
+ if (info()->is_osr()) { |
+ stack_shrink_slots -= OsrHelper(info()).UnoptimizedFrameSlots(); |
+ } |
+ const RegList saves = descriptor->CalleeSavedRegisters(); |
+ if (saves != 0) { // Save callee-saved registers. |
+ DCHECK(!info()->is_osr()); |
+ int pushed = 0; |
+ for (int i = Register::kNumRegisters - 1; i >= 0; i--) { |
+ if (!((1 << i) & saves)) continue; |
+ ++pushed; |
+ } |
+ frame->AllocateSavedCalleeRegisterSlots(pushed); |
+ } |
+ frame->set_stack_shrink_slots(stack_shrink_slots); |
+} |
-void CodeGenerator::AssemblePrologue() { |
+void CodeGenerator::AssembleConstructFrame() { |
CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
if (frame_access_state()->has_frame()) { |
if (descriptor->IsCFunctionCall()) { |
@@ -1623,7 +1639,7 @@ void CodeGenerator::AssemblePrologue() { |
__ StubPrologue(info()->GetOutputStackFrameType()); |
} |
} |
- int stack_shrink_slots = frame()->GetSpillSlotCount(); |
+ |
if (info()->is_osr()) { |
// TurboFan OSR-compiled functions cannot be entered directly. |
__ Abort(kShouldNotDirectlyEnterOsrFunction); |
@@ -1634,12 +1650,11 @@ void CodeGenerator::AssemblePrologue() { |
// remaining stack slots. |
if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
osr_pc_offset_ = __ pc_offset(); |
- stack_shrink_slots -= OsrHelper(info()).UnoptimizedFrameSlots(); |
} |
const RegList saves = descriptor->CalleeSavedRegisters(); |
- if (stack_shrink_slots > 0) { |
- __ sub(esp, Immediate(stack_shrink_slots * kPointerSize)); |
+ if (frame()->stack_shrink_slots() > 0) { |
+ __ sub(esp, Immediate(frame()->stack_shrink_slots() * kPointerSize)); |
} |
if (saves != 0) { // Save callee-saved registers. |
@@ -1650,7 +1665,6 @@ void CodeGenerator::AssemblePrologue() { |
__ push(Register::from_code(i)); |
++pushed; |
} |
- frame()->AllocateSavedCalleeRegisterSlots(pushed); |
} |
} |