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; | 52 /// Runtime type information support. This field is only set in the backend. |
| 53 RuntimeTypeInformation rti; |
53 | 54 |
54 Universe() : generatedCode = new Map<Element, CodeBuffer>(), | 55 Universe() : generatedCode = new Map<Element, CodeBuffer>(), |
55 generatedBailoutCode = new Map<Element, CodeBuffer>(), | 56 generatedBailoutCode = new Map<Element, CodeBuffer>(), |
56 instantiatedClasses = new Set<ClassElement>(), | 57 instantiatedClasses = new Set<ClassElement>(), |
57 staticFunctionsNeedingGetter = new Set<FunctionElement>(), | 58 staticFunctionsNeedingGetter = new Set<FunctionElement>(), |
58 invokedNames = new Map<SourceString, Set<Selector>>(), | 59 invokedNames = new Map<SourceString, Set<Selector>>(), |
59 invokedGetters = new Map<SourceString, Set<Selector>>(), | 60 invokedGetters = new Map<SourceString, Set<Selector>>(), |
60 invokedSetters = new Map<SourceString, Set<Selector>>(), | 61 invokedSetters = new Map<SourceString, Set<Selector>>(), |
61 fieldGetters = new Map<SourceString, Set<Selector>>(), | 62 fieldGetters = new Map<SourceString, Set<Selector>>(), |
62 fieldSetters = new Map<SourceString, Set<Selector>>(), | 63 fieldSetters = new Map<SourceString, Set<Selector>>(), |
63 isChecks = new Set<DartType>(), | 64 isChecks = new Set<DartType>(); |
64 rti = new RuntimeTypeInformation(); | |
65 | 65 |
66 void addGeneratedCode(WorkItem work, CodeBuffer codeBuffer) { | 66 void addGeneratedCode(WorkItem work, CodeBuffer codeBuffer) { |
67 assert(invariant(work.element, work.element.isDeclaration)); | 67 assert(invariant(work.element, work.element.isDeclaration)); |
68 generatedCode[work.element] = codeBuffer; | 68 generatedCode[work.element] = codeBuffer; |
69 } | 69 } |
70 | 70 |
71 void addBailoutCode(WorkItem work, CodeBuffer codeBuffer) { | 71 void addBailoutCode(WorkItem work, CodeBuffer codeBuffer) { |
72 assert(invariant(work.element, work.element.isDeclaration)); | 72 assert(invariant(work.element, work.element.isDeclaration)); |
73 generatedBailoutCode[work.element] = codeBuffer; | 73 generatedBailoutCode[work.element] = codeBuffer; |
74 } | 74 } |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 // implementation of [element]. | 440 // implementation of [element]. |
441 if (self.isSubclassOf(other)) { | 441 if (self.isSubclassOf(other)) { |
442 // Resolve an invocation of [element.name] on [self]. If it | 442 // Resolve an invocation of [element.name] on [self]. If it |
443 // is found, this selector is a candidate. | 443 // is found, this selector is a candidate. |
444 return hasElementIn(self, element) && appliesUntyped(element, compiler); | 444 return hasElementIn(self, element) && appliesUntyped(element, compiler); |
445 } | 445 } |
446 | 446 |
447 return false; | 447 return false; |
448 } | 448 } |
449 } | 449 } |
OLD | NEW |