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 4dc01b43208bbda09227834c32f00ba80f9f7dbf..0207a422837846a7f89e5d7ccffa820956292651 100644 |
--- a/src/compiler/ia32/code-generator-ia32.cc |
+++ b/src/compiler/ia32/code-generator-ia32.cc |
@@ -330,6 +330,12 @@ class OutOfLineRecordWrite final : public OutOfLineCode { |
__ bind(&done); \ |
} while (false) |
+void CodeGenerator::AssembleDeconstructFrame() { |
+ __ mov(esp, ebp); |
+ __ pop(ebp); |
+} |
+ |
+void CodeGenerator::AssembleSetupStackPointer() {} |
void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
@@ -346,7 +352,7 @@ void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) { |
__ sub(esp, Immediate(-sp_slot_delta * kPointerSize)); |
frame_access_state()->IncreaseSPDelta(-sp_slot_delta); |
} |
- if (frame()->needs_frame()) { |
+ if (frame_access_state()->has_frame()) { |
__ mov(ebp, MemOperand(ebp, 0)); |
} |
frame_access_state()->SetFrameAccessToSP(); |
@@ -514,7 +520,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
__ mov(i.OutputRegister(), ebp); |
break; |
case kArchParentFramePointer: |
- if (frame_access_state()->frame()->needs_frame()) { |
+ if (frame_access_state()->has_frame()) { |
__ mov(i.OutputRegister(), Operand(ebp, 0)); |
} else { |
__ mov(i.OutputRegister(), ebp); |
@@ -1595,7 +1601,7 @@ void CodeGenerator::AssembleDeoptimizerCall( |
void CodeGenerator::AssemblePrologue() { |
CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
- if (frame()->needs_frame()) { |
+ if (frame_access_state()->has_frame()) { |
if (descriptor->IsCFunctionCall()) { |
__ push(ebp); |
__ mov(ebp, esp); |
@@ -1604,11 +1610,7 @@ void CodeGenerator::AssemblePrologue() { |
} else { |
__ StubPrologue(info()->GetOutputStackFrameType()); |
} |
- } else { |
- frame()->SetElidedFrameSizeInSlots(kPCOnStackSize / kPointerSize); |
} |
- frame_access_state()->SetFrameAccessToDefault(); |
- |
int stack_shrink_slots = frame()->GetSpillSlotCount(); |
if (info()->is_osr()) { |
// TurboFan OSR-compiled functions cannot be entered directly. |
@@ -1654,17 +1656,15 @@ void CodeGenerator::AssembleReturn() { |
} |
if (descriptor->IsCFunctionCall()) { |
- __ mov(esp, ebp); // Move stack pointer back to frame pointer. |
- __ pop(ebp); // Pop caller's frame pointer. |
- } else if (frame()->needs_frame()) { |
+ AssembleDeconstructFrame(); |
+ } else if (frame_access_state()->has_frame()) { |
// Canonicalize JSFunction return sites for now. |
if (return_label_.is_bound()) { |
__ jmp(&return_label_); |
return; |
} else { |
__ bind(&return_label_); |
- __ mov(esp, ebp); // Move stack pointer back to frame pointer. |
- __ pop(ebp); // Pop caller's frame pointer. |
+ AssembleDeconstructFrame(); |
} |
} |
size_t pop_size = descriptor->StackParameterCount() * kPointerSize; |