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 9805033edb2530900f941b25fe4ecb7fd348bd07..d337ecc9d845934a614a1167996ea0d5ce120cdd 100644 |
--- a/src/compiler/x87/code-generator-x87.cc |
+++ b/src/compiler/x87/code-generator-x87.cc |
@@ -297,13 +297,6 @@ void CodeGenerator::AssembleDeconstructActivationRecord() { |
if (descriptor->IsJSFunctionCall() || stack_slots > 0) { |
__ mov(esp, ebp); |
__ pop(ebp); |
- int32_t bytes_to_pop = |
- descriptor->IsJSFunctionCall() |
- ? static_cast<int32_t>(descriptor->JSParameterCount() * |
- kPointerSize) |
- : 0; |
- __ pop(Operand(esp, bytes_to_pop)); |
- __ add(esp, Immediate(bytes_to_pop)); |
} |
} |
@@ -1604,8 +1597,14 @@ void CodeGenerator::AssembleReturn() { |
__ pop(ebp); // Pop caller's frame pointer. |
int pop_count = descriptor->IsJSFunctionCall() |
? static_cast<int>(descriptor->JSParameterCount()) |
- : 0; |
- __ Ret(pop_count * kPointerSize, ebx); |
+ : (info()->IsStub() |
+ ? info()->code_stub()->GetStackParameterCount() |
+ : 0); |
+ if (pop_count == 0) { |
+ __ ret(0); |
+ } else { |
+ __ Ret(pop_count * kPointerSize, ebx); |
+ } |
} |
} else { |
__ ret(0); |