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

Unified Diff: runtime/vm/stub_code_x64.cc

Issue 11523002: Pass the proper invocation mirror argument to noSuchMethod. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 | « runtime/vm/stub_code_ia32.cc ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 15938)
+++ runtime/vm/stub_code_x64.cc (working copy)
@@ -343,8 +343,7 @@
__ pushq(RCX); // Closure object.
__ pushq(R10); // Arguments descriptor.
__ movq(R13, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
- __ SmiUntag(R13);
- __ subq(R13, Immediate(1)); // Arguments array length, minus the receiver.
+ __ SmiUntag(R13); // Arguments array length, including the original receiver.
PushArgumentsArray(assembler, (kWordSize * 6));
// Stack layout explaining "(kWordSize * 6)" offset.
// TOS + 0: Argument array.
@@ -370,7 +369,7 @@
__ Bind(&function_not_found);
// The target function was not found, so invoke method
- // "void noSuchMethod(function_name, args_array)".
+ // "dynamic noSuchMethod(InvocationMirror invocation)".
// RAX: receiver.
// RBX: ic-data.
// R10: arguments descriptor array.
@@ -380,8 +379,7 @@
__ pushq(RBX); // IC-data array.
__ pushq(R10); // Arguments descriptor array.
__ movq(R13, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
- __ SmiUntag(R13);
- __ subq(R13, Immediate(1)); // Arguments array length, minus the receiver.
+ __ SmiUntag(R13); // Arguments array length, including the original receiver.
// See stack layout below explaining "wordSize * 7" offset.
PushArgumentsArray(assembler, (kWordSize * 7));
@@ -776,8 +774,7 @@
__ pushq(R13); // Non-closure object.
// Load num_args.
__ movq(R13, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
- __ SmiUntag(R13);
- __ subq(R13, Immediate(1)); // Arguments array length, minus the closure.
+ __ SmiUntag(R13); // Arguments array length, including the non-closure.
// See stack layout below explaining "wordSize * 5" offset.
PushArgumentsArray(assembler, (kWordSize * 5));
@@ -1429,14 +1426,7 @@
// R10 : arguments descriptor array.
void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) {
// The target function was not found, so invoke method
- // "void noSuchMethod(function_name, Array arguments)".
- // TODO(regis): For now, we simply pass the actual arguments, both positional
- // and named, as the argument array. This is not correct if out-of-order
- // named arguments were passed.
- // The signature of the "noSuchMethod" method has to change from
- // noSuchMethod(String name, Array arguments) to something like
- // noSuchMethod(InvocationMirror call).
- // Also, the class NoSuchMethodError has to be modified accordingly.
+ // "dynamic noSuchMethod(InvocationMirror invocation)".
const Immediate raw_null =
Immediate(reinterpret_cast<intptr_t>(Object::null()));
__ movq(R13, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
@@ -1450,7 +1440,7 @@
__ pushq(RAX); // Receiver.
__ pushq(RBX); // IC data array.
__ pushq(R10); // Arguments descriptor array.
- __ subq(R13, Immediate(1)); // Arguments array length, minus the receiver.
+ // R13: Arguments array length, including the receiver.
// See stack layout below explaining "wordSize * 10" offset.
PushArgumentsArray(assembler, (kWordSize * 10));
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698