Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart

Issue 822593004: dart2js: Let the emitter generate the program. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: No need to pass the task to the new emitter. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698