| 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 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1783 addComment('Native classes', nativeBuffer); | 1783 addComment('Native classes', nativeBuffer); |
| 1784 | 1784 |
| 1785 nativeEmitter.generateNativeClasses(nativeClasses, additionalProperties); | 1785 nativeEmitter.generateNativeClasses(nativeClasses, additionalProperties); |
| 1786 | 1786 |
| 1787 nativeEmitter.finishGenerateNativeClasses(); | 1787 nativeEmitter.finishGenerateNativeClasses(); |
| 1788 nativeEmitter.assembleCode(nativeBuffer); | 1788 nativeEmitter.assembleCode(nativeBuffer); |
| 1789 | 1789 |
| 1790 return nativeBuffer; | 1790 return nativeBuffer; |
| 1791 } | 1791 } |
| 1792 | 1792 |
| 1793 int emitProgram(Program program) { | 1793 int emitProgram(ProgramBuilder programBuilder) { |
| 1794 Program program = programBuilder.buildProgram(); |
| 1795 |
| 1794 // Shorten the code by using [namer.currentIsolate] as temporary. | 1796 // Shorten the code by using [namer.currentIsolate] as temporary. |
| 1795 isolateProperties = namer.currentIsolate; | 1797 isolateProperties = namer.currentIsolate; |
| 1796 | 1798 |
| 1797 // Emit deferred units first, so we have their hashes. | 1799 // Emit deferred units first, so we have their hashes. |
| 1798 // Map from OutputUnit to a hash of its content. The hash uniquely | 1800 // Map from OutputUnit to a hash of its content. The hash uniquely |
| 1799 // identifies the code of the output-unit. It does not include | 1801 // identifies the code of the output-unit. It does not include |
| 1800 // boilerplate JS code, like the sourcemap directives or the hash | 1802 // boilerplate JS code, like the sourcemap directives or the hash |
| 1801 // itself. | 1803 // itself. |
| 1802 Map<OutputUnit, String> deferredLoadHashes = | 1804 Map<OutputUnit, String> deferredLoadHashes = |
| 1803 emitDeferredOutputUnits(program); | 1805 emitDeferredOutputUnits(program); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2095 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 2097 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
| 2096 if (element.isInstanceMember) { | 2098 if (element.isInstanceMember) { |
| 2097 cachedClassBuilders.remove(element.enclosingClass); | 2099 cachedClassBuilders.remove(element.enclosingClass); |
| 2098 | 2100 |
| 2099 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 2101 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
| 2100 | 2102 |
| 2101 } | 2103 } |
| 2102 } | 2104 } |
| 2103 } | 2105 } |
| 2104 } | 2106 } |
| OLD | NEW |