Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 6368092e52d6733046a17d667838e4d09f5a3ac6..cddc8148b9d2535740969beaf5720e467eed7ff2 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -2115,6 +2115,7 @@ void FullCodeGenerator::EmitCallWithStub(Call* expr, CallFunctionFlags flags) { |
// Record source position for debugger. |
SetSourcePosition(expr->position()); |
CallFunctionStub stub(arg_count, flags); |
+ __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
__ CallStub(&stub); |
RecordJSReturnSite(expr); |
// Restore context register. |
@@ -2212,6 +2213,7 @@ void FullCodeGenerator::VisitCall(Call* expr) { |
// Record source position for debugger. |
SetSourcePosition(expr->position()); |
CallFunctionStub stub(arg_count, RECEIVER_MIGHT_BE_IMPLICIT); |
+ __ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
__ CallStub(&stub); |
RecordJSReturnSite(expr); |
// Restore context register. |
@@ -3097,12 +3099,24 @@ void FullCodeGenerator::EmitCallFunction(ZoneList<Expression*>* args) { |
} |
VisitForAccumulatorValue(args->last()); // Function. |
+ // Check for proxy. |
+ Label proxy, done; |
+ __ CompareObjectType(r0, r1, r1, JS_FUNCTION_PROXY_TYPE); |
+ __ b(eq, &proxy); |
+ |
// InvokeFunction requires the function in r1. Move it in there. |
__ mov(r1, result_register()); |
ParameterCount count(arg_count); |
__ InvokeFunction(r1, count, CALL_FUNCTION, |
NullCallWrapper(), CALL_AS_METHOD); |
__ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ __ jmp(&done); |
+ |
+ __ bind(&proxy); |
+ __ push(r0); |
+ __ CallRuntime(Runtime::kCall, args->length()); |
+ __ bind(&done); |
+ |
context()->Plug(r0); |
} |