Commit 6b4f5aba authored by kasperl@chromium.org's avatar kasperl@chromium.org

Fix issue 67 by copying the receiver function one slot

down too. Also fix lint issue in codegen-arm.cc.

Reviewed offline by Ivan (iposva@chromium.org).
Review URL: http://codereview.chromium.org/3080

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@316 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 88192fc0
...@@ -270,7 +270,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) { ...@@ -270,7 +270,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
__ bind(&done); __ bind(&done);
} }
// 2. Get the function to call. Already in r1. // 2. Get the function to call from the stack.
// r0: actual number of argument // r0: actual number of argument
{ Label done, non_function, function; { Label done, non_function, function;
__ ldr(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2)); __ ldr(r1, MemOperand(sp, r0, LSL, kPointerSizeLog2));
...@@ -360,6 +360,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) { ...@@ -360,6 +360,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
{ Label loop; { Label loop;
// Calculate the copy start address (destination). Copy end address is sp. // Calculate the copy start address (destination). Copy end address is sp.
__ add(r2, sp, Operand(r0, LSL, kPointerSizeLog2)); __ add(r2, sp, Operand(r0, LSL, kPointerSizeLog2));
__ add(r2, r2, Operand(kPointerSize)); // copy receiver too
__ bind(&loop); __ bind(&loop);
__ ldr(ip, MemOperand(r2, -kPointerSize)); __ ldr(ip, MemOperand(r2, -kPointerSize));
...@@ -383,7 +384,6 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) { ...@@ -383,7 +384,6 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
{ Label invoke; { Label invoke;
__ tst(r1, r1); __ tst(r1, r1);
__ b(ne, &invoke); __ b(ne, &invoke);
// __ stop("Generate_ArgumentsAdaptorTrampoline - non-function call");
__ mov(r2, Operand(0)); // expected arguments is 0 for CALL_NON_FUNCTION __ mov(r2, Operand(0)); // expected arguments is 0 for CALL_NON_FUNCTION
__ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION);
__ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)), code_target); __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)), code_target);
......
...@@ -2764,7 +2764,7 @@ void ArmCodeGenerator::VisitSwitchStatement(SwitchStatement* node) { ...@@ -2764,7 +2764,7 @@ void ArmCodeGenerator::VisitSwitchStatement(SwitchStatement* node) {
// Continue matching cases. The program will execute the default case's // Continue matching cases. The program will execute the default case's
// statements if it does not match any of the cases. // statements if it does not match any of the cases.
__ b(&next); __ b(&next);
// Bind the default case label, so we can branch to it when we // Bind the default case label, so we can branch to it when we
// have compared against all other cases. // have compared against all other cases.
ASSERT(default_case.is_unused()); // at most one default clause ASSERT(default_case.is_unused()); // at most one default clause
...@@ -2802,7 +2802,7 @@ void ArmCodeGenerator::VisitSwitchStatement(SwitchStatement* node) { ...@@ -2802,7 +2802,7 @@ void ArmCodeGenerator::VisitSwitchStatement(SwitchStatement* node) {
// Remove the switch value from the stack. // Remove the switch value from the stack.
__ pop(r0); __ pop(r0);
} }
__ bind(&fall_through); __ bind(&fall_through);
__ bind(node->break_target()); __ bind(node->break_target());
} }
......
...@@ -62,6 +62,3 @@ debug-step-stub-callfunction: FAIL ...@@ -62,6 +62,3 @@ debug-step-stub-callfunction: FAIL
debug-stepin-constructor: FAIL debug-stepin-constructor: FAIL
debug-step: FAIL debug-step: FAIL
regress/regress-998565: FAIL regress/regress-998565: FAIL
# Issue 67: ARM fails in: Generate_ArgumentsAdaptorTrampoline - non-function call
call-non-function-call: FAIL
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