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

Unified Diff: runtime/vm/parser.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/object_graph.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 06f8998a2c65ed76c9cafb50f5b05d6228e7fbe0..80f0c7e37e250e9ddeb36e43c7c22ca47788a1c4 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -2418,11 +2418,16 @@ StaticCallNode* Parser::BuildInvocationMirrorAllocation(
// including the function type arguments and the receiver.
ArrayNode* args_array =
new ArrayNode(args_pos, Type::ZoneHandle(Type::ArrayType()));
- // The type_args_var is only used in the generated body of an implicit closure
- // where noSuchMethod should never be called.
- ASSERT(function_args.type_args_var() == NULL);
- if (!function_args.type_arguments().IsNull()) {
- // TODO(regis): Pass the original type arguments to the invocation mirror.
+ // A type_args_var is allocated in the generated body of an implicit
+ // closure and in the generated body of a noSuchMethodDispatcher.
+ // Pass the type arguments to the invocation mirror as the first argument.
+ if (function_args.type_args_var() != NULL) {
+ ASSERT(function_args.type_arguments().IsNull());
+ args_array->AddElement(
+ new LoadLocalNode(args_pos, function_args.type_args_var()));
+ } else if (!function_args.type_arguments().IsNull()) {
+ args_array->AddElement(
+ new LiteralNode(args_pos, function_args.type_arguments()));
}
for (intptr_t i = 0; i < function_args.length(); i++) {
AstNode* arg = function_args.NodeAt(i);
« no previous file with comments | « runtime/vm/object_graph.cc ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698