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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_tracer.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_tracer; 5 library dart2js.ir_tracer;
6 6
7 import 'dart:async' show EventSink; 7 import 'dart:async' show EventSink;
8 import 'cps_ir_nodes.dart' as cps_ir; 8 import 'cps_ir_nodes.dart' as cps_ir;
9 import '../tracer.dart'; 9 import '../tracer.dart';
10 10
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 visitUnreachable(cps_ir.Unreachable node) { 185 visitUnreachable(cps_ir.Unreachable node) {
186 String dummy = names.name(node); 186 String dummy = names.name(node);
187 printStmt(dummy, 'Unreachable'); 187 printStmt(dummy, 'Unreachable');
188 } 188 }
189 189
190 visitLiteralList(cps_ir.LiteralList node) { 190 visitLiteralList(cps_ir.LiteralList node) {
191 String values = node.values.map(formatReference).join(', '); 191 String values = node.values.map(formatReference).join(', ');
192 return "LiteralList ($values)"; 192 return "LiteralList ($values)";
193 } 193 }
194 194
195 visitLiteralMap(cps_ir.LiteralMap node) {
196 List<String> entries = new List<String>();
197 for (cps_ir.LiteralMapEntry entry in node.entries) {
198 String key = formatReference(entry.key);
199 String value = formatReference(entry.value);
200 entries.add("$key: $value");
201 }
202 return "LiteralMap (${entries.join(', ')})";
203 }
204
205 visitTypeCast(cps_ir.TypeCast node) { 195 visitTypeCast(cps_ir.TypeCast node) {
206 String value = formatReference(node.value); 196 String value = formatReference(node.value);
207 String args = node.typeArguments.map(formatReference).join(', '); 197 String args = node.typeArguments.map(formatReference).join(', ');
208 return "TypeCast ($value ${node.dartType} ($args))"; 198 return "TypeCast ($value ${node.dartType} ($args))";
209 } 199 }
210 200
211 visitInvokeContinuation(cps_ir.InvokeContinuation node) { 201 visitInvokeContinuation(cps_ir.InvokeContinuation node) {
212 String dummy = names.name(node); 202 String dummy = names.name(node);
213 String kont = formatReference(node.continuation); 203 String kont = formatReference(node.continuation);
214 String args = node.arguments.map(formatReference).join(', '); 204 String args = node.arguments.map(formatReference).join(', ');
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 // Primitives and conditions are not visited when searching for blocks. 561 // Primitives and conditions are not visited when searching for blocks.
572 unexpectedNode(cps_ir.Node node) { 562 unexpectedNode(cps_ir.Node node) {
573 throw "The IR tracer's block collector reached an unexpected IR " 563 throw "The IR tracer's block collector reached an unexpected IR "
574 "instruction: $node"; 564 "instruction: $node";
575 } 565 }
576 566
577 visitLiteralList(cps_ir.LiteralList node) { 567 visitLiteralList(cps_ir.LiteralList node) {
578 unexpectedNode(node); 568 unexpectedNode(node);
579 } 569 }
580 570
581 visitLiteralMap(cps_ir.LiteralMap node) {
582 unexpectedNode(node);
583 }
584
585 visitConstant(cps_ir.Constant node) { 571 visitConstant(cps_ir.Constant node) {
586 unexpectedNode(node); 572 unexpectedNode(node);
587 } 573 }
588 574
589 visitGetMutable(cps_ir.GetMutable node) { 575 visitGetMutable(cps_ir.GetMutable node) {
590 unexpectedNode(node); 576 unexpectedNode(node);
591 } 577 }
592 578
593 visitParameter(cps_ir.Parameter node) { 579 visitParameter(cps_ir.Parameter node) {
594 unexpectedNode(node); 580 unexpectedNode(node);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 } 677 }
692 678
693 visitBoundsCheck(cps_ir.BoundsCheck node) { 679 visitBoundsCheck(cps_ir.BoundsCheck node) {
694 unexpectedNode(node); 680 unexpectedNode(node);
695 } 681 }
696 682
697 visitNullCheck(cps_ir.NullCheck node) { 683 visitNullCheck(cps_ir.NullCheck node) {
698 unexpectedNode(node); 684 unexpectedNode(node);
699 } 685 }
700 } 686 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698