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

Unified Diff: src/codegen-arm.cc

Issue 42598: The code generator doesn't need to put the argument count in eax for... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen-arm.cc
===================================================================
--- src/codegen-arm.cc (revision 1605)
+++ src/codegen-arm.cc (working copy)
@@ -3456,18 +3456,7 @@
Comment cmnt(masm_, "[ CallRuntime");
Runtime::Function* function = node->function();
- if (function != NULL) {
- // Push the arguments ("left-to-right").
- int arg_count = args->length();
- for (int i = 0; i < arg_count; i++) {
- LoadAndSpill(args->at(i));
- }
-
- // Call the C runtime function.
- frame_->CallRuntime(function, arg_count);
- frame_->EmitPush(r0);
-
- } else {
+ if (function == NULL) {
// Prepare stack for calling JS runtime function.
__ mov(r0, Operand(node->name()));
frame_->EmitPush(r0);
@@ -3475,18 +3464,25 @@
__ ldr(r1, GlobalObject());
__ ldr(r0, FieldMemOperand(r1, GlobalObject::kBuiltinsOffset));
frame_->EmitPush(r0);
+ }
- int arg_count = args->length();
- for (int i = 0; i < arg_count; i++) {
- LoadAndSpill(args->at(i));
- }
+ // Push the arguments ("left-to-right").
+ int arg_count = args->length();
+ for (int i = 0; i < arg_count; i++) {
+ LoadAndSpill(args->at(i));
+ }
+ if (function == NULL) {
// Call the JS runtime function.
- Handle<Code> stub = ComputeCallInitialize(args->length());
+ Handle<Code> stub = ComputeCallInitialize(arg_count);
frame_->CallCodeObject(stub, RelocInfo::CODE_TARGET, arg_count + 1);
__ ldr(cp, frame_->Context());
frame_->Drop();
frame_->EmitPush(r0);
+ } else {
+ // Call the C runtime function.
+ frame_->CallRuntime(function, arg_count);
+ frame_->EmitPush(r0);
}
ASSERT(frame_->height() == original_height + 1);
}
« no previous file with comments | « no previous file | src/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698