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..3295f64192c91be844ff5a1591003dfd119d868b 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/dump_info.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/dump_info.dart |
| @@ -239,6 +239,19 @@ 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. |
| + if (member is MemberElement) { |
| + for (Element closure in member.nestedClosures) { |
| + Map<String, dynamic> child = this.process(closure); |
| + if (child != null) { |
| + size += child['size']; |
| + } |
| + } |
| + } |
| } |
| }); |
| @@ -306,8 +319,10 @@ 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) { |
| + |
| + if (element is MemberElement) { |
| + MemberElement member = element as MemberElement; |
|
floitsch
2014/08/11 16:03:17
no need to write "as ...".
|
| + for (Element closure in member.nestedClosures) { |
| Map<String, dynamic> child = this.process(closure); |
| if (child != null) { |
| children.add(child['id']); |