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

Unified Diff: runtime/vm/kernel_to_il.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/isolate_reload.cc ('k') | runtime/vm/native_entry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_to_il.cc
diff --git a/runtime/vm/kernel_to_il.cc b/runtime/vm/kernel_to_il.cc
index a0272e9293d83aa120e665481a1c9bf9f1d80402..a182adac19ad7d09be57d6bb03dafc3bc026f2c8 100644
--- a/runtime/vm/kernel_to_il.cc
+++ b/runtime/vm/kernel_to_il.cc
@@ -2026,8 +2026,6 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfNoSuchMethodDispatcher(
Fragment body(normal_entry);
body += CheckStackOverflowInPrologue();
- // TODO(regis): Check if a type argument vector is passed.
-
// The receiver is the first argument to noSuchMethod, and it is the first
// argument passed to the dispatcher function.
LocalScope* scope = parsed_function_->node_sequence()->scope();
@@ -2045,13 +2043,23 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfNoSuchMethodDispatcher(
// Third, an array containing the original arguments. Create it and fill
// it in.
+ const intptr_t receiver_index = descriptor.TypeArgsLen() > 0 ? 1 : 0;
body += Constant(TypeArguments::ZoneHandle(Z, TypeArguments::null()));
- body += IntConstant(descriptor.Count());
+ body += IntConstant(receiver_index + descriptor.Count());
body += CreateArray();
LocalVariable* array = MakeTemporary();
+ if (receiver_index > 0) {
+ LocalVariable* type_args = parsed_function_->function_type_arguments();
+ ASSERT(type_args != NULL);
+ body += LoadLocal(array);
+ body += IntConstant(0);
+ body += LoadLocal(type_args);
+ body += StoreIndexed(kArrayCid);
+ body += Drop();
+ }
for (intptr_t i = 0; i < descriptor.PositionalCount(); ++i) {
body += LoadLocal(array);
- body += IntConstant(i);
+ body += IntConstant(receiver_index + i);
body += LoadLocal(scope->VariableAt(i));
body += StoreIndexed(kArrayCid);
body += Drop();
@@ -2062,7 +2070,7 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfNoSuchMethodDispatcher(
name = descriptor.NameAt(i);
name = Symbols::New(H.thread(), name);
body += LoadLocal(array);
- body += IntConstant(descriptor.PositionAt(i));
+ body += IntConstant(receiver_index + descriptor.PositionAt(i));
body += LoadLocal(scope->VariableAt(parameter_index));
body += StoreIndexed(kArrayCid);
body += Drop();
« no previous file with comments | « runtime/vm/isolate_reload.cc ('k') | runtime/vm/native_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698