// 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
}
#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;