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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart

Issue 1616143003: Lower map literals to constructor or function calls in builder (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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 unified diff | Download patch
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_nodes_sexpr; 5 library dart2js.ir_nodes_sexpr;
6 6
7 import '../constants/values.dart'; 7 import '../constants/values.dart';
8 import '../util/util.dart'; 8 import '../util/util.dart';
9 import 'cps_ir_nodes.dart'; 9 import 'cps_ir_nodes.dart';
10 import '../universe/call_structure.dart' show 10 import '../universe/call_structure.dart' show
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 String visitTypeTestViaFlag(TypeTestViaFlag node) { 270 String visitTypeTestViaFlag(TypeTestViaFlag node) {
271 String interceptor = access(node.interceptor); 271 String interceptor = access(node.interceptor);
272 return '(TypeTestViaFlag $interceptor ${node.dartType})'; 272 return '(TypeTestViaFlag $interceptor ${node.dartType})';
273 } 273 }
274 274
275 String visitLiteralList(LiteralList node) { 275 String visitLiteralList(LiteralList node) {
276 String values = node.values.map(access).join(' '); 276 String values = node.values.map(access).join(' ');
277 return '(LiteralList ($values))'; 277 return '(LiteralList ($values))';
278 } 278 }
279 279
280 String visitLiteralMap(LiteralMap node) {
281 String keys = node.entries.map((e) => access(e.key)).join(' ');
282 String values = node.entries.map((e) => access(e.value)).join(' ');
283 return '(LiteralMap ($keys) ($values))';
284 }
285
286 String visitSetField(SetField node) { 280 String visitSetField(SetField node) {
287 String object = access(node.object); 281 String object = access(node.object);
288 String field = node.field.name; 282 String field = node.field.name;
289 String value = access(node.value); 283 String value = access(node.value);
290 return '(SetField $object $field $value)'; 284 return '(SetField $object $field $value)';
291 } 285 }
292 286
293 String visitGetField(GetField node) { 287 String visitGetField(GetField node) {
294 String object = access(node.object); 288 String object = access(node.object);
295 String field = node.field.name; 289 String field = node.field.name;
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 void setReturnContinuation(Continuation node) { 512 void setReturnContinuation(Continuation node) {
519 assert(!_names.containsKey(node) || _names[node] == 'return'); 513 assert(!_names.containsKey(node) || _names[node] == 'return');
520 _names[node] = 'return'; 514 _names[node] = 'return';
521 } 515 }
522 516
523 String getName(Node node) { 517 String getName(Node node) {
524 if (!_names.containsKey(node)) return 'MISSING_NAME'; 518 if (!_names.containsKey(node)) return 'MISSING_NAME';
525 return _names[node]; 519 return _names[node];
526 } 520 }
527 } 521 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698