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

Unified Diff: runtime/vm/kernel_to_il.cc

Issue 2998803002: [kernel] Support for top-level generic functions. (Closed)
Patch Set: Review comments. 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/kernel_to_il.h ('k') | no next file » | 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 760db914dbc5bafdc25180bbfa5bd02a495d7b4f..71ccb80a866303ade260fe9dede2deb04b8ea63f 100644
--- a/runtime/vm/kernel_to_il.cc
+++ b/runtime/vm/kernel_to_il.cc
@@ -790,9 +790,14 @@ Fragment FlowGraphBuilder::LoadInstantiatorTypeArguments() {
return instructions;
}
+// TODO(30455): Kernel generic methods undone. This seems to work for static
+// top-level functions, but probably needs to be revisited when generic methods
+// are fully supported in kernel.
Fragment FlowGraphBuilder::LoadFunctionTypeArguments() {
- UNIMPLEMENTED(); // TODO(regis)
- return Fragment(NULL);
+ Fragment instructions;
+ ASSERT(parsed_function_->function_type_arguments() != NULL);
+ instructions += LoadLocal(parsed_function_->function_type_arguments());
+ return instructions;
}
Fragment FlowGraphBuilder::InstantiateType(const AbstractType& type) {
@@ -1282,11 +1287,11 @@ static intptr_t GetResultCidOfListFactory(Zone* zone,
Fragment FlowGraphBuilder::StaticCall(TokenPosition position,
const Function& target,
intptr_t argument_count,
- const Array& argument_names) {
+ const Array& argument_names,
+ intptr_t type_args_count) {
ArgumentArray arguments = GetArguments(argument_count);
- const intptr_t kTypeArgsLen = 0; // Generic static calls not yet supported.
StaticCallInstr* call =
- new (Z) StaticCallInstr(position, target, kTypeArgsLen, argument_names,
+ new (Z) StaticCallInstr(position, target, type_args_count, argument_names,
arguments, ic_data_array_, GetNextDeoptId());
const intptr_t list_cid =
GetResultCidOfListFactory(Z, target, argument_count);
« no previous file with comments | « runtime/vm/kernel_to_il.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698