Commit 8607093f authored by yangguo@chromium.org's avatar yangguo@chromium.org

MIPS: Check for function in %_CallFunction.

Port r12299 (f6372257)

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10834317
Patch from Akos Palfi <palfia@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12316 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 886c0fa4
......@@ -3460,10 +3460,11 @@ void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) {
}
VisitForAccumulatorValue(args->last()); // Function.
// Check for proxy.
Label proxy, done;
Label runtime, done;
// Check for non-function argument (including proxy).
__ JumpIfSmi(v0, &runtime);
__ GetObjectType(v0, a1, a1);
__ Branch(&proxy, eq, a1, Operand(JS_FUNCTION_PROXY_TYPE));
__ Branch(&runtime, ne, a1, Operand(JS_FUNCTION_TYPE));
// InvokeFunction requires the function in a1. Move it in there.
__ mov(a1, result_register());
......@@ -3473,7 +3474,7 @@ void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) {
__ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
__ jmp(&done);
__ bind(&proxy);
__ bind(&runtime);
__ push(v0);
__ CallRuntime(Runtime::kCall, args->length());
__ bind(&done);
......
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