| OLD | NEW |
| 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 library dart2js.js_emitter.code_emitter_task; | 5 library dart2js.js_emitter.code_emitter_task; |
| 6 | 6 |
| 7 import 'package:js_runtime/shared/embedded_names.dart' show JsBuiltin; | 7 import 'package:js_runtime/shared/embedded_names.dart' show JsBuiltin; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common/tasks.dart' show CompilerTask; | 10 import '../common/tasks.dart' show CompilerTask; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 void createEmitter(Namer namer, ClosedWorld closedWorld) { | 167 void createEmitter(Namer namer, ClosedWorld closedWorld) { |
| 168 measure(() { | 168 measure(() { |
| 169 _emitter = _emitterFactory.createEmitter(this, namer, closedWorld); | 169 _emitter = _emitterFactory.createEmitter(this, namer, closedWorld); |
| 170 metadataCollector = new MetadataCollector(compiler, _emitter); | 170 metadataCollector = new MetadataCollector(compiler, _emitter); |
| 171 typeTestRegistry = new TypeTestRegistry(compiler, closedWorld); | 171 typeTestRegistry = new TypeTestRegistry(compiler, closedWorld); |
| 172 }); | 172 }); |
| 173 } | 173 } |
| 174 | 174 |
| 175 int assembleProgram(Namer namer, ClosedWorld closedWorld) { | 175 int assembleProgram(Namer namer, ClosedWorld closedWorld) { |
| 176 return measure(() { | 176 return measure(() { |
| 177 emitter.invalidateCaches(); | |
| 178 | |
| 179 Set<ClassEntity> rtiNeededClasses = _finalizeRti(); | 177 Set<ClassEntity> rtiNeededClasses = _finalizeRti(); |
| 180 ProgramBuilder programBuilder = new ProgramBuilder( | 178 ProgramBuilder programBuilder = new ProgramBuilder( |
| 181 compiler, namer, this, emitter, closedWorld, rtiNeededClasses); | 179 compiler, namer, this, emitter, closedWorld, rtiNeededClasses); |
| 182 int size = emitter.emitProgram(programBuilder); | 180 int size = emitter.emitProgram(programBuilder); |
| 183 // TODO(floitsch): we shouldn't need the `neededClasses` anymore. | 181 // TODO(floitsch): we shouldn't need the `neededClasses` anymore. |
| 184 neededClasses = programBuilder.collector.neededClasses; | 182 neededClasses = programBuilder.collector.neededClasses; |
| 185 return size; | 183 return size; |
| 186 }); | 184 }); |
| 187 } | 185 } |
| 188 } | 186 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); | 241 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); |
| 244 | 242 |
| 245 /// Returns the JS code for accessing the given [constant]. | 243 /// Returns the JS code for accessing the given [constant]. |
| 246 jsAst.Expression constantReference(ConstantValue constant); | 244 jsAst.Expression constantReference(ConstantValue constant); |
| 247 | 245 |
| 248 /// Returns the JS template for the given [builtin]. | 246 /// Returns the JS template for the given [builtin]. |
| 249 jsAst.Template templateForBuiltin(JsBuiltin builtin); | 247 jsAst.Template templateForBuiltin(JsBuiltin builtin); |
| 250 | 248 |
| 251 /// Returns the size of the code generated for a given output [unit]. | 249 /// Returns the size of the code generated for a given output [unit]. |
| 252 int generatedSize(OutputUnit unit); | 250 int generatedSize(OutputUnit unit); |
| 253 | |
| 254 void invalidateCaches(); | |
| 255 } | 251 } |
| OLD | NEW |