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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 return emitter.interceptorClassAccess(e); | 111 return emitter.interceptorClassAccess(e); |
112 } | 112 } |
113 | 113 |
114 /// Returns the JS expression representing the type [e]. | 114 /// Returns the JS expression representing the type [e]. |
115 /// | 115 /// |
116 /// The given type [e] might be a Typedef. | 116 /// The given type [e] might be a Typedef. |
117 jsAst.Expression typeAccess(Element e) { | 117 jsAst.Expression typeAccess(Element e) { |
118 return emitter.typeAccess(e); | 118 return emitter.typeAccess(e); |
119 } | 119 } |
120 | 120 |
| 121 jsAst.Expression closureClassConstructorAccess(ClosureClassElement e) { |
| 122 return emitter.closureClassConstructorAccess(e); |
| 123 } |
| 124 |
121 void registerReadTypeVariable(TypeVariableElement element) { | 125 void registerReadTypeVariable(TypeVariableElement element) { |
122 readTypeVariables.add(element); | 126 readTypeVariables.add(element); |
123 } | 127 } |
124 | 128 |
125 Set<ClassElement> interceptorsReferencedFromConstants() { | 129 Set<ClassElement> interceptorsReferencedFromConstants() { |
126 Set<ClassElement> classes = new Set<ClassElement>(); | 130 Set<ClassElement> classes = new Set<ClassElement>(); |
127 JavaScriptConstantCompiler handler = backend.constants; | 131 JavaScriptConstantCompiler handler = backend.constants; |
128 List<ConstantValue> constants = handler.getConstantsForEmission(); | 132 List<ConstantValue> constants = handler.getConstantsForEmission(); |
129 for (ConstantValue constant in constants) { | 133 for (ConstantValue constant in constants) { |
130 if (constant is InterceptorConstantValue) { | 134 if (constant is InterceptorConstantValue) { |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 | 440 |
437 /// Returns the JS prototype of the given class [e]. | 441 /// Returns the JS prototype of the given class [e]. |
438 jsAst.Expression prototypeAccess(ClassElement e, bool hasBeenInstantiated); | 442 jsAst.Expression prototypeAccess(ClassElement e, bool hasBeenInstantiated); |
439 | 443 |
440 /// Returns the JS constructor of the given interceptor class [e]. | 444 /// Returns the JS constructor of the given interceptor class [e]. |
441 jsAst.Expression interceptorClassAccess(ClassElement e); | 445 jsAst.Expression interceptorClassAccess(ClassElement e); |
442 | 446 |
443 /// Returns the JS expression representing the type [e]. | 447 /// Returns the JS expression representing the type [e]. |
444 jsAst.Expression typeAccess(Element e); | 448 jsAst.Expression typeAccess(Element e); |
445 | 449 |
| 450 /// Returns the JS constructor for the given closure class [e]. |
| 451 jsAst.Expression closureClassConstructorAccess(ClosureClassElement e); |
| 452 |
446 int compareConstants(ConstantValue a, ConstantValue b); | 453 int compareConstants(ConstantValue a, ConstantValue b); |
447 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); | 454 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant); |
448 | 455 |
449 void invalidateCaches(); | 456 void invalidateCaches(); |
450 } | 457 } |
OLD | NEW |