diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc index 30058d1d53..420e2ca3b4 100644 --- a/src/mips/builtins-mips.cc +++ b/src/mips/builtins-mips.cc @@ -1575,20 +1575,20 @@ void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { // Adjust for return address and receiver. __ Addu(a0, a0, Operand(2 * kPointerSize)); // Compute copy end address. Also adjust for return address. - __ Addu(t1, fp, kPointerSize); + __ Addu(t3, fp, kPointerSize); // Copy the arguments (including the receiver) to the new stack frame. // a0: copy start address // a1: function // a2: expected number of arguments // a3: code entry to call - // t1: copy end address + // t3: copy end address Label copy; __ bind(©); __ lw(t0, MemOperand(a0)); // Adjusted above for return addr and receiver. __ push(t0); __ Subu(a0, a0, kPointerSize); - __ Branch(©, ne, a0, Operand(t1)); + __ Branch(©, ne, a0, Operand(t3)); // Fill the remaining expected arguments with undefined. // a1: function diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc index 31b90663bc..b98831af17 100644 --- a/src/mips/full-codegen-mips.cc +++ b/src/mips/full-codegen-mips.cc @@ -147,11 +147,11 @@ void FullCodeGenerator::Generate(CompilationInfo* info) { } #endif - // Strict mode functions need to replace the receiver with undefined - // when called as functions (without an explicit receiver - // object). t1 is zero for method calls and non-zero for function - // calls. - if (info->is_strict_mode()) { + // Strict mode functions and builtins need to replace the receiver + // with undefined when called as functions (without an explicit + // receiver object). t1 is zero for method calls and non-zero for + // function calls. + if (info->is_strict_mode() || info->is_native()) { Label ok; __ Branch(&ok, eq, t1, Operand(zero_reg)); int receiver_offset = scope()->num_parameters() * kPointerSize;