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 RUNTIME_VM_CLASS_FINALIZER_H_ | 5 #ifndef RUNTIME_VM_CLASS_FINALIZER_H_ |
6 #define RUNTIME_VM_CLASS_FINALIZER_H_ | 6 #define RUNTIME_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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 const char* format, ...) | 64 const char* format, ...) |
65 PRINTF_ATTRIBUTE(4, 5); | 65 PRINTF_ATTRIBUTE(4, 5); |
66 | 66 |
67 // Return false if we still have classes pending to be finalized. | 67 // Return false if we still have classes pending to be finalized. |
68 static bool AllClassesFinalized(); | 68 static bool AllClassesFinalized(); |
69 | 69 |
70 // Return whether processing pending classes (ObjectStore::pending_classes_) | 70 // Return whether processing pending classes (ObjectStore::pending_classes_) |
71 // failed. The function returns true if the processing was successful. | 71 // failed. The function returns true if the processing was successful. |
72 // If processing fails, an error message is set in the sticky error field | 72 // If processing fails, an error message is set in the sticky error field |
73 // in the object store. | 73 // in the object store. |
74 static bool ProcessPendingClasses(); | 74 static bool ProcessPendingClasses(bool from_kernel = false); |
75 | 75 |
76 // Finalize the types appearing in the declaration of class 'cls', i.e. its | 76 // Finalize the types appearing in the declaration of class 'cls', i.e. its |
77 // type parameters and their upper bounds, its super type and interfaces. | 77 // type parameters and their upper bounds, its super type and interfaces. |
78 // Note that the fields and functions have not been parsed yet (unless cls | 78 // Note that the fields and functions have not been parsed yet (unless cls |
79 // is an anonymous top level class). | 79 // is an anonymous top level class). |
80 static void FinalizeTypesInClass(const Class& cls); | 80 static void FinalizeTypesInClass(const Class& cls); |
81 | 81 |
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) | |
86 // Verify that the classes have been properly prefinalized. This is | 85 // Verify that the classes have been properly prefinalized. This is |
87 // needed during bootstrapping where the classes have been preloaded. | 86 // needed during bootstrapping where the classes have been preloaded. |
88 static void VerifyBootstrapClasses(); | 87 static void VerifyBootstrapClasses(); |
89 #endif // defined(DART_NO_SNAPSHOT). | |
90 | 88 |
91 // Resolve the class of the type, but not the type's type arguments. | 89 // Resolve the class of the type, but not the type's type arguments. |
92 // May promote the type to function type by setting its signature field. | 90 // May promote the type to function type by setting its signature field. |
93 static void ResolveTypeClass(const Class& cls, const Type& type); | 91 static void ResolveTypeClass(const Class& cls, const Type& type); |
94 | 92 |
95 // Resolve the type and target of the redirecting factory. | 93 // Resolve the type and target of the redirecting factory. |
96 static void ResolveRedirectingFactory(const Class& cls, | 94 static void ResolveRedirectingFactory(const Class& cls, |
97 const Function& factory); | 95 const Function& factory); |
98 | 96 |
99 // Apply the mixin type to the mixin application class. | 97 // Apply the mixin type to the mixin application class. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 const char* format, ...) PRINTF_ATTRIBUTE(4, 5); | 172 const char* format, ...) PRINTF_ATTRIBUTE(4, 5); |
175 | 173 |
176 // Verify implicit offsets recorded in the VM for direct access to fields of | 174 // Verify implicit offsets recorded in the VM for direct access to fields of |
177 // Dart instances (e.g: _TypedListView, _ByteDataView). | 175 // Dart instances (e.g: _TypedListView, _ByteDataView). |
178 static void VerifyImplicitFieldOffsets(); | 176 static void VerifyImplicitFieldOffsets(); |
179 }; | 177 }; |
180 | 178 |
181 } // namespace dart | 179 } // namespace dart |
182 | 180 |
183 #endif // RUNTIME_VM_CLASS_FINALIZER_H_ | 181 #endif // RUNTIME_VM_CLASS_FINALIZER_H_ |
OLD | NEW |