Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 10854115: Check for function in %_CallFunction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3399 matching lines...) Expand 10 before | Expand all | Expand 10 after
3410 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { 3410 void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) {
3411 ZoneList<Expression*>* args = expr->arguments(); 3411 ZoneList<Expression*>* args = expr->arguments();
3412 ASSERT(args->length() >= 2); 3412 ASSERT(args->length() >= 2);
3413 3413
3414 int arg_count = args->length() - 2; // 2 ~ receiver and function. 3414 int arg_count = args->length() - 2; // 2 ~ receiver and function.
3415 for (int i = 0; i < arg_count + 1; i++) { 3415 for (int i = 0; i < arg_count + 1; i++) {
3416 VisitForStackValue(args->at(i)); 3416 VisitForStackValue(args->at(i));
3417 } 3417 }
3418 VisitForAccumulatorValue(args->last()); // Function. 3418 VisitForAccumulatorValue(args->last()); // Function.
3419 3419
3420 // Check for proxy. 3420 Label runtime, done;
3421 Label proxy, done; 3421 // Check for non-function argument (including proxy).
3422 __ CompareObjectType(r0, r1, r1, JS_FUNCTION_PROXY_TYPE); 3422 __ JumpIfSmi(r0, &runtime);
3423 __ b(eq, &proxy); 3423 __ CompareObjectType(r0, r1, r1, JS_FUNCTION_TYPE);
3424 __ b(ne, &runtime);
3424 3425
3425 // InvokeFunction requires the function in r1. Move it in there. 3426 // InvokeFunction requires the function in r1. Move it in there.
3426 __ mov(r1, result_register()); 3427 __ mov(r1, result_register());
3427 ParameterCount count(arg_count); 3428 ParameterCount count(arg_count);
3428 __ InvokeFunction(r1, count, CALL_FUNCTION, 3429 __ InvokeFunction(r1, count, CALL_FUNCTION,
3429 NullCallWrapper(), CALL_AS_METHOD); 3430 NullCallWrapper(), CALL_AS_METHOD);
3430 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 3431 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
3431 __ jmp(&done); 3432 __ jmp(&done);
3432 3433
3433 __ bind(&proxy); 3434 __ bind(&runtime);
3434 __ push(r0); 3435 __ push(r0);
3435 __ CallRuntime(Runtime::kCall, args->length()); 3436 __ CallRuntime(Runtime::kCall, args->length());
3436 __ bind(&done); 3437 __ bind(&done);
3437 3438
3438 context()->Plug(r0); 3439 context()->Plug(r0);
3439 } 3440 }
3440 3441
3441 3442
3442 void FullCodeGenerator::EmitRegExpConstructResult(CallRuntime* expr) { 3443 void FullCodeGenerator::EmitRegExpConstructResult(CallRuntime* expr) {
3443 RegExpConstructResultStub stub; 3444 RegExpConstructResultStub stub;
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after
4564 *context_length = 0; 4565 *context_length = 0;
4565 return previous_; 4566 return previous_;
4566 } 4567 }
4567 4568
4568 4569
4569 #undef __ 4570 #undef __
4570 4571
4571 } } // namespace v8::internal 4572 } } // namespace v8::internal
4572 4573
4573 #endif // V8_TARGET_ARCH_ARM 4574 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698