Index: src/ia32/builtins-ia32.cc |
diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc |
index 34dd73c33159338813c3f3a942430826e60d38e0..984834b738899e97ef3324a0937c2b4adfbeda33 100644 |
--- a/src/ia32/builtins-ia32.cc |
+++ b/src/ia32/builtins-ia32.cc |
@@ -1553,6 +1553,8 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) { |
void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) { |
// ----------- S t a t e ------------- |
// -- eax : number of arguments |
+ // -- edi : function |
+ // -- esi : context |
// -- esp[0] : return address |
// -- esp[(argc - n) * 8] : arg[n] (zero-based) |
// -- esp[(argc + 1) * 8] : receiver |
@@ -1588,7 +1590,11 @@ void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) { |
Heap::kHeapNumberMapRootIndex, &convert_number); |
{ |
// Parameter is not a Number, use the ToNumberStub to convert it. |
- FrameScope scope(masm, StackFrame::INTERNAL); |
+ FrameScope scope(masm, StackFrame::MANUAL); |
+ __ Push(ebp); |
+ __ Move(ebp, esp); |
+ __ Push(esi); |
+ __ Push(edi); |
__ SmiTag(eax); |
__ SmiTag(ecx); |
__ Push(eax); |
@@ -1601,6 +1607,8 @@ void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) { |
__ Pop(edx); |
__ Pop(ecx); |
__ Pop(eax); |
+ __ Pop(edi); |
+ __ Pop(esi); |
{ |
// Restore the double accumulator value (xmm0). |
Label restore_smi, done_restore; |
@@ -1615,6 +1623,7 @@ void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) { |
} |
__ SmiUntag(ecx); |
__ SmiUntag(eax); |
+ __ leave(); |
} |
__ jmp(&convert); |
__ bind(&convert_number); |