Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/dump_info.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/dump_info.dart b/sdk/lib/_internal/compiler/implementation/dump_info.dart |
| index 027dbbb9abe76e669a25708a3cd4bede19c58c3c..0c78050f9571a6178d03d3cbf60633c433bfa2c1 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/dump_info.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/dump_info.dart |
| @@ -239,6 +239,17 @@ class ElementToJsonVisitor extends ElementVisitor<Map<String, dynamic>> { |
| Map<String, dynamic> childJson = this.process(member); |
| if (childJson != null) { |
| children.add(childJson['id']); |
| + |
| + // Closures are placed in the library namespace, but |
| + // we want to attribute them to a function, and by |
| + // extension, this class. Process and add the sizes |
| + // here. |
| + for (Element closure in member.nestedClosures) { |
| + Map<String, dynamic> child = this.process(closure); |
|
sra1
2014/08/04 23:25:59
Does this cause the closure to be processed twice?
Ty Overby (Google)
2014/08/04 23:32:01
The `process` function is memoized. It actually e
|
| + if (child != null) { |
| + size += child['size']; |
| + } |
| + } |
| } |
| }); |
| @@ -306,13 +317,12 @@ class ElementToJsonVisitor extends ElementVisitor<Map<String, dynamic>> { |
| sideEffects = compiler.world.getSideEffectsOfElement(element).toString(); |
| code = emittedCode.toString(); |
| } |
| - if (element is MethodElement) { |
| - for (Element closure in element.nestedClosures) { |
| - Map<String, dynamic> child = this.process(closure); |
| - if (child != null) { |
| - children.add(child['id']); |
| - size += child['size']; |
| - } |
| + |
| + for (Element closure in element.nestedClosures) { |
| + Map<String, dynamic> child = this.process(closure); |
| + if (child != null) { |
| + children.add(child['id']); |
| + size += child['size']; |
| } |
| } |