| 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 library dart2js.world; | 5 library dart2js.world; |
| 6 | 6 |
| 7 import 'closure.dart' show SynthesizedCallMethodElementX; | 7 import 'closure.dart' show SynthesizedCallMethodElementX; |
| 8 import 'common/backend_api.dart' show Backend; | 8 import 'common/backend_api.dart' show Backend; |
| 9 import 'common.dart'; | 9 import 'common.dart'; |
| 10 import 'compiler.dart' show Compiler; | 10 import 'compiler.dart' show Compiler; |
| 11 import 'core_types.dart' show CoreClasses; | 11 import 'core_types.dart' show CoreClasses; |
| 12 import 'dart_types.dart'; | 12 import 'dart_types.dart'; |
| 13 import 'elements/elements.dart' | 13 import 'elements/elements.dart' |
| 14 show | 14 show |
| 15 ClassElement, | 15 ClassElement, |
| 16 Element, | 16 Element, |
| 17 FunctionElement, | 17 FunctionElement, |
| 18 MixinApplicationElement, | 18 MixinApplicationElement, |
| 19 TypedefElement, | 19 TypedefElement, |
| 20 VariableElement; | 20 VariableElement; |
| 21 import 'ordered_typeset.dart'; | 21 import 'ordered_typeset.dart'; |
| 22 import 'types/types.dart' as ti; | 22 import 'types/types.dart' as ti; |
| 23 import 'universe/class_set.dart'; | 23 import 'universe/class_set.dart'; |
| 24 import 'universe/function_set.dart' show FunctionSet; | 24 import 'universe/function_set.dart' show FunctionSet; |
| 25 import 'universe/selector.dart' show Selector; | 25 import 'universe/selector.dart' show Selector; |
| 26 import 'universe/side_effects.dart' show SideEffects; | 26 import 'universe/side_effects.dart' show SideEffects; |
| 27 import 'util/util.dart' show Link; | 27 import 'util/util.dart' show Link; |
| 28 | 28 |
| 29 /// The [ClassWorld] represents the information known about a program when |
| 30 /// compiling with closed-world semantics. |
| 31 /// |
| 32 /// Given the entrypoint of an application, we can track what's reachable from |
| 33 /// it, what functions are called, what classes are allocated, which native |
| 34 /// JavaScript types are touched, what language features are used, and so on. |
| 35 /// This precise knowledge about what's live in the program is later used in |
| 36 /// optimizations and other compiler decisions during code generation. |
| 29 abstract class ClassWorld { | 37 abstract class ClassWorld { |
| 30 // TODO(johnniwinther): Refine this into a `BackendClasses` interface. | 38 // TODO(johnniwinther): Refine this into a `BackendClasses` interface. |
| 31 Backend get backend; | 39 Backend get backend; |
| 32 | 40 |
| 33 // TODO(johnniwinther): Remove the need for this getter. | 41 // TODO(johnniwinther): Remove the need for this getter. |
| 34 @deprecated | 42 @deprecated |
| 35 Compiler get compiler; | 43 Compiler get compiler; |
| 36 | 44 |
| 37 /// The [ClassElement] for the [Object] class defined in 'dart:core'. | 45 /// The [ClassElement] for the [Object] class defined in 'dart:core'. |
| 38 ClassElement get objectClass; | 46 ClassElement get objectClass; |
| (...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 // function expressions's element. | 835 // function expressions's element. |
| 828 // TODO(herhut): Generate classes for function expressions earlier. | 836 // TODO(herhut): Generate classes for function expressions earlier. |
| 829 if (element is SynthesizedCallMethodElementX) { | 837 if (element is SynthesizedCallMethodElementX) { |
| 830 return getMightBePassedToApply(element.expression); | 838 return getMightBePassedToApply(element.expression); |
| 831 } | 839 } |
| 832 return functionsThatMightBePassedToApply.contains(element); | 840 return functionsThatMightBePassedToApply.contains(element); |
| 833 } | 841 } |
| 834 | 842 |
| 835 bool get hasClosedWorldAssumption => !compiler.options.hasIncrementalSupport; | 843 bool get hasClosedWorldAssumption => !compiler.options.hasIncrementalSupport; |
| 836 } | 844 } |
| OLD | NEW |