| 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 const USE_STARTUP_EMITTER = | 8 const USE_STARTUP_EMITTER = |
| 9 const bool.fromEnvironment("dart2js.use.startup.emitter"); | 9 const bool.fromEnvironment("dart2js.use.startup.emitter"); |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 Set<ClassElement> neededClasses; | 36 Set<ClassElement> neededClasses; |
| 37 | 37 |
| 38 CodeEmitterTask(Compiler compiler, Namer namer, bool generateSourceMap) | 38 CodeEmitterTask(Compiler compiler, Namer namer, bool generateSourceMap) |
| 39 : super(compiler), | 39 : super(compiler), |
| 40 this.namer = namer, | 40 this.namer = namer, |
| 41 this.typeTestRegistry = new TypeTestRegistry(compiler) { | 41 this.typeTestRegistry = new TypeTestRegistry(compiler) { |
| 42 nativeEmitter = new NativeEmitter(this); | 42 nativeEmitter = new NativeEmitter(this); |
| 43 if (USE_LAZY_EMITTER) { | 43 if (USE_LAZY_EMITTER) { |
| 44 emitter = new lazy_js_emitter.Emitter(compiler, namer, nativeEmitter); | 44 emitter = new lazy_js_emitter.Emitter(compiler, namer, nativeEmitter); |
| 45 } else if (USE_STARTUP_EMITTER) { | 45 } else if (USE_STARTUP_EMITTER) { |
| 46 emitter = new startup_js_emitter.Emitter(compiler, namer, nativeEmitter); | 46 emitter = new startup_js_emitter.Emitter( |
| 47 compiler, namer, nativeEmitter, generateSourceMap); |
| 47 } else { | 48 } else { |
| 48 emitter = | 49 emitter = |
| 49 new full_js_emitter.Emitter(compiler, namer, generateSourceMap, this); | 50 new full_js_emitter.Emitter(compiler, namer, generateSourceMap, this); |
| 50 } | 51 } |
| 51 metadataCollector = new MetadataCollector(compiler, emitter); | 52 metadataCollector = new MetadataCollector(compiler, emitter); |
| 52 } | 53 } |
| 53 | 54 |
| 54 String get name => 'Code emitter'; | 55 String get name => 'Code emitter'; |
| 55 | 56 |
| 56 /// Returns the string that is used to find library patches that are | 57 /// Returns the string that is used to find library patches that are |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); | 202 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); |
| 202 | 203 |
| 203 /// Returns the JS code for accessing the given [constant]. | 204 /// Returns the JS code for accessing the given [constant]. |
| 204 jsAst.Expression constantReference(ConstantValue constant); | 205 jsAst.Expression constantReference(ConstantValue constant); |
| 205 | 206 |
| 206 /// Returns the JS template for the given [builtin]. | 207 /// Returns the JS template for the given [builtin]. |
| 207 jsAst.Template templateForBuiltin(JsBuiltin builtin); | 208 jsAst.Template templateForBuiltin(JsBuiltin builtin); |
| 208 | 209 |
| 209 void invalidateCaches(); | 210 void invalidateCaches(); |
| 210 } | 211 } |
| OLD | NEW |