| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.program_builder; | 5 part of dart2js.js_emitter.program_builder; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Generates the code for all used classes in the program. Static fields (even | 8 * Generates the code for all used classes in the program. Static fields (even |
| 9 * in classes) are ignored, since they can be treated as non-class elements. | 9 * in classes) are ignored, since they can be treated as non-class elements. |
| 10 * | 10 * |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 Collector(this.compiler, this.namer, this.closedWorld, this.rtiNeededClasses, | 50 Collector(this.compiler, this.namer, this.closedWorld, this.rtiNeededClasses, |
| 51 this.emitter); | 51 this.emitter); |
| 52 | 52 |
| 53 Set<ClassElement> computeInterceptorsReferencedFromConstants() { | 53 Set<ClassElement> computeInterceptorsReferencedFromConstants() { |
| 54 Set<ClassElement> classes = new Set<ClassElement>(); | 54 Set<ClassElement> classes = new Set<ClassElement>(); |
| 55 JavaScriptConstantCompiler handler = backend.constants; | 55 JavaScriptConstantCompiler handler = backend.constants; |
| 56 List<ConstantValue> constants = handler.getConstantsForEmission(); | 56 List<ConstantValue> constants = handler.getConstantsForEmission(); |
| 57 for (ConstantValue constant in constants) { | 57 for (ConstantValue constant in constants) { |
| 58 if (constant is InterceptorConstantValue) { | 58 if (constant is InterceptorConstantValue) { |
| 59 InterceptorConstantValue interceptorConstant = constant; | 59 InterceptorConstantValue interceptorConstant = constant; |
| 60 classes.add(interceptorConstant.dispatchedType.element); | 60 classes.add(interceptorConstant.cls); |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 return classes; | 63 return classes; |
| 64 } | 64 } |
| 65 | 65 |
| 66 /** | 66 /** |
| 67 * Return a function that returns true if its argument is a class | 67 * Return a function that returns true if its argument is a class |
| 68 * that needs to be emitted. | 68 * that needs to be emitted. |
| 69 */ | 69 */ |
| 70 Function computeClassFilter() { | 70 Function computeClassFilter() { |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 } | 317 } |
| 318 | 318 |
| 319 void collect() { | 319 void collect() { |
| 320 computeNeededDeclarations(); | 320 computeNeededDeclarations(); |
| 321 computeNeededConstants(); | 321 computeNeededConstants(); |
| 322 computeNeededStatics(); | 322 computeNeededStatics(); |
| 323 computeNeededStaticNonFinalFields(); | 323 computeNeededStaticNonFinalFields(); |
| 324 computeNeededLibraries(); | 324 computeNeededLibraries(); |
| 325 } | 325 } |
| 326 } | 326 } |
| OLD | NEW |