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

Unified Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2346543002: kernel -> ssa: implement literal lists (Closed)
Patch Set: dartfmt Created 4 years, 3 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 | « pkg/compiler/lib/src/kernel/kernel_visitor.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder_kernel.dart
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index 3eb696af225dc25b6d65c3249b15e748d6f9dd35..b670e6451868f0e1434d7aae31b8f74f9f30e8cb 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -279,6 +279,27 @@ class KernelSsaBuilder extends ir.Visitor with GraphBuilder {
}
@override
+ void visitListLiteral(ir.ListLiteral listLiteral) {
+ HInstruction listInstruction;
+ if (listLiteral.isConst) {
+ listInstruction =
+ graph.addConstant(astAdapter.getConstantFor(listLiteral), compiler);
+ } else {
+ List<HInstruction> elements = <HInstruction>[];
+ for (ir.Expression element in listLiteral.expressions) {
+ element.accept(this);
+ elements.add(pop());
+ }
+ listInstruction = new HLiteralList(elements, backend.extendableArrayType);
+ add(listInstruction);
+ // TODO(het): set runtime type info
+ }
+
+ // TODO(het): Set the instruction type to the list type given by inference
+ stack.add(listInstruction);
+ }
+
+ @override
void visitStaticGet(ir.StaticGet staticGet) {
var staticTarget = staticGet.target;
Element element = astAdapter.getElement(staticTarget).declaration;
« no previous file with comments | « pkg/compiler/lib/src/kernel/kernel_visitor.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698