| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 | 116 |
| 117 /// Returns the JS constructor of the given interceptor class [e]. | 117 /// Returns the JS constructor of the given interceptor class [e]. |
| 118 jsAst.Expression interceptorClassAccess(ClassElement e) { | 118 jsAst.Expression interceptorClassAccess(ClassElement e) { |
| 119 return emitter.interceptorClassAccess(e); | 119 return emitter.interceptorClassAccess(e); |
| 120 } | 120 } |
| 121 | 121 |
| 122 /// Returns the JS expression representing the type [e]. | 122 /// Returns the JS expression representing the type [e]. |
| 123 /// | 123 /// |
| 124 /// The given type [e] might be a Typedef. | 124 /// The given type [e] might be a Typedef. |
| 125 jsAst.Expression typeAccess(Element e) { | 125 jsAst.Expression typeAccess(Entity e) { |
| 126 return emitter.typeAccess(e); | 126 return emitter.typeAccess(e); |
| 127 } | 127 } |
| 128 | 128 |
| 129 /// Returns the JS template for the given [builtin]. | 129 /// Returns the JS template for the given [builtin]. |
| 130 jsAst.Template builtinTemplateFor(JsBuiltin builtin) { | 130 jsAst.Template builtinTemplateFor(JsBuiltin builtin) { |
| 131 return emitter.templateForBuiltin(builtin); | 131 return emitter.templateForBuiltin(builtin); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void registerReadTypeVariable(TypeVariableElement element) { | 134 void registerReadTypeVariable(TypeVariableElement element) { |
| 135 readTypeVariables.add(element); | 135 readTypeVariables.add(element); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 /// The returned expression must only be used in a JS `new` expression. | 207 /// The returned expression must only be used in a JS `new` expression. |
| 208 jsAst.Expression constructorAccess(ClassElement e); | 208 jsAst.Expression constructorAccess(ClassElement e); |
| 209 | 209 |
| 210 /// Returns the JS prototype of the given class [e]. | 210 /// Returns the JS prototype of the given class [e]. |
| 211 jsAst.Expression prototypeAccess(ClassElement e, bool hasBeenInstantiated); | 211 jsAst.Expression prototypeAccess(ClassElement e, bool hasBeenInstantiated); |
| 212 | 212 |
| 213 /// Returns the JS constructor of the given interceptor class [e]. | 213 /// Returns the JS constructor of the given interceptor class [e]. |
| 214 jsAst.Expression interceptorClassAccess(ClassElement e); | 214 jsAst.Expression interceptorClassAccess(ClassElement e); |
| 215 | 215 |
| 216 /// Returns the JS expression representing the type [e]. | 216 /// Returns the JS expression representing the type [e]. |
| 217 jsAst.Expression typeAccess(Element e); | 217 jsAst.Expression typeAccess(Entity e); |
| 218 | 218 |
| 219 /// Returns the JS expression representing a function that returns 'null' | 219 /// Returns the JS expression representing a function that returns 'null' |
| 220 jsAst.Expression generateFunctionThatReturnsNull(); | 220 jsAst.Expression generateFunctionThatReturnsNull(); |
| 221 | 221 |
| 222 int compareConstants(ConstantValue a, ConstantValue b); | 222 int compareConstants(ConstantValue a, ConstantValue b); |
| 223 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); | 223 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); |
| 224 | 224 |
| 225 /// Returns the JS code for accessing the given [constant]. | 225 /// Returns the JS code for accessing the given [constant]. |
| 226 jsAst.Expression constantReference(ConstantValue constant); | 226 jsAst.Expression constantReference(ConstantValue constant); |
| 227 | 227 |
| 228 /// Returns the JS template for the given [builtin]. | 228 /// Returns the JS template for the given [builtin]. |
| 229 jsAst.Template templateForBuiltin(JsBuiltin builtin); | 229 jsAst.Template templateForBuiltin(JsBuiltin builtin); |
| 230 | 230 |
| 231 void invalidateCaches(); | 231 void invalidateCaches(); |
| 232 } | 232 } |
| OLD | NEW |