| 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 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 22 matching lines...) Expand all Loading... |
| 33 /// Contains a list of all classes that are emitted. | 33 /// Contains a list of all classes that are emitted. |
| 34 Set<ClassElement> neededClasses; | 34 Set<ClassElement> neededClasses; |
| 35 | 35 |
| 36 CodeEmitterTask(Compiler compiler, Namer namer, bool generateSourceMap) | 36 CodeEmitterTask(Compiler compiler, Namer namer, bool generateSourceMap) |
| 37 : super(compiler), | 37 : super(compiler), |
| 38 this.namer = namer, | 38 this.namer = namer, |
| 39 this.typeTestRegistry = new TypeTestRegistry(compiler) { | 39 this.typeTestRegistry = new TypeTestRegistry(compiler) { |
| 40 nativeEmitter = new NativeEmitter(this); | 40 nativeEmitter = new NativeEmitter(this); |
| 41 emitter = USE_LAZY_EMITTER | 41 emitter = USE_LAZY_EMITTER |
| 42 ? new lazy_js_emitter.Emitter(compiler, namer, nativeEmitter) | 42 ? new lazy_js_emitter.Emitter(compiler, namer, nativeEmitter) |
| 43 : new OldEmitter(compiler, namer, generateSourceMap, this); | 43 : new full_js_emitter.Emitter(compiler, namer, generateSourceMap, this); |
| 44 metadataCollector = new MetadataCollector(compiler, emitter); | 44 metadataCollector = new MetadataCollector(compiler, emitter); |
| 45 } | 45 } |
| 46 | 46 |
| 47 String get name => 'Code emitter'; | 47 String get name => 'Code emitter'; |
| 48 | 48 |
| 49 /// Returns the closure expression of a static function. | 49 /// Returns the closure expression of a static function. |
| 50 jsAst.Expression isolateStaticClosureAccess(FunctionElement element) { | 50 jsAst.Expression isolateStaticClosureAccess(FunctionElement element) { |
| 51 return emitter.isolateStaticClosureAccess(element); | 51 return emitter.isolateStaticClosureAccess(element); |
| 52 } | 52 } |
| 53 | 53 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); | 183 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); |
| 184 | 184 |
| 185 /// Returns the JS code for accessing the given [constant]. | 185 /// Returns the JS code for accessing the given [constant]. |
| 186 jsAst.Expression constantReference(ConstantValue constant); | 186 jsAst.Expression constantReference(ConstantValue constant); |
| 187 | 187 |
| 188 /// Returns the JS template for the given [builtin]. | 188 /// Returns the JS template for the given [builtin]. |
| 189 jsAst.Template templateForBuiltin(JsBuiltin builtin); | 189 jsAst.Template templateForBuiltin(JsBuiltin builtin); |
| 190 | 190 |
| 191 void invalidateCaches(); | 191 void invalidateCaches(); |
| 192 } | 192 } |
| OLD | NEW |