| 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 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1644 | 1644 |
| 1645 outputs[outputUnit] = new jsAst.ArrayInitializer(parts); | 1645 outputs[outputUnit] = new jsAst.ArrayInitializer(parts); |
| 1646 } | 1646 } |
| 1647 } | 1647 } |
| 1648 | 1648 |
| 1649 return outputs; | 1649 return outputs; |
| 1650 } | 1650 } |
| 1651 | 1651 |
| 1652 void finalizeTokensInAst(jsAst.Program main, | 1652 void finalizeTokensInAst(jsAst.Program main, |
| 1653 Iterable<jsAst.Program> deferredParts) { | 1653 Iterable<jsAst.Program> deferredParts) { |
| 1654 task.metadataCollector.countTokensInAst(main); | 1654 jsAst.TokenCounter counter = new jsAst.TokenCounter(); |
| 1655 deferredParts.forEach(task.metadataCollector.countTokensInAst); | 1655 counter.countTokens(main); |
| 1656 deferredParts.forEach(counter.countTokens); |
| 1656 task.metadataCollector.finalizeTokens(); | 1657 task.metadataCollector.finalizeTokens(); |
| 1658 if (backend.namer is jsAst.TokenFinalizer) { |
| 1659 var finalizer = backend.namer; |
| 1660 finalizer.finalizeTokens(); |
| 1661 } |
| 1657 } | 1662 } |
| 1658 | 1663 |
| 1659 int emitProgram(ProgramBuilder programBuilder) { | 1664 int emitProgram(ProgramBuilder programBuilder) { |
| 1660 Program program = programBuilder.buildProgram( | 1665 Program program = programBuilder.buildProgram( |
| 1661 storeFunctionTypesInMetadata: true); | 1666 storeFunctionTypesInMetadata: true); |
| 1662 | 1667 |
| 1663 assembleProgram(program); | 1668 assembleProgram(program); |
| 1664 | 1669 |
| 1665 // Construct the ASTs for all deferred output units. | 1670 // Construct the ASTs for all deferred output units. |
| 1666 Map<OutputUnit, jsAst.Program> deferredParts = | 1671 Map<OutputUnit, jsAst.Program> deferredParts = |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2006 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 2011 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
| 2007 if (element.isInstanceMember) { | 2012 if (element.isInstanceMember) { |
| 2008 cachedClassBuilders.remove(element.enclosingClass); | 2013 cachedClassBuilders.remove(element.enclosingClass); |
| 2009 | 2014 |
| 2010 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 2015 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
| 2011 | 2016 |
| 2012 } | 2017 } |
| 2013 } | 2018 } |
| 2014 } | 2019 } |
| 2015 } | 2020 } |
| OLD | NEW |