| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 return size; | 145 return size; |
| 146 }); | 146 }); |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 abstract class Emitter { | 150 abstract class Emitter { |
| 151 /// Uses the [programBuilder] to generate a model of the program, emits | 151 /// Uses the [programBuilder] to generate a model of the program, emits |
| 152 /// the program, and returns the size of the generated output. | 152 /// the program, and returns the size of the generated output. |
| 153 int emitProgram(ProgramBuilder programBuilder); | 153 int emitProgram(ProgramBuilder programBuilder); |
| 154 | 154 |
| 155 /// Returns true, if the emitter supports reflection. |
| 156 bool get supportsReflection; |
| 157 |
| 155 /// Returns the JS function that must be invoked to get the value of the | 158 /// Returns the JS function that must be invoked to get the value of the |
| 156 /// lazily initialized static. | 159 /// lazily initialized static. |
| 157 jsAst.Expression isolateLazyInitializerAccess(FieldElement element); | 160 jsAst.Expression isolateLazyInitializerAccess(FieldElement element); |
| 158 | 161 |
| 159 /// Returns the closure expression of a static function. | 162 /// Returns the closure expression of a static function. |
| 160 jsAst.Expression isolateStaticClosureAccess(FunctionElement element); | 163 jsAst.Expression isolateStaticClosureAccess(FunctionElement element); |
| 161 | 164 |
| 162 /// Returns the JS code for accessing the embedded [global]. | 165 /// Returns the JS code for accessing the embedded [global]. |
| 163 jsAst.Expression generateEmbeddedGlobalAccess(String global); | 166 jsAst.Expression generateEmbeddedGlobalAccess(String global); |
| 164 | 167 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 190 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); | 193 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); |
| 191 | 194 |
| 192 /// Returns the JS code for accessing the given [constant]. | 195 /// Returns the JS code for accessing the given [constant]. |
| 193 jsAst.Expression constantReference(ConstantValue constant); | 196 jsAst.Expression constantReference(ConstantValue constant); |
| 194 | 197 |
| 195 /// Returns the JS template for the given [builtin]. | 198 /// Returns the JS template for the given [builtin]. |
| 196 jsAst.Template templateForBuiltin(JsBuiltin builtin); | 199 jsAst.Template templateForBuiltin(JsBuiltin builtin); |
| 197 | 200 |
| 198 void invalidateCaches(); | 201 void invalidateCaches(); |
| 199 } | 202 } |
| OLD | NEW |