Index: src/compiler/x87/code-generator-x87.cc |
diff --git a/src/compiler/x87/code-generator-x87.cc b/src/compiler/x87/code-generator-x87.cc |
index bda59bb139bf571c8b75bbc1db7321be8c6cb5a1..c3ff08e6047b7f372d2ed7eaad39296c9dbb2844 100644 |
--- a/src/compiler/x87/code-generator-x87.cc |
+++ b/src/compiler/x87/code-generator-x87.cc |
@@ -330,13 +330,20 @@ class OutOfLineRecordWrite final : public OutOfLineCode { |
} while (false) |
-void CodeGenerator::AssembleDeconstructActivationRecord() { |
+void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
int stack_slots = frame()->GetSpillSlotCount(); |
if (descriptor->IsJSFunctionCall() || stack_slots > 0) { |
__ mov(esp, ebp); |
__ pop(ebp); |
} |
+ if (stack_param_delta < 0) { |
+ int offset = -(stack_param_delta + 1) * kPointerSize; |
+ __ pop(Operand(esp, offset)); |
+ if (offset != 0) { |
+ __ add(esp, Immediate(offset)); |
+ } |
+ } |
} |
@@ -372,7 +379,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
break; |
} |
case kArchTailCallCodeObject: { |
- AssembleDeconstructActivationRecord(); |
+ int stack_param_delta = i.InputInt32(instr->InputCount() - 1); |
+ AssembleDeconstructActivationRecord(stack_param_delta); |
if (HasImmediateInput(instr, 0)) { |
Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0)); |
__ jmp(code, RelocInfo::CODE_TARGET); |
@@ -415,7 +423,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
__ cmp(esi, FieldOperand(func, JSFunction::kContextOffset)); |
__ Assert(equal, kWrongFunctionContext); |
} |
- AssembleDeconstructActivationRecord(); |
+ int stack_param_delta = i.InputInt32(instr->InputCount() - 1); |
+ AssembleDeconstructActivationRecord(stack_param_delta); |
__ jmp(FieldOperand(func, JSFunction::kCodeEntryOffset)); |
break; |
} |