Chromium Code Reviews| Index: pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart |
| diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart |
| index cf21ad4c14787ec00f6d7a4bc5e77c78d9f75056..b4b402c383cb7b0d59dda5235275b9f447f60d8b 100644 |
| --- a/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart |
| +++ b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart |
| @@ -21,16 +21,28 @@ class IRTracer extends TracerUtil implements cps_ir.Visitor { |
| visit(cps_ir.Node node) => node.accept(this); |
| - void traceGraph(String name, cps_ir.FunctionDefinition graph) { |
| + void traceGraph(String name, cps_ir.ExecutableDefinition graph) { |
| tag("cfg", () { |
| printProperty("name", name); |
| - visitFunctionDefinition(graph); |
| + visit(graph); |
| }); |
| } |
| // Temporary field used during tree walk |
| Names names; |
| + visitFieldDefinition(cps_ir.FieldDefinition f) { |
| + names = new Names(); |
|
Kevin Millikin (Google)
2014/11/26 13:31:30
Isn't this the same as the implementation of visit
sigurdm
2014/11/26 14:38:44
Done.
|
| + BlockCollector builder = new BlockCollector(names); |
| + builder.visit(f); |
| + |
| + printNode(builder.entry); |
| + for (Block block in builder.cont2block.values) { |
| + printNode(block); |
| + } |
| + names = null; |
| + } |
| + |
| visitFunctionDefinition(cps_ir.FunctionDefinition f) { |
| names = new Names(); |
| BlockCollector builder = new BlockCollector(names); |
| @@ -323,6 +335,11 @@ class BlockCollector extends cps_ir.Visitor { |
| return block; |
| } |
| + visitFieldDefinition(cps_ir.FieldDefinition f) { |
|
Kevin Millikin (Google)
2014/11/26 13:31:30
Same here: you could share the code but I don't ca
sigurdm
2014/11/26 14:38:44
Done.
|
| + entry = current_block = new Block(names.name(f), [], f.body); |
| + visit(f.body); |
| + } |
| + |
| visitFunctionDefinition(cps_ir.FunctionDefinition f) { |
| entry = current_block = new Block(names.name(f), [], f.body); |
| visit(f.body); |