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/codegen-ia32.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/codegen-arm.cc ('k') | src/virtual-frame.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 4436 matching lines...) Expand 10 before | Expand all | Expand 10 after
4447 4447
4448 // Push the arguments ("left-to-right"). 4448 // Push the arguments ("left-to-right").
4449 int arg_count = args->length(); 4449 int arg_count = args->length();
4450 for (int i = 0; i < arg_count; i++) { 4450 for (int i = 0; i < arg_count; i++) {
4451 Load(args->at(i)); 4451 Load(args->at(i));
4452 } 4452 }
4453 4453
4454 if (function == NULL) { 4454 if (function == NULL) {
4455 // Call the JS runtime function. 4455 // Call the JS runtime function.
4456 Handle<Code> stub = ComputeCallInitialize(arg_count); 4456 Handle<Code> stub = ComputeCallInitialize(arg_count);
4457 4457 Result answer =
4458 Result num_args = allocator()->Allocate(eax); 4458 frame_->CallCodeObject(stub, RelocInfo::CODE_TARGET, arg_count + 1);
4459 ASSERT(num_args.is_valid());
4460 __ Set(num_args.reg(), Immediate(args->length()));
4461 Result answer = frame_->CallCodeObject(stub, RelocInfo::CODE_TARGET,
4462 &num_args, arg_count + 1);
4463 frame_->RestoreContextRegister(); 4459 frame_->RestoreContextRegister();
4464 frame_->SetElementAt(0, &answer); 4460 frame_->SetElementAt(0, &answer);
4465 } else { 4461 } else {
4466 // Call the C runtime function. 4462 // Call the C runtime function.
4467 Result answer = frame_->CallRuntime(function, arg_count); 4463 Result answer = frame_->CallRuntime(function, arg_count);
4468 frame_->Push(&answer); 4464 frame_->Push(&answer);
4469 } 4465 }
4470 } 4466 }
4471 4467
4472 4468
(...skipping 2519 matching lines...) Expand 10 before | Expand all | Expand 10 after
6992 6988
6993 // Slow-case: Go through the JavaScript implementation. 6989 // Slow-case: Go through the JavaScript implementation.
6994 __ bind(&slow); 6990 __ bind(&slow);
6995 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); 6991 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
6996 } 6992 }
6997 6993
6998 6994
6999 #undef __ 6995 #undef __
7000 6996
7001 } } // namespace v8::internal 6997 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/codegen-arm.cc ('k') | src/virtual-frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698