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

Side by Side Diff: lib/compiler/implementation/ssa/tracer.dart

Issue 10446080: Address review comments from https://chromiumcodereview.appspot.com/10454049/. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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('tracer'); 5 #library('tracer');
6 6
7 #import('dart:io'); 7 #import('dart:io');
8 #import('ssa.dart'); 8 #import('ssa.dart');
9 #import('../leg.dart'); 9 #import('../leg.dart');
10 10
11 final bool GENERATE_SSA_TRACE = false; 11 final bool GENERATE_SSA_TRACE = false;
12 12
13 class HTracer extends HGraphVisitor implements Tracer { 13 class HTracer extends HGraphVisitor implements Tracer {
14 int indent = 0; 14 int indent = 0;
15 final RandomAccessFile output; 15 final RandomAccessFile output;
16 final bool enabled = GENERATE_SSA_TRACE; 16 final bool enabled = GENERATE_SSA_TRACE;
17 17
18 HTracer([String path = "dart.cfg"]) 18 HTracer([String path = "dart.cfg"])
19 : output = GENERATE_SSA_TRACE ? new File(path).openSync(FileMode.WRITE) 19 : output = GENERATE_SSA_TRACE ? new File(path).openSync(FileMode.WRITE)
20 : null; 20 : null;
21 21
22 void close() { 22 void close() {
23 if (enabled) output.closeSync(); 23 if (enabled) output.closeSync();
24 } 24 }
25 25
26 String method;
27 void traceCompilation(String methodName) { 26 void traceCompilation(String methodName) {
28 tag("compilation", () { 27 tag("compilation", () {
29 printProperty("name", methodName); 28 printProperty("name", methodName);
30 printProperty("method", methodName); 29 printProperty("method", methodName);
31 printProperty("date", new Date.now().value); 30 printProperty("date", new Date.now().value);
32 }); 31 });
33 } 32 }
34 33
35 void traceGraph(String name, HGraph graph) { 34 void traceGraph(String name, HGraph graph) {
36 if (!enabled) return; 35 if (!enabled) return;
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 String visitIs(HIs node) { 441 String visitIs(HIs node) {
443 String type = node.typeExpression.toString(); 442 String type = node.typeExpression.toString();
444 return "TypeTest: ${temporaryId(node.expression)} is $type"; 443 return "TypeTest: ${temporaryId(node.expression)} is $type";
445 } 444 }
446 445
447 String visitTypeConversion(HTypeConversion node) { 446 String visitTypeConversion(HTypeConversion node) {
448 String type = node.propagatedType.toString(); 447 String type = node.propagatedType.toString();
449 return "TypeConversion: ${temporaryId(node.inputs[0])} to $type"; 448 return "TypeConversion: ${temporaryId(node.inputs[0])} to $type";
450 } 449 }
451 } 450 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/closure.dart ('k') | lib/compiler/implementation/ssa/validate.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698