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

Unified Diff: runtime/vm/dart_entry.cc

Issue 3007603002: [VM generic function reification] Support generic functions in Invocation class. (Closed)
Patch Set: address review comment Created 3 years, 4 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/vm/class_table.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_entry.cc
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc
index fd91fb0b017106352f93bfeae2ebfe54131cb076..e517fa269927a8201fbb9a8e0725a22cbb14111a 100644
--- a/runtime/vm/dart_entry.cc
+++ b/runtime/vm/dart_entry.cc
@@ -213,7 +213,9 @@ RawObject* DartEntry::InvokeNoSuchMethod(const Instance& receiver,
const String& target_name,
const Array& arguments,
const Array& arguments_descriptor) {
- ASSERT(receiver.raw() == arguments.At(0));
+ const ArgumentsDescriptor args_desc(arguments_descriptor);
+ const intptr_t receiver_index = args_desc.TypeArgsLen() == 0 ? 0 : 1;
+ ASSERT(receiver.raw() == arguments.At(receiver_index));
// Allocate an Invocation object.
const Library& core_lib = Library::Handle(Library::CoreLibrary());
@@ -241,10 +243,10 @@ RawObject* DartEntry::InvokeNoSuchMethod(const Instance& receiver,
// Now use the invocation mirror object and invoke NoSuchMethod.
const int kTypeArgsLen = 0;
const int kNumArguments = 2;
- ArgumentsDescriptor args_desc(
+ ArgumentsDescriptor nsm_args_desc(
Array::Handle(ArgumentsDescriptor::New(kTypeArgsLen, kNumArguments)));
- Function& function = Function::Handle(
- Resolver::ResolveDynamic(receiver, Symbols::NoSuchMethod(), args_desc));
+ Function& function = Function::Handle(Resolver::ResolveDynamic(
+ receiver, Symbols::NoSuchMethod(), nsm_args_desc));
if (function.IsNull()) {
ASSERT(!FLAG_lazy_dispatchers);
// If noSuchMethod(invocation) is not found, call Object::noSuchMethod.
@@ -252,7 +254,7 @@ RawObject* DartEntry::InvokeNoSuchMethod(const Instance& receiver,
function ^= Resolver::ResolveDynamicForReceiverClass(
Class::Handle(thread->zone(),
thread->isolate()->object_store()->object_class()),
- Symbols::NoSuchMethod(), args_desc);
+ Symbols::NoSuchMethod(), nsm_args_desc);
}
ASSERT(!function.IsNull());
const Array& args = Array::Handle(Array::New(kNumArguments));
« no previous file with comments | « runtime/vm/class_table.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698