| 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 | 10 |
| 11 namespace dart { | 11 namespace dart { |
| 12 | 12 |
| 13 class AbstractType; | 13 class AbstractType; |
| 14 class MixinAppType; | |
| 15 class AbstractTypeArguments; | |
| 16 class Class; | 14 class Class; |
| 17 class Error; | 15 class Error; |
| 18 class Function; | 16 class Function; |
| 19 class GrowableObjectArray; | 17 class GrowableObjectArray; |
| 18 class MixinAppType; |
| 20 class RawAbstractType; | 19 class RawAbstractType; |
| 21 class RawClass; | 20 class RawClass; |
| 22 class RawType; | 21 class RawType; |
| 23 class Script; | 22 class Script; |
| 24 class Type; | 23 class Type; |
| 24 class TypeArguments; |
| 25 class UnresolvedClass; | 25 class UnresolvedClass; |
| 26 | 26 |
| 27 // Traverses all pending, unfinalized classes, validates and marks them as | 27 // Traverses all pending, unfinalized classes, validates and marks them as |
| 28 // finalized. | 28 // finalized. |
| 29 class ClassFinalizer : public AllStatic { | 29 class ClassFinalizer : public AllStatic { |
| 30 public: | 30 public: |
| 31 // Modes for type resolution and finalization. The ordering is relevant. | 31 // Modes for type resolution and finalization. The ordering is relevant. |
| 32 enum FinalizationKind { | 32 enum FinalizationKind { |
| 33 kIgnore, // Type is ignored and replaced by dynamic. | 33 kIgnore, // Type is ignored and replaced by dynamic. |
| 34 kDoNotResolve, // Type resolution is postponed. | 34 kDoNotResolve, // Type resolution is postponed. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 static void CollectTypeArguments(const Class& cls, | 134 static void CollectTypeArguments(const Class& cls, |
| 135 const Type& type, | 135 const Type& type, |
| 136 const GrowableObjectArray& collected_args); | 136 const GrowableObjectArray& collected_args); |
| 137 static RawType* ResolveMixinAppType(const Class& cls, | 137 static RawType* ResolveMixinAppType(const Class& cls, |
| 138 const MixinAppType& mixin_app_type); | 138 const MixinAppType& mixin_app_type); |
| 139 static void ResolveSuperTypeAndInterfaces(const Class& cls, | 139 static void ResolveSuperTypeAndInterfaces(const Class& cls, |
| 140 GrowableArray<intptr_t>* visited); | 140 GrowableArray<intptr_t>* visited); |
| 141 static void FinalizeTypeParameters(const Class& cls, | 141 static void FinalizeTypeParameters(const Class& cls, |
| 142 GrowableObjectArray* pending_types = NULL); | 142 GrowableObjectArray* pending_types = NULL); |
| 143 static void FinalizeTypeArguments(const Class& cls, | 143 static void FinalizeTypeArguments(const Class& cls, |
| 144 const AbstractTypeArguments& arguments, | 144 const TypeArguments& arguments, |
| 145 intptr_t num_uninitialized_arguments, | 145 intptr_t num_uninitialized_arguments, |
| 146 Error* bound_error, | 146 Error* bound_error, |
| 147 GrowableObjectArray* pending_types); | 147 GrowableObjectArray* pending_types); |
| 148 static void CheckTypeBounds(const Class& cls, const Type& type); | 148 static void CheckTypeBounds(const Class& cls, const Type& type); |
| 149 static void CheckTypeArgumentBounds(const Class& cls, | 149 static void CheckTypeArgumentBounds(const Class& cls, |
| 150 const AbstractTypeArguments& arguments, | 150 const TypeArguments& arguments, |
| 151 Error* bound_error); | 151 Error* bound_error); |
| 152 static void ResolveUpperBounds(const Class& cls); | 152 static void ResolveUpperBounds(const Class& cls); |
| 153 static void FinalizeUpperBounds(const Class& cls); | 153 static void FinalizeUpperBounds(const Class& cls); |
| 154 static void ResolveAndFinalizeSignature(const Class& cls, | 154 static void ResolveAndFinalizeSignature(const Class& cls, |
| 155 const Function& function); | 155 const Function& function); |
| 156 static void ResolveAndFinalizeMemberTypes(const Class& cls); | 156 static void ResolveAndFinalizeMemberTypes(const Class& cls); |
| 157 static void PrintClassInformation(const Class& cls); | 157 static void PrintClassInformation(const Class& cls); |
| 158 static void CollectInterfaces(const Class& cls, | 158 static void CollectInterfaces(const Class& cls, |
| 159 const GrowableObjectArray& interfaces); | 159 const GrowableObjectArray& interfaces); |
| 160 static void ReportMalformedType(const Error& prev_error, | 160 static void ReportMalformedType(const Error& prev_error, |
| 161 const Script& script, | 161 const Script& script, |
| 162 const Type& type, | 162 const Type& type, |
| 163 const char* format, | 163 const char* format, |
| 164 va_list args); | 164 va_list args); |
| 165 static void ReportError(const Error& error); | 165 static void ReportError(const Error& error); |
| 166 static void ReportError(const Error& prev_error, | 166 static void ReportError(const Error& prev_error, |
| 167 const Script& script, | 167 const Script& script, |
| 168 intptr_t token_index, | 168 intptr_t token_index, |
| 169 const char* format, ...) PRINTF_ATTRIBUTE(4, 5); | 169 const char* format, ...) PRINTF_ATTRIBUTE(4, 5); |
| 170 | 170 |
| 171 // Verify implicit offsets recorded in the VM for direct access to fields of | 171 // Verify implicit offsets recorded in the VM for direct access to fields of |
| 172 // Dart instances (e.g: _TypedListView, _ByteDataView). | 172 // Dart instances (e.g: _TypedListView, _ByteDataView). |
| 173 static void VerifyImplicitFieldOffsets(); | 173 static void VerifyImplicitFieldOffsets(); |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 } // namespace dart | 176 } // namespace dart |
| 177 | 177 |
| 178 #endif // VM_CLASS_FINALIZER_H_ | 178 #endif // VM_CLASS_FINALIZER_H_ |
| OLD | NEW |