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

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

Issue 1409803003: dart2js cps: More interceptor optimizations and fixes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix indentation Created 5 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
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 printProperty("successors", block.succ.map((n) => n.name)); 74 printProperty("successors", block.succ.map((n) => n.name));
75 printEmptyProperty("xhandlers"); 75 printEmptyProperty("xhandlers");
76 printEmptyProperty("flags"); 76 printEmptyProperty("flags");
77 tag("states", () { 77 tag("states", () {
78 tag("locals", () { 78 tag("locals", () {
79 printProperty("size", 0); 79 printProperty("size", 0);
80 printProperty("method", "None"); 80 printProperty("method", "None");
81 }); 81 });
82 }); 82 });
83 tag("HIR", () { 83 tag("HIR", () {
84 String formatParameter(cps_ir.Parameter param) {
85 return '${names.name(param)} ${param.type}';
86 }
84 if (entryPointParameters != null) { 87 if (entryPointParameters != null) {
85 String formatParameter(cps_ir.Parameter param) {
86 return '${names.name(param)} ${param.type}';
87 }
88 String params = entryPointParameters.map(formatParameter).join(', '); 88 String params = entryPointParameters.map(formatParameter).join(', ');
89 printStmt('x0', 'Entry ($params)'); 89 printStmt('x0', 'Entry ($params)');
90 } 90 }
91 for (cps_ir.Parameter param in block.parameters) { 91 String params = block.parameters.map(formatParameter).join(', ');
92 String name = names.name(param); 92 printStmt('x0', 'Parameters ($params)');
93 printStmt(name, "Parameter $name [useCount=${countUses(param)}]");
94 }
95 visit(block.body); 93 visit(block.body);
96 }); 94 });
97 }); 95 });
98 } 96 }
99 97
100 void printStmt(String resultVar, String contents) { 98 void printStmt(String resultVar, String contents) {
101 int bci = 0; 99 int bci = 0;
102 int uses = 0; 100 int uses = 0;
103 addIndent(); 101 addIndent();
104 add("$bci $uses $resultVar $contents <|@\n"); 102 add("$bci $uses $resultVar $contents <|@\n");
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 318
321 visitCreateInstance(cps_ir.CreateInstance node) { 319 visitCreateInstance(cps_ir.CreateInstance node) {
322 String className = node.classElement.name; 320 String className = node.classElement.name;
323 String arguments = node.arguments.map(formatReference).join(', '); 321 String arguments = node.arguments.map(formatReference).join(', ');
324 String typeInformation = 322 String typeInformation =
325 node.typeInformation.map(formatReference).join(', '); 323 node.typeInformation.map(formatReference).join(', ');
326 return 'CreateInstance $className ($arguments) <$typeInformation>'; 324 return 'CreateInstance $className ($arguments) <$typeInformation>';
327 } 325 }
328 326
329 visitInterceptor(cps_ir.Interceptor node) { 327 visitInterceptor(cps_ir.Interceptor node) {
330 return "Interceptor(${formatReference(node.input)})"; 328 return 'Interceptor(${formatReference(node.input)}, '
329 '${node.interceptedClasses})';
331 } 330 }
332 331
333 visitCreateFunction(cps_ir.CreateFunction node) { 332 visitCreateFunction(cps_ir.CreateFunction node) {
334 return "CreateFunction ${node.definition.element.name}"; 333 return "CreateFunction ${node.definition.element.name}";
335 } 334 }
336 335
337 visitGetMutable(cps_ir.GetMutable node) { 336 visitGetMutable(cps_ir.GetMutable node) {
338 String variable = names.name(node.variable.definition); 337 String variable = names.name(node.variable.definition);
339 return 'GetMutable $variable'; 338 return 'GetMutable $variable';
340 } 339 }
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 @override 700 @override
702 visitYield(cps_ir.Yield node) { 701 visitYield(cps_ir.Yield node) {
703 addEdgeToContinuation(node.continuation); 702 addEdgeToContinuation(node.continuation);
704 } 703 }
705 704
706 @override 705 @override
707 visitRefinement(cps_ir.Refinement node) { 706 visitRefinement(cps_ir.Refinement node) {
708 unexpectedNode(node); 707 unexpectedNode(node);
709 } 708 }
710 } 709 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/share_interceptors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698