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

Unified Diff: src/builtins-ia32.cc

Issue 2884: Stop adapting the arguments passed to the builtin implementations... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 3 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 | « src/builtins-arm.cc ('k') | src/macro-assembler-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins-ia32.cc
===================================================================
--- src/builtins-ia32.cc (revision 311)
+++ src/builtins-ia32.cc (working copy)
@@ -40,12 +40,21 @@
void Builtins::Generate_Adaptor(MacroAssembler* masm,
int argc,
CFunctionId id) {
- // argc is the number of arguments excluding the receiver.
- // JumpToBuiltin expects eax to contain the number of arguments
- // including the receiver.
- __ mov(eax, argc + 1);
- __ mov(Operand::StaticVariable(ExternalReference::builtin_passed_function()),
- edi);
+ // TODO(1238487): Don't pass the function in a static variable.
+ ExternalReference passed = ExternalReference::builtin_passed_function();
+ __ mov(Operand::StaticVariable(passed), edi);
+
+ if (argc == -1) {
+ // The actual argument count has already been loaded into register
+ // eax, but JumpToBuiltin expects eax to contain the number of
+ // arguments including the receiver.
+ __ inc(eax);
+ } else {
+ // The number passed in argc excludes the receiver, but
+ // JumpToBuiltin expects eax to contain the number of arguments
+ // including the receiver.
+ __ mov(eax, argc + 1);
+ }
__ JumpToBuiltin(ExternalReference(id));
}
« no previous file with comments | « src/builtins-arm.cc ('k') | src/macro-assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698