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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 const AbstractType& type, | 46 const AbstractType& type, |
47 FinalizationKind finalization); | 47 FinalizationKind finalization); |
48 | 48 |
49 // Replace the malformed type with Dynamic and, depending on the given type | 49 // Replace the malformed type with Dynamic and, depending on the given type |
50 // finalization mode and execution mode, mark the type as malformed or report | 50 // finalization mode and execution mode, mark the type as malformed or report |
51 // a compile time error. Prepend prev_error if not null. | 51 // a compile time error. Prepend prev_error if not null. |
52 static void FinalizeMalformedType(const Error& prev_error, | 52 static void FinalizeMalformedType(const Error& prev_error, |
53 const Class& cls, | 53 const Class& cls, |
54 const Type& type, | 54 const Type& type, |
55 FinalizationKind finalization, | 55 FinalizationKind finalization, |
56 const char* format, ...); | 56 const char* format, ...) |
| 57 PRINTF_ATTRIBUTE(5, 6); |
57 | 58 |
58 // Return false if we still have classes pending to be finalized. | 59 // Return false if we still have classes pending to be finalized. |
59 static bool AllClassesFinalized(); | 60 static bool AllClassesFinalized(); |
60 | 61 |
61 // Return whether class finalization failed. | 62 // Return whether class finalization failed. |
62 // The function returns true if the finalization was successful. | 63 // The function returns true if the finalization was successful. |
63 // If finalization fails, an error message is set in the sticky error field | 64 // If finalization fails, an error message is set in the sticky error field |
64 // in the object store. | 65 // in the object store. |
65 static bool FinalizePendingClasses(); | 66 static bool FinalizePendingClasses(); |
66 | 67 |
(...skipping 24 matching lines...) Expand all Loading... |
91 static void ResolveAndFinalizeUpperBounds(const Class& cls); | 92 static void ResolveAndFinalizeUpperBounds(const Class& cls); |
92 static void ResolveAndFinalizeSignature(const Class& cls, | 93 static void ResolveAndFinalizeSignature(const Class& cls, |
93 const Function& function); | 94 const Function& function); |
94 static void ResolveAndFinalizeMemberTypes(const Class& cls); | 95 static void ResolveAndFinalizeMemberTypes(const Class& cls); |
95 static void PrintClassInformation(const Class& cls); | 96 static void PrintClassInformation(const Class& cls); |
96 static void CollectInterfaces(const Class& cls, | 97 static void CollectInterfaces(const Class& cls, |
97 const GrowableObjectArray& interfaces); | 98 const GrowableObjectArray& interfaces); |
98 static void ReportError(const Error& error); | 99 static void ReportError(const Error& error); |
99 static void ReportError(const Script& script, | 100 static void ReportError(const Script& script, |
100 intptr_t token_index, | 101 intptr_t token_index, |
101 const char* format, ...); | 102 const char* format, ...) PRINTF_ATTRIBUTE(3, 4); |
102 static void ReportError(const char* format, ...); | 103 static void ReportError(const char* format, ...) PRINTF_ATTRIBUTE(1, 2); |
103 }; | 104 }; |
104 | 105 |
105 } // namespace dart | 106 } // namespace dart |
106 | 107 |
107 #endif // VM_CLASS_FINALIZER_H_ | 108 #endif // VM_CLASS_FINALIZER_H_ |
OLD | NEW |