| 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 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 // Return false if we still have classes pending to be finalized. | 77 // Return false if we still have classes pending to be finalized. |
| 78 static bool AllClassesFinalized(); | 78 static bool AllClassesFinalized(); |
| 79 | 79 |
| 80 // Return whether class finalization failed. | 80 // Return whether class finalization failed. |
| 81 // The function returns true if the finalization was successful. | 81 // The function returns true if the finalization was successful. |
| 82 // If finalization fails, an error message is set in the sticky error field | 82 // If finalization fails, an error message is set in the sticky error field |
| 83 // in the object store. | 83 // in the object store. |
| 84 static bool FinalizePendingClasses(); | 84 static bool FinalizePendingClasses(); |
| 85 | 85 |
| 86 static void FinalizeTypesInClass(const Class& cls); |
| 87 |
| 88 static void FinalizeClass(const Class& cls); |
| 86 | 89 |
| 87 // Verify that the classes have been properly prefinalized. This is | 90 // Verify that the classes have been properly prefinalized. This is |
| 88 // needed during bootstrapping where the classes have been preloaded. | 91 // needed during bootstrapping where the classes have been preloaded. |
| 89 static void VerifyBootstrapClasses(); | 92 static void VerifyBootstrapClasses(); |
| 90 | 93 |
| 91 private: | 94 private: |
| 92 static void FinalizeClass(const Class& cls); | |
| 93 static bool IsSuperCycleFree(const Class& cls); | 95 static bool IsSuperCycleFree(const Class& cls); |
| 94 static bool IsAliasCycleFree(const Class& cls, | 96 static bool IsAliasCycleFree(const Class& cls, |
| 95 GrowableArray<intptr_t>* visited); | 97 GrowableArray<intptr_t>* visited); |
| 96 static void CheckForLegalConstClass(const Class& cls); | 98 static void CheckForLegalConstClass(const Class& cls); |
| 97 static RawClass* ResolveClass(const Class& cls, | 99 static RawClass* ResolveClass(const Class& cls, |
| 98 const UnresolvedClass& unresolved_class); | 100 const UnresolvedClass& unresolved_class); |
| 99 static void ResolveRedirectingFactoryTarget( | 101 static void ResolveRedirectingFactoryTarget( |
| 100 const Class& cls, | 102 const Class& cls, |
| 101 const Function& factory, | 103 const Function& factory, |
| 102 const GrowableObjectArray& visited_factories); | 104 const GrowableObjectArray& visited_factories); |
| 103 static void CloneTypeParameters(const Class& mixapp_class); | 105 static void CloneTypeParameters(const Class& mixapp_class); |
| 106 static void ApplyMixinTypes(const Class& cls); |
| 104 static void ApplyMixin(const Class& cls); | 107 static void ApplyMixin(const Class& cls); |
| 105 static void CollectTypeArguments(const Class& cls, | 108 static void CollectTypeArguments(const Class& cls, |
| 106 const Type& type, | 109 const Type& type, |
| 107 const GrowableObjectArray& collected_args); | 110 const GrowableObjectArray& collected_args); |
| 108 static RawType* ResolveMixinAppType(const Class& cls, | 111 static RawType* ResolveMixinAppType(const Class& cls, |
| 109 const MixinAppType& mixin_app); | 112 const MixinAppType& mixin_app); |
| 110 static void ResolveSuperTypeAndInterfaces(const Class& cls, | 113 static void ResolveSuperTypeAndInterfaces(const Class& cls, |
| 111 GrowableArray<intptr_t>* visited); | 114 GrowableArray<intptr_t>* visited); |
| 112 static void FinalizeTypeParameters(const Class& cls); | 115 static void FinalizeTypeParameters(const Class& cls); |
| 113 static void FinalizeTypeArguments(const Class& cls, | 116 static void FinalizeTypeArguments(const Class& cls, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 141 static void ReportError(const char* format, ...) PRINTF_ATTRIBUTE(1, 2); | 144 static void ReportError(const char* format, ...) PRINTF_ATTRIBUTE(1, 2); |
| 142 | 145 |
| 143 // Verify implicit offsets recorded in the VM for direct access to fields of | 146 // Verify implicit offsets recorded in the VM for direct access to fields of |
| 144 // Dart instances (e.g: _TypedListView, _ByteDataView). | 147 // Dart instances (e.g: _TypedListView, _ByteDataView). |
| 145 static void VerifyImplicitFieldOffsets(); | 148 static void VerifyImplicitFieldOffsets(); |
| 146 }; | 149 }; |
| 147 | 150 |
| 148 } // namespace dart | 151 } // namespace dart |
| 149 | 152 |
| 150 #endif // VM_CLASS_FINALIZER_H_ | 153 #endif // VM_CLASS_FINALIZER_H_ |
| OLD | NEW |