| 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_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.emitter"); | 7 const USE_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 return emitter.interceptorClassAccess(e); | 113 return emitter.interceptorClassAccess(e); |
| 114 } | 114 } |
| 115 | 115 |
| 116 /// Returns the JS expression representing the type [e]. | 116 /// Returns the JS expression representing the type [e]. |
| 117 /// | 117 /// |
| 118 /// The given type [e] might be a Typedef. | 118 /// The given type [e] might be a Typedef. |
| 119 jsAst.Expression typeAccess(Element e) { | 119 jsAst.Expression typeAccess(Element e) { |
| 120 return emitter.typeAccess(e); | 120 return emitter.typeAccess(e); |
| 121 } | 121 } |
| 122 | 122 |
| 123 jsAst.Expression closureClassConstructorAccess(ClosureClassElement e) { |
| 124 return emitter.closureClassConstructorAccess(e); |
| 125 } |
| 126 |
| 123 void registerReadTypeVariable(TypeVariableElement element) { | 127 void registerReadTypeVariable(TypeVariableElement element) { |
| 124 readTypeVariables.add(element); | 128 readTypeVariables.add(element); |
| 125 } | 129 } |
| 126 | 130 |
| 127 Set<ClassElement> interceptorsReferencedFromConstants() { | 131 Set<ClassElement> interceptorsReferencedFromConstants() { |
| 128 Set<ClassElement> classes = new Set<ClassElement>(); | 132 Set<ClassElement> classes = new Set<ClassElement>(); |
| 129 JavaScriptConstantCompiler handler = backend.constants; | 133 JavaScriptConstantCompiler handler = backend.constants; |
| 130 List<ConstantValue> constants = handler.getConstantsForEmission(); | 134 List<ConstantValue> constants = handler.getConstantsForEmission(); |
| 131 for (ConstantValue constant in constants) { | 135 for (ConstantValue constant in constants) { |
| 132 if (constant is InterceptorConstantValue) { | 136 if (constant is InterceptorConstantValue) { |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 | 455 |
| 452 /// Returns the JS prototype of the given class [e]. | 456 /// Returns the JS prototype of the given class [e]. |
| 453 jsAst.Expression prototypeAccess(ClassElement e, bool hasBeenInstantiated); | 457 jsAst.Expression prototypeAccess(ClassElement e, bool hasBeenInstantiated); |
| 454 | 458 |
| 455 /// Returns the JS constructor of the given interceptor class [e]. | 459 /// Returns the JS constructor of the given interceptor class [e]. |
| 456 jsAst.Expression interceptorClassAccess(ClassElement e); | 460 jsAst.Expression interceptorClassAccess(ClassElement e); |
| 457 | 461 |
| 458 /// Returns the JS expression representing the type [e]. | 462 /// Returns the JS expression representing the type [e]. |
| 459 jsAst.Expression typeAccess(Element e); | 463 jsAst.Expression typeAccess(Element e); |
| 460 | 464 |
| 465 /// Returns the JS constructor for the given closure class [e]. |
| 466 jsAst.Expression closureClassConstructorAccess(ClosureClassElement e); |
| 467 |
| 461 int compareConstants(ConstantValue a, ConstantValue b); | 468 int compareConstants(ConstantValue a, ConstantValue b); |
| 462 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); | 469 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); |
| 463 | 470 |
| 464 void invalidateCaches(); | 471 void invalidateCaches(); |
| 465 } | 472 } |
| OLD | NEW |