| 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; | 5 part of dart2js; |
| 6 | 6 |
| 7 class World { | 7 class World { |
| 8 final Compiler compiler; | 8 final Compiler compiler; |
| 9 final FunctionSet allFunctions; | 9 final FunctionSet allFunctions; |
| 10 final Set<Element> functionsCalledInLoop = new Set<Element>(); | 10 final Set<Element> functionsCalledInLoop = new Set<Element>(); |
| 11 final Map<Element, SideEffects> sideEffects = new Map<Element, SideEffects>(); | 11 final Map<Element, SideEffects> sideEffects = new Map<Element, SideEffects>(); |
| 12 | 12 |
| 13 final Map<ClassElement, Set<MixinApplicationElement>> mixinUses = | 13 final Map<ClassElement, Set<MixinApplicationElement>> mixinUses = |
| 14 new Map<ClassElement, Set<MixinApplicationElement>>(); | 14 new Map<ClassElement, Set<MixinApplicationElement>>(); |
| 15 | 15 |
| 16 // TODO(karlklose): remove, this is a subset of the information in |
| 17 // [ClassElement].[allSupertypes]. |
| 16 final Map<ClassElement, Set<ClassElement>> _typesImplementedBySubclasses = | 18 final Map<ClassElement, Set<ClassElement>> _typesImplementedBySubclasses = |
| 17 new Map<ClassElement, Set<ClassElement>>(); | 19 new Map<ClassElement, Set<ClassElement>>(); |
| 18 | 20 |
| 19 // We keep track of subtype and subclass relationships in four | 21 // We keep track of subtype and subclass relationships in three |
| 20 // distinct sets to make class hierarchy analysis faster. | 22 // distinct sets to make class hierarchy analysis faster. |
| 21 final Map<ClassElement, Set<ClassElement>> _subclasses = | 23 final Map<ClassElement, Set<ClassElement>> _subclasses = |
| 22 new Map<ClassElement, Set<ClassElement>>(); | 24 new Map<ClassElement, Set<ClassElement>>(); |
| 23 final Map<ClassElement, Set<ClassElement>> _subtypes = | 25 final Map<ClassElement, Set<ClassElement>> _subtypes = |
| 24 new Map<ClassElement, Set<ClassElement>>(); | 26 new Map<ClassElement, Set<ClassElement>>(); |
| 25 final Map<ClassElement, Set<ClassElement>> _supertypes = | 27 final Map<ClassElement, Set<ClassElement>> _supertypes = |
| 26 new Map<ClassElement, Set<ClassElement>>(); | 28 new Map<ClassElement, Set<ClassElement>>(); |
| 27 | 29 |
| 28 final Set<Element> sideEffectsFreeElements = new Set<Element>(); | 30 final Set<Element> sideEffectsFreeElements = new Set<Element>(); |
| 29 | 31 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 // method of function classes that were generated for function | 294 // method of function classes that were generated for function |
| 293 // expressions. In such a case, we have to look at the original | 295 // expressions. In such a case, we have to look at the original |
| 294 // function expressions's element. | 296 // function expressions's element. |
| 295 // TODO(herhut): Generate classes for function expressions earlier. | 297 // TODO(herhut): Generate classes for function expressions earlier. |
| 296 if (element is closureMapping.SynthesizedCallMethodElementX) { | 298 if (element is closureMapping.SynthesizedCallMethodElementX) { |
| 297 return getMightBePassedToApply(element.expression); | 299 return getMightBePassedToApply(element.expression); |
| 298 } | 300 } |
| 299 return functionsThatMightBePassedToApply.contains(element); | 301 return functionsThatMightBePassedToApply.contains(element); |
| 300 } | 302 } |
| 301 } | 303 } |
| OLD | NEW |