Commit d7f2f83b authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

MIPS:port Reapply change to Pass undefined to JS builtins when called with implicit receiver.

Port r8110 (0a6ff3a) to mips.

Some mips work was in original commit. Fixed bug due to Generate_ArgumentsAdaptorTrampoline
using the dedicated CallKind reg (t1) as a temporary.

BUG=
TEST=

Review URL: http://codereview.chromium.org//7027024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8137 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent dae36594
......@@ -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(&copy);
__ lw(t0, MemOperand(a0)); // Adjusted above for return addr and receiver.
__ push(t0);
__ Subu(a0, a0, kPointerSize);
__ Branch(&copy, ne, a0, Operand(t1));
__ Branch(&copy, ne, a0, Operand(t3));
// Fill the remaining expected arguments with undefined.
// a1: function
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment