| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of dart_backend; | 5 part of dart_backend; |
| 6 | 6 |
| 7 // TODO(ahe): This class is simply wrong. This backend should use | 7 // TODO(ahe): This class is simply wrong. This backend should use |
| 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, | 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, |
| 9 // TreeElements>] is what is needed. | 9 // TreeElements>] is what is needed. |
| 10 class ElementAst { | 10 class ElementAst { |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 if (element.isClass() && !element.isMixinApplication) { | 469 if (element.isClass() && !element.isMixinApplication) { |
| 470 final members = <Node>[]; | 470 final members = <Node>[]; |
| 471 for (final member in sortedClassMembers[element]) { | 471 for (final member in sortedClassMembers[element]) { |
| 472 members.add(elementAsts[member].ast); | 472 members.add(elementAsts[member].ast); |
| 473 } | 473 } |
| 474 memberNodes[elementAsts[element].ast] = members; | 474 memberNodes[elementAsts[element].ast] = members; |
| 475 } | 475 } |
| 476 } | 476 } |
| 477 | 477 |
| 478 if (useMirrorHelperLibrary) { | 478 if (useMirrorHelperLibrary) { |
| 479 mirrorRenamer.addRenames(renames, topLevelNodes); | 479 mirrorRenamer.addRenames(renames, topLevelNodes, collector); |
| 480 } | 480 } |
| 481 | 481 |
| 482 final unparser = new EmitterUnparser(renames); | 482 final unparser = new EmitterUnparser(renames); |
| 483 emitCode(unparser, imports, topLevelNodes, memberNodes); | 483 emitCode(unparser, imports, topLevelNodes, memberNodes); |
| 484 compiler.assembledCode = unparser.result; | 484 compiler.assembledCode = unparser.result; |
| 485 | 485 |
| 486 // Output verbose info about size ratio of resulting bundle to all | 486 // Output verbose info about size ratio of resulting bundle to all |
| 487 // referenced non-platform sources. | 487 // referenced non-platform sources. |
| 488 logResultBundleSizeInfo(topLevelElements); | 488 logResultBundleSizeInfo(topLevelElements); |
| 489 } | 489 } |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 } | 613 } |
| 614 | 614 |
| 615 compareElements(e0, e1) { | 615 compareElements(e0, e1) { |
| 616 int result = compareBy((e) => e.getLibrary().canonicalUri.toString())(e0, e1); | 616 int result = compareBy((e) => e.getLibrary().canonicalUri.toString())(e0, e1); |
| 617 if (result != 0) return result; | 617 if (result != 0) return result; |
| 618 return compareBy((e) => e.position().charOffset)(e0, e1); | 618 return compareBy((e) => e.position().charOffset)(e0, e1); |
| 619 } | 619 } |
| 620 | 620 |
| 621 List<Element> sortElements(Iterable<Element> elements) => | 621 List<Element> sortElements(Iterable<Element> elements) => |
| 622 sorted(elements, compareElements); | 622 sorted(elements, compareElements); |
| OLD | NEW |