| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 | 7 |
| 8 class OldEmitter implements Emitter { | 8 class OldEmitter implements Emitter { |
| 9 final Compiler compiler; | 9 final Compiler compiler; |
| 10 final CodeEmitterTask task; | 10 final CodeEmitterTask task; |
| (...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1617 Map<OutputUnit, jsAst.Expression> outputs = | 1617 Map<OutputUnit, jsAst.Expression> outputs = |
| 1618 new Map<OutputUnit, jsAst.Expression>(); | 1618 new Map<OutputUnit, jsAst.Expression>(); |
| 1619 | 1619 |
| 1620 for (Fragment fragment in program.deferredFragments) { | 1620 for (Fragment fragment in program.deferredFragments) { |
| 1621 OutputUnit outputUnit = fragment.outputUnit; | 1621 OutputUnit outputUnit = fragment.outputUnit; |
| 1622 | 1622 |
| 1623 Map<Element, ClassBuilder> descriptors = elementDescriptors[fragment]; | 1623 Map<Element, ClassBuilder> descriptors = elementDescriptors[fragment]; |
| 1624 | 1624 |
| 1625 if (descriptors != null && descriptors.isNotEmpty) { | 1625 if (descriptors != null && descriptors.isNotEmpty) { |
| 1626 Iterable<LibraryElement> libraries = | 1626 Iterable<LibraryElement> libraries = |
| 1627 task.outputLibraryLists[outputUnit]; | 1627 task.outputLibraryLists[outputUnit]; |
| 1628 if (libraries == null) libraries = []; | 1628 if (libraries == null) libraries = []; |
| 1629 | 1629 |
| 1630 // TODO(johnniwinther): Avoid creating [CodeBuffer]s. | 1630 // TODO(johnniwinther): Avoid creating [CodeBuffer]s. |
| 1631 List<jsAst.Expression> parts = <jsAst.Expression>[]; | 1631 List<jsAst.Expression> parts = <jsAst.Expression>[]; |
| 1632 for (LibraryElement library in Elements.sortedByPosition(libraries)) { | 1632 for (LibraryElement library in Elements.sortedByPosition(libraries)) { |
| 1633 parts.add(generateLibraryDescriptor(library, fragment)); | 1633 parts.add(generateLibraryDescriptor(library, fragment)); |
| 1634 descriptors.remove(library); | 1634 descriptors.remove(library); |
| 1635 } | 1635 } |
| 1636 | 1636 |
| 1637 outputs[outputUnit] = new jsAst.ArrayInitializer(parts); | 1637 outputs[outputUnit] = new jsAst.ArrayInitializer(parts); |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2003 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 2003 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
| 2004 if (element.isInstanceMember) { | 2004 if (element.isInstanceMember) { |
| 2005 cachedClassBuilders.remove(element.enclosingClass); | 2005 cachedClassBuilders.remove(element.enclosingClass); |
| 2006 | 2006 |
| 2007 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 2007 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
| 2008 | 2008 |
| 2009 } | 2009 } |
| 2010 } | 2010 } |
| 2011 } | 2011 } |
| 2012 } | 2012 } |
| OLD | NEW |