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

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

Issue 1221333015: dart2js: Move field-visiting code to the program-builder. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove bad show line. Created 5 years, 5 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/full_emitter/class_emitter.dart » ('j') | 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) 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 dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 const USE_LAZY_EMITTER = const bool.fromEnvironment("dart2js.use.lazy.emitter"); 7 const USE_LAZY_EMITTER = const bool.fromEnvironment("dart2js.use.lazy.emitter");
8 8
9 /** 9 /**
10 * Generates the code for all used classes in the program. Static fields (even 10 * Generates the code for all used classes in the program. Static fields (even
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // Compute the classes needed by RTI. 126 // Compute the classes needed by RTI.
127 return typeTestRegistry.computeRtiNeededClasses(); 127 return typeTestRegistry.computeRtiNeededClasses();
128 } 128 }
129 129
130 int assembleProgram() { 130 int assembleProgram() {
131 return measure(() { 131 return measure(() {
132 emitter.invalidateCaches(); 132 emitter.invalidateCaches();
133 133
134 Set<ClassElement> rtiNeededClasses = _finalizeRti(); 134 Set<ClassElement> rtiNeededClasses = _finalizeRti();
135 ProgramBuilder programBuilder = new ProgramBuilder( 135 ProgramBuilder programBuilder = new ProgramBuilder(
136 compiler, namer, this, emitter, oldEmitter, rtiNeededClasses); 136 compiler, namer, this, emitter, rtiNeededClasses);
137 int size = emitter.emitProgram(programBuilder); 137 int size = emitter.emitProgram(programBuilder);
138 // TODO(floitsch): we shouldn't need the `neededClasses` anymore. 138 // TODO(floitsch): we shouldn't need the `neededClasses` anymore.
139 neededClasses = programBuilder.collector.neededClasses; 139 neededClasses = programBuilder.collector.neededClasses;
140 return size; 140 return size;
141 }); 141 });
142 } 142 }
143 } 143 }
144 144
145 abstract class Emitter { 145 abstract class Emitter {
146 /// Uses the [programBuilder] to generate a model of the program, emits 146 /// Uses the [programBuilder] to generate a model of the program, emits
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); 185 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant);
186 186
187 /// Returns the JS code for accessing the given [constant]. 187 /// Returns the JS code for accessing the given [constant].
188 jsAst.Expression constantReference(ConstantValue constant); 188 jsAst.Expression constantReference(ConstantValue constant);
189 189
190 /// Returns the JS template for the given [builtin]. 190 /// Returns the JS template for the given [builtin].
191 jsAst.Template templateForBuiltin(JsBuiltin builtin); 191 jsAst.Template templateForBuiltin(JsBuiltin builtin);
192 192
193 void invalidateCaches(); 193 void invalidateCaches();
194 } 194 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/full_emitter/class_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698