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 #ifndef VM_CLASS_FINALIZER_H_ | 5 #ifndef VM_CLASS_FINALIZER_H_ |
6 #define VM_CLASS_FINALIZER_H_ | 6 #define VM_CLASS_FINALIZER_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
10 #include "vm/object.h" | 10 #include "vm/object.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Finalize the class including its fields and functions. | 82 // Finalize the class including its fields and functions. |
83 static void FinalizeClass(const Class& cls); | 83 static void FinalizeClass(const Class& cls); |
84 | 84 |
85 #if defined(DART_NO_SNAPSHOT) | 85 #if defined(DART_NO_SNAPSHOT) |
86 // Verify that the classes have been properly prefinalized. This is | 86 // Verify that the classes have been properly prefinalized. This is |
87 // needed during bootstrapping where the classes have been preloaded. | 87 // needed during bootstrapping where the classes have been preloaded. |
88 static void VerifyBootstrapClasses(); | 88 static void VerifyBootstrapClasses(); |
89 #endif // defined(DART_NO_SNAPSHOT). | 89 #endif // defined(DART_NO_SNAPSHOT). |
90 | 90 |
91 // Resolve the class of the type, but not the type's type arguments. | 91 // Resolve the class of the type, but not the type's type arguments. |
92 // May promote the type from Type to FunctionType. | 92 // May promote the type to function type by setting its signature field. |
93 static RawAbstractType* ResolveTypeClass(const Class& cls, const Type& type); | 93 static void ResolveTypeClass(const Class& cls, const Type& type); |
94 | 94 |
95 // Resolve the type and target of the redirecting factory. | 95 // Resolve the type and target of the redirecting factory. |
96 static void ResolveRedirectingFactory(const Class& cls, | 96 static void ResolveRedirectingFactory(const Class& cls, |
97 const Function& factory); | 97 const Function& factory); |
98 | 98 |
99 // Apply the mixin type to the mixin application class. | 99 // Apply the mixin type to the mixin application class. |
100 static void ApplyMixinType(const Class& mixin_app_class, | 100 static void ApplyMixinType(const Class& mixin_app_class, |
101 PendingTypes* pending_types = NULL); | 101 PendingTypes* pending_types = NULL); |
102 | 102 |
103 private: | 103 private: |
104 static void AllocateEnumValues(const Class& enum_cls); | 104 static void AllocateEnumValues(const Class& enum_cls); |
105 static bool IsSuperCycleFree(const Class& cls); | 105 static bool IsSuperCycleFree(const Class& cls); |
106 static bool IsTypedefCycleFree(const Class& cls, | 106 static bool IsTypedefCycleFree(const Class& cls, |
107 const AbstractType& type, | 107 const AbstractType& type, |
108 GrowableArray<intptr_t>* visited); | 108 GrowableArray<intptr_t>* visited); |
109 static bool IsMixinCycleFree(const Class& cls, | 109 static bool IsMixinCycleFree(const Class& cls, |
110 GrowableArray<intptr_t>* visited); | 110 GrowableArray<intptr_t>* visited); |
111 static void CheckForLegalConstClass(const Class& cls); | 111 static void CheckForLegalConstClass(const Class& cls); |
112 static RawClass* ResolveClass(const Class& cls, | 112 static RawClass* ResolveClass(const Class& cls, |
113 const UnresolvedClass& unresolved_class); | 113 const UnresolvedClass& unresolved_class); |
114 static RawAbstractType* ResolveType(const Class& cls, | 114 static void ResolveType(const Class& cls, const AbstractType& type); |
115 const AbstractType& type); | |
116 static void ResolveRedirectingFactoryTarget( | 115 static void ResolveRedirectingFactoryTarget( |
117 const Class& cls, | 116 const Class& cls, |
118 const Function& factory, | 117 const Function& factory, |
119 const GrowableObjectArray& visited_factories); | 118 const GrowableObjectArray& visited_factories); |
120 static void CloneMixinAppTypeParameters(const Class& mixin_app_class); | 119 static void CloneMixinAppTypeParameters(const Class& mixin_app_class); |
121 static void ApplyMixinAppAlias(const Class& mixin_app_class, | 120 static void ApplyMixinAppAlias(const Class& mixin_app_class, |
122 const TypeArguments& instantiator); | 121 const TypeArguments& instantiator); |
123 static void ApplyMixinMembers(const Class& cls); | 122 static void ApplyMixinMembers(const Class& cls); |
124 static void CreateForwardingConstructors( | 123 static void CreateForwardingConstructors( |
125 const Class& mixin_app, | 124 const Class& mixin_app, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 const char* format, ...) PRINTF_ATTRIBUTE(4, 5); | 174 const char* format, ...) PRINTF_ATTRIBUTE(4, 5); |
176 | 175 |
177 // Verify implicit offsets recorded in the VM for direct access to fields of | 176 // Verify implicit offsets recorded in the VM for direct access to fields of |
178 // Dart instances (e.g: _TypedListView, _ByteDataView). | 177 // Dart instances (e.g: _TypedListView, _ByteDataView). |
179 static void VerifyImplicitFieldOffsets(); | 178 static void VerifyImplicitFieldOffsets(); |
180 }; | 179 }; |
181 | 180 |
182 } // namespace dart | 181 } // namespace dart |
183 | 182 |
184 #endif // VM_CLASS_FINALIZER_H_ | 183 #endif // VM_CLASS_FINALIZER_H_ |
OLD | NEW |