Index: src/compiler/code-generator.cc |
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc |
index cd36950f56f5a48d92eb8f02e619871e802662bc..de3edaab3d5712653f8ea1269929efdf6e4ebb25 100644 |
--- a/src/compiler/code-generator.cc |
+++ b/src/compiler/code-generator.cc |
@@ -669,6 +669,22 @@ void CodeGenerator::MarkLazyDeoptSite() { |
} |
+int CodeGenerator::TailCallFrameStackSlotDelta(int stack_param_delta) { |
+ CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
+ int spill_slots = frame()->GetSpillSlotCount(); |
+ bool has_frame = descriptor->IsJSFunctionCall() || spill_slots > 0; |
+ // Leave the PC and saved frame pointer on the stack. |
+ int sp_slot_delta = |
+ has_frame |
+ ? (frame()->GetTotalFrameSlotCount() - |
+ (StandardFrameConstants::kFixedFrameSizeFromFp / kPointerSize)) |
+ : 0; |
+ // Discard only slots that won't be used by new parameters. |
+ sp_slot_delta += stack_param_delta; |
+ return sp_slot_delta; |
+} |
+ |
+ |
OutOfLineCode::OutOfLineCode(CodeGenerator* gen) |
: frame_(gen->frame()), masm_(gen->masm()), next_(gen->ools_) { |
gen->ools_ = this; |