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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_tracer.dart

Issue 658103003: Support map and list literals in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use LiteralMapEntry to ensure build order Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.ir_tracer; 5 library dart2js.ir_tracer;
6 6
7 import 'dart:async' show EventSink; 7 import 'dart:async' show EventSink;
8 8
9 import 'cps_ir_nodes.dart' as cps_ir hide Function; 9 import 'cps_ir_nodes.dart' as cps_ir hide Function;
10 import '../tracer.dart'; 10 import '../tracer.dart';
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 visitLiteralList(cps_ir.LiteralList node) { 150 visitLiteralList(cps_ir.LiteralList node) {
151 String dummy = names.name(node); 151 String dummy = names.name(node);
152 String values = node.values.map(formatReference).join(', '); 152 String values = node.values.map(formatReference).join(', ');
153 printStmt(dummy, "LiteralList ($values)"); 153 printStmt(dummy, "LiteralList ($values)");
154 } 154 }
155 155
156 visitLiteralMap(cps_ir.LiteralMap node) { 156 visitLiteralMap(cps_ir.LiteralMap node) {
157 String dummy = names.name(node); 157 String dummy = names.name(node);
158 List<String> entries = new List<String>(); 158 List<String> entries = new List<String>();
159 for (int i = 0; i < node.values.length; ++i) { 159 for (cps_ir.LiteralMapEntry entry in node.entries) {
160 String key = formatReference(node.keys[i]); 160 String key = formatReference(entry.key);
161 String value = formatReference(node.values[i]); 161 String value = formatReference(entry.value);
162 entries.add("$key: $value"); 162 entries.add("$key: $value");
163 } 163 }
164 printStmt(dummy, "LiteralMap (${entries.join(', ')})"); 164 printStmt(dummy, "LiteralMap (${entries.join(', ')})");
165 } 165 }
166 166
167 visitTypeOperator(cps_ir.TypeOperator node) { 167 visitTypeOperator(cps_ir.TypeOperator node) {
168 String dummy = names.name(node); 168 String dummy = names.name(node);
169 String operator = node.operator; 169 String operator = node.operator;
170 List<String> entries = new List<String>(); 170 List<String> entries = new List<String>();
171 String receiver = formatReference(node.receiver); 171 String receiver = formatReference(node.receiver);
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 } 383 }
384 } 384 }
385 385
386 visitContinuation(cps_ir.Continuation c) { 386 visitContinuation(cps_ir.Continuation c) {
387 var old_node = current_block; 387 var old_node = current_block;
388 current_block = getBlock(c); 388 current_block = getBlock(c);
389 visit(c.body); 389 visit(c.body);
390 current_block = old_node; 390 current_block = old_node;
391 } 391 }
392 } 392 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698