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 universe; | 5 library universe; |
6 | 6 |
7 import '../closure.dart'; | 7 import '../closure.dart'; |
8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
9 import '../dart2jslib.dart'; | 9 import '../dart2jslib.dart'; |
10 import '../runtime_types.dart'; | |
11 import '../tree/tree.dart'; | 10 import '../tree/tree.dart'; |
12 import '../util/util.dart'; | 11 import '../util/util.dart'; |
13 | 12 |
14 part 'function_set.dart'; | 13 part 'function_set.dart'; |
15 part 'partial_type_tree.dart'; | 14 part 'partial_type_tree.dart'; |
16 part 'selector_map.dart'; | 15 part 'selector_map.dart'; |
17 | 16 |
18 class Universe { | 17 class Universe { |
19 /** | 18 /** |
20 * Documentation wanted -- johnniwinther | 19 * Documentation wanted -- johnniwinther |
(...skipping 21 matching lines...) Expand all Loading... |
42 * | 41 * |
43 * Invariant: Elements are declaration elements. | 42 * Invariant: Elements are declaration elements. |
44 */ | 43 */ |
45 final Set<FunctionElement> staticFunctionsNeedingGetter; | 44 final Set<FunctionElement> staticFunctionsNeedingGetter; |
46 final Map<SourceString, Set<Selector>> invokedNames; | 45 final Map<SourceString, Set<Selector>> invokedNames; |
47 final Map<SourceString, Set<Selector>> invokedGetters; | 46 final Map<SourceString, Set<Selector>> invokedGetters; |
48 final Map<SourceString, Set<Selector>> invokedSetters; | 47 final Map<SourceString, Set<Selector>> invokedSetters; |
49 final Map<SourceString, Set<Selector>> fieldGetters; | 48 final Map<SourceString, Set<Selector>> fieldGetters; |
50 final Map<SourceString, Set<Selector>> fieldSetters; | 49 final Map<SourceString, Set<Selector>> fieldSetters; |
51 final Set<DartType> isChecks; | 50 final Set<DartType> isChecks; |
52 final RuntimeTypeInformation rti; | |
53 | 51 |
54 Universe() : generatedCode = new Map<Element, CodeBuffer>(), | 52 Universe() : generatedCode = new Map<Element, CodeBuffer>(), |
55 generatedBailoutCode = new Map<Element, CodeBuffer>(), | 53 generatedBailoutCode = new Map<Element, CodeBuffer>(), |
56 instantiatedClasses = new Set<ClassElement>(), | 54 instantiatedClasses = new Set<ClassElement>(), |
57 staticFunctionsNeedingGetter = new Set<FunctionElement>(), | 55 staticFunctionsNeedingGetter = new Set<FunctionElement>(), |
58 invokedNames = new Map<SourceString, Set<Selector>>(), | 56 invokedNames = new Map<SourceString, Set<Selector>>(), |
59 invokedGetters = new Map<SourceString, Set<Selector>>(), | 57 invokedGetters = new Map<SourceString, Set<Selector>>(), |
60 invokedSetters = new Map<SourceString, Set<Selector>>(), | 58 invokedSetters = new Map<SourceString, Set<Selector>>(), |
61 fieldGetters = new Map<SourceString, Set<Selector>>(), | 59 fieldGetters = new Map<SourceString, Set<Selector>>(), |
62 fieldSetters = new Map<SourceString, Set<Selector>>(), | 60 fieldSetters = new Map<SourceString, Set<Selector>>(), |
63 isChecks = new Set<DartType>(), | 61 isChecks = new Set<DartType>(); |
64 rti = new RuntimeTypeInformation(); | |
65 | 62 |
66 void addGeneratedCode(WorkItem work, CodeBuffer codeBuffer) { | 63 void addGeneratedCode(WorkItem work, CodeBuffer codeBuffer) { |
67 assert(invariant(work.element, work.element.isDeclaration)); | 64 assert(invariant(work.element, work.element.isDeclaration)); |
68 generatedCode[work.element] = codeBuffer; | 65 generatedCode[work.element] = codeBuffer; |
69 } | 66 } |
70 | 67 |
71 void addBailoutCode(WorkItem work, CodeBuffer codeBuffer) { | 68 void addBailoutCode(WorkItem work, CodeBuffer codeBuffer) { |
72 assert(invariant(work.element, work.element.isDeclaration)); | 69 assert(invariant(work.element, work.element.isDeclaration)); |
73 generatedBailoutCode[work.element] = codeBuffer; | 70 generatedBailoutCode[work.element] = codeBuffer; |
74 } | 71 } |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 // implementation of [element]. | 437 // implementation of [element]. |
441 if (self.isSubclassOf(other)) { | 438 if (self.isSubclassOf(other)) { |
442 // Resolve an invocation of [element.name] on [self]. If it | 439 // Resolve an invocation of [element.name] on [self]. If it |
443 // is found, this selector is a candidate. | 440 // is found, this selector is a candidate. |
444 return hasElementIn(self, element) && appliesUntyped(element, compiler); | 441 return hasElementIn(self, element) && appliesUntyped(element, compiler); |
445 } | 442 } |
446 | 443 |
447 return false; | 444 return false; |
448 } | 445 } |
449 } | 446 } |
OLD | NEW |