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

Unified Diff: runtime/vm/kernel_to_il.cc

Issue 2623143003: VM: [Kernel] Make type literals which refer to type parameters work (Closed)
Patch Set: Created 3 years, 11 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') | tests/co19/co19-kernel.status » ('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 dae30a4a5ac324e08803d83b84ba10b22d76e41f..185b25705fb69588616fb602c0122478a6d8f8ff 100644
--- a/runtime/vm/kernel_to_il.cc
+++ b/runtime/vm/kernel_to_il.cc
@@ -2046,6 +2046,14 @@ Fragment FlowGraphBuilder::LoadInstantiatorTypeArguments() {
}
+Fragment FlowGraphBuilder::InstantiateType(const AbstractType& type) {
+ InstantiateTypeInstr* instr = new (Z) InstantiateTypeInstr(
+ TokenPosition::kNoSource, type, *active_class_.klass, Pop());
+ Push(instr);
+ return Fragment(instr);
+}
+
+
Fragment FlowGraphBuilder::InstantiateTypeArguments(
const TypeArguments& type_arguments) {
InstantiateTypeArgumentsInstr* instr = new (Z) InstantiateTypeArgumentsInstr(
@@ -4204,7 +4212,14 @@ void FlowGraphBuilder::VisitTypeLiteral(TypeLiteral* node) {
const AbstractType& type = T.TranslateType(node->type());
if (type.IsMalformed()) H.ReportError("Malformed type literal");
- fragment_ = Constant(type);
+ Fragment instructions;
+ if (type.IsInstantiated()) {
+ instructions += Constant(type);
+ } else {
+ instructions += LoadInstantiatorTypeArguments();
+ instructions += InstantiateType(type);
+ }
+ fragment_ = instructions;
}
« no previous file with comments | « runtime/vm/kernel_to_il.h ('k') | tests/co19/co19-kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698