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

Unified Diff: runtime/vm/code_generator.cc

Issue 11336011: Revert "Change signature of noSuchMethod to take an InvocationMirror." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | « runtime/lib/object_patch.dart ('k') | runtime/vm/stack_frame_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index e65a53c5a84cc3a5f6baa68e1268c3251e17667d..90a9813da688c941236aa229793f0a2b46ba1a8a 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -1282,43 +1282,23 @@ DEFINE_RUNTIME_ENTRY(InvokeNoSuchMethodFunction, 4) {
const String& original_function_name = String::Handle(ic_data.target_name());
ASSERT(!Array::CheckedHandle(arguments.At(2)).IsNull());
const Array& orig_arguments = Array::CheckedHandle(arguments.At(3));
- // Allocate an InvocationMirror object.
- // TODO(regis): Fill in the InvocationMirror object correctly at
- // this point we do not deal with named arguments and treat them
- // all as positional.
- const Library& core_lib = Library::Handle(Library::CoreLibrary());
- const String& invocation_mirror_name = String::Handle(
- Symbols::InvocationMirror());
- Class& invocation_mirror_class = Class::Handle(
- core_lib.LookupClassAllowPrivate(invocation_mirror_name));
- ASSERT(!invocation_mirror_class.IsNull());
- const String& allocation_function_name = String::Handle(
- Symbols::AllocateInvocationMirror());
- const Function& allocation_function = Function::ZoneHandle(
- Resolver::ResolveStaticByName(invocation_mirror_class,
- allocation_function_name,
- Resolver::kIsQualified));
- ASSERT(!allocation_function.IsNull());
- GrowableArray<const Object*> allocation_arguments(2);
- allocation_arguments.Add(&original_function_name);
- allocation_arguments.Add(&orig_arguments);
- const Array& kNoArgumentNames = Array::Handle();
- const Object& invocation_mirror = Object::Handle(
- DartEntry::InvokeStatic(allocation_function,
- allocation_arguments,
- kNoArgumentNames));
-
- const int kNumArguments = 2;
+ // TODO(regis): The signature of the "noSuchMethod" method has to change from
+ // noSuchMethod(String name, Array arguments) to something like
+ // noSuchMethod(InvocationMirror call).
+ const int kNumArguments = 3;
const int kNumNamedArguments = 0;
- const String& function_name = String::Handle(Symbols::NoSuchMethod());
+ const Array& kNoArgumentNames = Array::Handle();
+ const String& function_name =
+ String::Handle(Symbols::NoSuchMethod());
const Function& function = Function::ZoneHandle(
Resolver::ResolveDynamic(receiver,
function_name,
kNumArguments,
kNumNamedArguments));
ASSERT(!function.IsNull());
- GrowableArray<const Object*> invoke_arguments(1);
- invoke_arguments.Add(&invocation_mirror);
+ GrowableArray<const Object*> invoke_arguments(2);
+ invoke_arguments.Add(&original_function_name);
+ invoke_arguments.Add(&orig_arguments);
const Object& result = Object::Handle(
DartEntry::InvokeDynamic(receiver,
function,
« no previous file with comments | « runtime/lib/object_patch.dart ('k') | runtime/vm/stack_frame_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698