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 | 11 |
11 namespace dart { | 12 namespace dart { |
12 | 13 |
13 class AbstractType; | |
14 class Class; | |
15 class Error; | |
16 class Function; | |
17 class GrowableObjectArray; | |
18 class MixinAppType; | |
19 class RawAbstractType; | |
20 class RawClass; | |
21 class RawType; | |
22 class Script; | |
23 class Type; | |
24 class TypeArguments; | |
25 class UnresolvedClass; | |
26 | |
27 // Traverses all pending, unfinalized classes, validates and marks them as | 14 // Traverses all pending, unfinalized classes, validates and marks them as |
28 // finalized. | 15 // finalized. |
29 class ClassFinalizer : public AllStatic { | 16 class ClassFinalizer : public AllStatic { |
30 public: | 17 public: |
31 // Modes for type resolution and finalization. The ordering is relevant. | 18 // Modes for type resolution and finalization. The ordering is relevant. |
32 enum FinalizationKind { | 19 enum FinalizationKind { |
33 kIgnore, // Type is ignored and replaced by dynamic. | 20 kIgnore, // Type is ignored and replaced by dynamic. |
34 kDoNotResolve, // Type resolution is postponed. | 21 kDoNotResolve, // Type resolution is postponed. |
35 kResolveTypeParameters, // Resolve type parameters only. | 22 kResolveTypeParameters, // Resolve type parameters only. |
36 kFinalize, // Type resolution and finalization are required. | 23 kFinalize, // Type resolution and finalization are required. |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 const MixinAppType& mixin_app_type); | 129 const MixinAppType& mixin_app_type); |
143 static void ResolveSuperTypeAndInterfaces(const Class& cls, | 130 static void ResolveSuperTypeAndInterfaces(const Class& cls, |
144 GrowableArray<intptr_t>* visited); | 131 GrowableArray<intptr_t>* visited); |
145 static void FinalizeTypeParameters(const Class& cls, | 132 static void FinalizeTypeParameters(const Class& cls, |
146 GrowableObjectArray* pending_types = NULL); | 133 GrowableObjectArray* pending_types = NULL); |
147 static void FinalizeTypeArguments(const Class& cls, | 134 static void FinalizeTypeArguments(const Class& cls, |
148 const TypeArguments& arguments, | 135 const TypeArguments& arguments, |
149 intptr_t num_uninitialized_arguments, | 136 intptr_t num_uninitialized_arguments, |
150 Error* bound_error, | 137 Error* bound_error, |
151 GrowableObjectArray* pending_types, | 138 GrowableObjectArray* pending_types, |
152 GrowableObjectArray* trail); | 139 TrailPtr trail); |
153 static void CheckRecursiveType(const Class& cls, | 140 static void CheckRecursiveType(const Class& cls, |
154 const Type& type, | 141 const Type& type, |
155 GrowableObjectArray* pending_types); | 142 GrowableObjectArray* pending_types); |
156 static void CheckTypeBounds(const Class& cls, const Type& type); | 143 static void CheckTypeBounds(const Class& cls, const Type& type); |
157 static void CheckTypeArgumentBounds(const Class& cls, | 144 static void CheckTypeArgumentBounds(const Class& cls, |
158 const TypeArguments& arguments, | 145 const TypeArguments& arguments, |
159 Error* bound_error); | 146 Error* bound_error); |
160 static void ResolveUpperBounds(const Class& cls); | 147 static void ResolveUpperBounds(const Class& cls); |
161 static void FinalizeUpperBounds(const Class& cls); | 148 static void FinalizeUpperBounds(const Class& cls); |
162 static void ResolveAndFinalizeSignature(const Class& cls, | 149 static void ResolveAndFinalizeSignature(const Class& cls, |
(...skipping 17 matching lines...) Expand all Loading... |
180 const char* format, ...) PRINTF_ATTRIBUTE(4, 5); | 167 const char* format, ...) PRINTF_ATTRIBUTE(4, 5); |
181 | 168 |
182 // Verify implicit offsets recorded in the VM for direct access to fields of | 169 // Verify implicit offsets recorded in the VM for direct access to fields of |
183 // Dart instances (e.g: _TypedListView, _ByteDataView). | 170 // Dart instances (e.g: _TypedListView, _ByteDataView). |
184 static void VerifyImplicitFieldOffsets(); | 171 static void VerifyImplicitFieldOffsets(); |
185 }; | 172 }; |
186 | 173 |
187 } // namespace dart | 174 } // namespace dart |
188 | 175 |
189 #endif // VM_CLASS_FINALIZER_H_ | 176 #endif // VM_CLASS_FINALIZER_H_ |
OLD | NEW |