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