| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 dump_info; | 5 library dump_info; |
| 6 | 6 |
| 7 import 'elements/elements.dart'; | 7 import 'elements/elements.dart'; |
| 8 import 'elements/visitor.dart'; | 8 import 'elements/visitor.dart'; |
| 9 import 'dart:convert' show HtmlEscape; | 9 import 'dart:convert' show HtmlEscape; |
| 10 import 'dart2jslib.dart' show | 10 import 'dart2jslib.dart' show |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 final Compiler compiler; | 228 final Compiler compiler; |
| 229 | 229 |
| 230 /// Contains the elements visited on the path from the library to here. | 230 /// Contains the elements visited on the path from the library to here. |
| 231 List<Element> stack = new List<Element>(); | 231 List<Element> stack = new List<Element>(); |
| 232 | 232 |
| 233 Element get currentElement => stack.last; | 233 Element get currentElement => stack.last; |
| 234 | 234 |
| 235 InfoDumpVisitor(Compiler this.compiler); | 235 InfoDumpVisitor(Compiler this.compiler); |
| 236 | 236 |
| 237 InfoNode visitElement(Element element) { | 237 InfoNode visitElement(Element element) { |
| 238 compiler.internalError("This element of kind ${element.kind} " | 238 compiler.internalError(element, |
| 239 "does not support --dump-info", | 239 "This element of kind ${element.kind} " |
| 240 token: element.position()); | 240 "does not support --dump-info"); |
| 241 return null; | 241 return null; |
| 242 } | 242 } |
| 243 | 243 |
| 244 InfoNode visitLibraryElement(LibraryElement element) { | 244 InfoNode visitLibraryElement(LibraryElement element) { |
| 245 List<InfoNode> contents = new List<InfoNode>(); | 245 List<InfoNode> contents = new List<InfoNode>(); |
| 246 int size = compiler.dumpInfoTask.codeSizeCounter | 246 int size = compiler.dumpInfoTask.codeSizeCounter |
| 247 .getGeneratedSizeOf(element); | 247 .getGeneratedSizeOf(element); |
| 248 if (size == 0) return null; | 248 if (size == 0) return null; |
| 249 stack.add(element); | 249 stack.add(element); |
| 250 // For some reason the patch library contains the origin libraries members, | 250 // For some reason the patch library contains the origin libraries members, |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 } | 589 } |
| 590 document.querySelector('.sort_by_size').addEventListener('click', | 590 document.querySelector('.sort_by_size').addEventListener('click', |
| 591 function() { | 591 function() { |
| 592 sortBySize(); | 592 sortBySize(); |
| 593 }, false); | 593 }, false); |
| 594 </script> | 594 </script> |
| 595 </body> | 595 </body> |
| 596 </html>"""); | 596 </html>"""); |
| 597 } | 597 } |
| 598 } | 598 } |
| OLD | NEW |