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

Unified Diff: lib/compiler/implementation/ssa/builder.dart

Issue 9802023: Correctly handle constness for list and map literals inside bodies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add TODOs. Created 8 years, 9 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 | « lib/compiler/implementation/scanner/listener.dart ('k') | lib/compiler/implementation/tree/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/builder.dart
diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart
index 92ba9bc873fc4e6294b25808f9f5eb1a28ae10e9..7232549737f45ce91f4f2c4b49be403f815111c4 100644
--- a/lib/compiler/implementation/ssa/builder.dart
+++ b/lib/compiler/implementation/ssa/builder.dart
@@ -2298,6 +2298,13 @@ class SsaBuilder implements Visitor {
}
visitLiteralList(LiteralList node) {
+ if (node.isConst()) {
+ ConstantHandler handler = compiler.constantHandler;
+ Constant constant = handler.compileNodeWithDefinitions(node, elements);
+ stack.add(graph.addConstant(constant));
+ return;
+ }
+
List<HInstruction> inputs = <HInstruction>[];
for (Link<Node> link = node.elements.nodes;
!link.isEmpty();
@@ -2508,6 +2515,12 @@ class SsaBuilder implements Visitor {
}
visitLiteralMap(LiteralMap node) {
+ if (node.isConst()) {
+ ConstantHandler handler = compiler.constantHandler;
+ Constant constant = handler.compileNodeWithDefinitions(node, elements);
+ stack.add(graph.addConstant(constant));
+ return;
+ }
List<HInstruction> inputs = <HInstruction>[];
for (Link<Node> link = node.entries.nodes;
!link.isEmpty();
« no previous file with comments | « lib/compiler/implementation/scanner/listener.dart ('k') | lib/compiler/implementation/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698