OLD | NEW |
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 tracer; | 5 library tracer; |
6 | 6 |
7 import '../compiler.dart' as api; | 7 import '../compiler.dart' as api; |
8 import 'dart:async' show EventSink; | 8 import 'dart:async' show EventSink; |
9 import 'ssa/ssa.dart' as ssa; | 9 import 'ssa/ssa.dart' as ssa; |
10 import 'ssa/ssa_tracer.dart' show HTracer; | 10 import 'ssa/ssa_tracer.dart' show HTracer; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 printProperty("method", methodName); | 50 printProperty("method", methodName); |
51 printProperty("date", new DateTime.now().millisecondsSinceEpoch); | 51 printProperty("date", new DateTime.now().millisecondsSinceEpoch); |
52 }); | 52 }); |
53 } | 53 } |
54 | 54 |
55 void traceGraph(String name, var irObject) { | 55 void traceGraph(String name, var irObject) { |
56 if (!traceActive) return; | 56 if (!traceActive) return; |
57 if (irObject is ssa.HGraph) { | 57 if (irObject is ssa.HGraph) { |
58 new HTracer(output, compiler, context).traceGraph(name, irObject); | 58 new HTracer(output, compiler, context).traceGraph(name, irObject); |
59 } | 59 } |
60 else if (irObject is cps_ir.RootNode) { | 60 else if (irObject is cps_ir.FunctionDefinition) { |
61 new IRTracer(output).traceGraph(name, irObject); | 61 new IRTracer(output).traceGraph(name, irObject); |
62 } | 62 } |
63 else if (irObject is tree_ir.RootNode) { | 63 else if (irObject is tree_ir.FunctionDefinition) { |
64 new TreeTracer(output).traceGraph(name, irObject); | 64 new TreeTracer(output).traceGraph(name, irObject); |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 void close() { | 68 void close() { |
69 if (output != null) { | 69 if (output != null) { |
70 output.close(); | 70 output.close(); |
71 } | 71 } |
72 } | 72 } |
73 } | 73 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 110 } |
111 | 111 |
112 void add(String string) { | 112 void add(String string) { |
113 output.add(string); | 113 output.add(string); |
114 } | 114 } |
115 | 115 |
116 void addIndent() { | 116 void addIndent() { |
117 add(_ind.indentation); | 117 add(_ind.indentation); |
118 } | 118 } |
119 } | 119 } |
OLD | NEW |