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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // Also canonicalize type if applicable. | 45 // Also canonicalize type if applicable. |
46 static RawAbstractType* FinalizeType(const Class& cls, | 46 static RawAbstractType* FinalizeType(const Class& cls, |
47 const AbstractType& type, | 47 const AbstractType& type, |
48 FinalizationKind finalization); | 48 FinalizationKind finalization); |
49 | 49 |
50 // Allocate, finalize, and return a new malformed type as if it was declared | 50 // Allocate, finalize, and return a new malformed type as if it was declared |
51 // in class cls at the given token position. | 51 // in class cls at the given token position. |
52 // If not null, prepend prev_error to the error message built from the format | 52 // If not null, prepend prev_error to the error message built from the format |
53 // string and its arguments. | 53 // string and its arguments. |
54 static RawType* NewFinalizedMalformedType(const Error& prev_error, | 54 static RawType* NewFinalizedMalformedType(const Error& prev_error, |
55 const Class& cls, | 55 const Script& script, |
56 intptr_t type_pos, | 56 intptr_t type_pos, |
57 const char* format, ...) | 57 const char* format, ...) |
58 PRINTF_ATTRIBUTE(4, 5); | 58 PRINTF_ATTRIBUTE(4, 5); |
59 | 59 |
60 // Depending on the given type, finalization mode, and execution mode, mark | 60 // Depending on the given type, finalization mode, and execution mode, mark |
61 // the given type as malformed or report a compile time error. | 61 // the given type as malformed or report a compile time error. |
62 // If not null, prepend prev_error to the error message built from the format | 62 // If not null, prepend prev_error to the error message built from the format |
63 // string and its arguments. | 63 // string and its arguments. |
64 static void FinalizeMalformedType(const Error& prev_error, | 64 static void FinalizeMalformedType(const Error& prev_error, |
65 const Class& cls, | 65 const Script& script, |
66 const Type& type, | 66 const Type& type, |
67 const char* format, ...) | 67 const char* format, ...) |
68 PRINTF_ATTRIBUTE(4, 5); | 68 PRINTF_ATTRIBUTE(4, 5); |
69 | 69 |
70 // Return false if we still have classes pending to be finalized. | 70 // Return false if we still have classes pending to be finalized. |
71 static bool AllClassesFinalized(); | 71 static bool AllClassesFinalized(); |
72 | 72 |
73 // Return whether class finalization failed. | 73 // Return whether class finalization failed. |
74 // The function returns true if the finalization was successful. | 74 // The function returns true if the finalization was successful. |
75 // If finalization fails, an error message is set in the sticky error field | 75 // If finalization fails, an error message is set in the sticky error field |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 FinalizationKind finalization); | 138 FinalizationKind finalization); |
139 static void ResolveUpperBounds(const Class& cls); | 139 static void ResolveUpperBounds(const Class& cls); |
140 static void FinalizeUpperBounds(const Class& cls); | 140 static void FinalizeUpperBounds(const Class& cls); |
141 static void ResolveAndFinalizeSignature(const Class& cls, | 141 static void ResolveAndFinalizeSignature(const Class& cls, |
142 const Function& function); | 142 const Function& function); |
143 static void ResolveAndFinalizeMemberTypes(const Class& cls); | 143 static void ResolveAndFinalizeMemberTypes(const Class& cls); |
144 static void PrintClassInformation(const Class& cls); | 144 static void PrintClassInformation(const Class& cls); |
145 static void CollectInterfaces(const Class& cls, | 145 static void CollectInterfaces(const Class& cls, |
146 const GrowableObjectArray& interfaces); | 146 const GrowableObjectArray& interfaces); |
147 static void ReportMalformedType(const Error& prev_error, | 147 static void ReportMalformedType(const Error& prev_error, |
148 const Class& cls, | 148 const Script& script, |
149 const Type& type, | 149 const Type& type, |
150 const char* format, | 150 const char* format, |
151 va_list args); | 151 va_list args); |
152 static void ReportError(const Error& error); | 152 static void ReportError(const Error& error); |
153 static void ReportError(const Error& prev_error, | 153 static void ReportError(const Error& prev_error, |
154 const Script& script, | 154 const Script& script, |
155 intptr_t token_index, | 155 intptr_t token_index, |
156 const char* format, ...) PRINTF_ATTRIBUTE(4, 5); | 156 const char* format, ...) PRINTF_ATTRIBUTE(4, 5); |
157 static void ReportError(const char* format, ...) PRINTF_ATTRIBUTE(1, 2); | 157 static void ReportError(const char* format, ...) PRINTF_ATTRIBUTE(1, 2); |
158 | 158 |
159 // Verify implicit offsets recorded in the VM for direct access to fields of | 159 // Verify implicit offsets recorded in the VM for direct access to fields of |
160 // Dart instances (e.g: _TypedListView, _ByteDataView). | 160 // Dart instances (e.g: _TypedListView, _ByteDataView). |
161 static void VerifyImplicitFieldOffsets(); | 161 static void VerifyImplicitFieldOffsets(); |
162 }; | 162 }; |
163 | 163 |
164 } // namespace dart | 164 } // namespace dart |
165 | 165 |
166 #endif // VM_CLASS_FINALIZER_H_ | 166 #endif // VM_CLASS_FINALIZER_H_ |
OLD | NEW |