| Index: src/mips/builtins-mips.cc
 | 
| diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc
 | 
| index 37055044db9d5f6d2f4dce87dc7443a995756228..d4802b306e8a3eabe3dee186d14baac1629d3195 100644
 | 
| --- a/src/mips/builtins-mips.cc
 | 
| +++ b/src/mips/builtins-mips.cc
 | 
| @@ -145,6 +145,8 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
 | 
|  void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
 | 
|    // ----------- S t a t e -------------
 | 
|    //  -- a0                 : number of arguments
 | 
| +  //  -- a1                 : function
 | 
| +  //  -- cp                 : context
 | 
|    //  -- ra                 : return address
 | 
|    //  -- sp[(argc - n) * 8] : arg[n] (zero-based)
 | 
|    //  -- sp[(argc + 1) * 8] : receiver
 | 
| @@ -154,9 +156,9 @@ void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
 | 
|                                       : Heap::kMinusInfinityValueRootIndex;
 | 
|  
 | 
|    // Load the accumulator with the default return value (either -Infinity or
 | 
| -  // +Infinity), with the tagged value in a1 and the double value in f0.
 | 
| -  __ LoadRoot(a1, root_index);
 | 
| -  __ ldc1(f0, FieldMemOperand(a1, HeapNumber::kValueOffset));
 | 
| +  // +Infinity), with the tagged value in t2 and the double value in f0.
 | 
| +  __ LoadRoot(t2, root_index);
 | 
| +  __ ldc1(f0, FieldMemOperand(t2, HeapNumber::kValueOffset));
 | 
|    __ Addu(a3, a0, Operand(1));
 | 
|  
 | 
|    Label done_loop, loop;
 | 
| @@ -179,26 +181,31 @@ void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
 | 
|      __ JumpIfRoot(t0, Heap::kHeapNumberMapRootIndex, &convert_number);
 | 
|      {
 | 
|        // Parameter is not a Number, use the ToNumber builtin to convert it.
 | 
| -      FrameScope scope(masm, StackFrame::INTERNAL);
 | 
| +      FrameScope scope(masm, StackFrame::MANUAL);
 | 
| +      __ Push(ra, fp);
 | 
| +      __ Move(fp, sp);
 | 
| +      __ Push(cp, a1);
 | 
|        __ SmiTag(a0);
 | 
|        __ SmiTag(a3);
 | 
| -      __ Push(a0, a1, a3);
 | 
| +      __ Push(a0, t2, a3);
 | 
|        __ mov(a0, a2);
 | 
|        __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
 | 
|        __ mov(a2, v0);
 | 
| -      __ Pop(a0, a1, a3);
 | 
| +      __ Pop(a0, t2, a3);
 | 
|        {
 | 
|          // Restore the double accumulator value (f0).
 | 
|          Label restore_smi, done_restore;
 | 
| -        __ JumpIfSmi(a1, &restore_smi);
 | 
| -        __ ldc1(f0, FieldMemOperand(a1, HeapNumber::kValueOffset));
 | 
| +        __ JumpIfSmi(t2, &restore_smi);
 | 
| +        __ ldc1(f0, FieldMemOperand(t2, HeapNumber::kValueOffset));
 | 
|          __ jmp(&done_restore);
 | 
|          __ bind(&restore_smi);
 | 
| -        __ SmiToDoubleFPURegister(a1, f0, t0);
 | 
| +        __ SmiToDoubleFPURegister(t2, f0, t0);
 | 
|          __ bind(&done_restore);
 | 
|        }
 | 
|        __ SmiUntag(a3);
 | 
|        __ SmiUntag(a0);
 | 
| +      __ Pop(cp, a1);
 | 
| +      __ Pop(ra, fp);
 | 
|      }
 | 
|      __ jmp(&convert);
 | 
|      __ bind(&convert_number);
 | 
| @@ -226,20 +233,20 @@ void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
 | 
|      __ Branch(&set_value, ne, t1, Operand(t8));
 | 
|      __ jmp(&loop);
 | 
|      __ bind(&set_value);
 | 
| -    __ mov(a1, a2);
 | 
| +    __ mov(t2, a2);
 | 
|      __ jmp(&loop);
 | 
|  
 | 
|      // At least one side is NaN, which means that the result will be NaN too.
 | 
|      __ bind(&compare_nan);
 | 
| -    __ LoadRoot(a1, Heap::kNanValueRootIndex);
 | 
| -    __ ldc1(f0, FieldMemOperand(a1, HeapNumber::kValueOffset));
 | 
| +    __ LoadRoot(t2, Heap::kNanValueRootIndex);
 | 
| +    __ ldc1(f0, FieldMemOperand(t2, HeapNumber::kValueOffset));
 | 
|      __ jmp(&loop);
 | 
|    }
 | 
|  
 | 
|    __ bind(&done_loop);
 | 
|    __ Lsa(sp, sp, a3, kPointerSizeLog2);
 | 
|    __ Ret(USE_DELAY_SLOT);
 | 
| -  __ mov(v0, a1);  // In delay slot.
 | 
| +  __ mov(v0, t2);  // In delay slot.
 | 
|  }
 | 
|  
 | 
|  // static
 | 
| 
 |