OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 23 matching lines...) Expand all Loading... |
34 // Add 'interface' to 'interface_list' if it is not already in the list and | 34 // Add 'interface' to 'interface_list' if it is not already in the list and |
35 // return true. Also return true if 'interface' is not added, because it is | 35 // return true. Also return true if 'interface' is not added, because it is |
36 // not unique, i.e. it is already in the list. | 36 // not unique, i.e. it is already in the list. |
37 // Return false if 'interface' conflicts with an interface already in the list | 37 // Return false if 'interface' conflicts with an interface already in the list |
38 // with the same class, but different type arguments. | 38 // with the same class, but different type arguments. |
39 // In the case of a conflict, set 'conflicting' to the existing interface. | 39 // In the case of a conflict, set 'conflicting' to the existing interface. |
40 static bool AddInterfaceIfUnique(GrowableArray<AbstractType*>* interface_list, | 40 static bool AddInterfaceIfUnique(GrowableArray<AbstractType*>* interface_list, |
41 AbstractType* interface, | 41 AbstractType* interface, |
42 AbstractType* conflicting); | 42 AbstractType* conflicting); |
43 | 43 |
44 // Finalize and canonicalize type while parsing class cls. | 44 // Finalize given type while parsing class cls. |
45 // Set the error message on failure (to Error::null() if no error). | 45 // Also canonicalize type if applicable. |
46 static RawAbstractType* FinalizeAndCanonicalizeType(const Class& cls, | 46 static RawAbstractType* FinalizeType(const Class& cls, |
47 const AbstractType& type, | 47 const AbstractType& type); |
48 Error* error); | |
49 | 48 |
50 // Pending classes are classes that need to be finalized. | 49 // Pending classes are classes that need to be finalized. |
51 static void AddPendingClasses(const GrowableArray<const Class*>& classes); | 50 static void AddPendingClasses(const GrowableArray<const Class*>& classes); |
52 | 51 |
53 // Return false if we still have classes pending to be finalized. | 52 // Return false if we still have classes pending to be finalized. |
54 static bool AllClassesFinalized(); | 53 static bool AllClassesFinalized(); |
55 | 54 |
56 // Return whether class finalization failed. | 55 // Return whether class finalization failed. |
57 // The function returns true if the finalization was successful. | 56 // The function returns true if the finalization was successful. |
58 // If finalization fails, an error message is set in the sticky error field | 57 // If finalization fails, an error message is set in the sticky error field |
(...skipping 16 matching lines...) Expand all Loading... |
75 static void CheckForLegalConstClass(const Class& cls); | 74 static void CheckForLegalConstClass(const Class& cls); |
76 static RawClass* ResolveClass(const Class& cls, | 75 static RawClass* ResolveClass(const Class& cls, |
77 const UnresolvedClass& unresolved_class); | 76 const UnresolvedClass& unresolved_class); |
78 static void ResolveSuperType(const Class& cls); | 77 static void ResolveSuperType(const Class& cls); |
79 static void ResolveDefaultClass(const Class& cls); | 78 static void ResolveDefaultClass(const Class& cls); |
80 static void ResolveInterfaces(const Class& cls, | 79 static void ResolveInterfaces(const Class& cls, |
81 GrowableArray<const Class*>* visited); | 80 GrowableArray<const Class*>* visited); |
82 static void FinalizeTypeArguments(const Class& cls, | 81 static void FinalizeTypeArguments(const Class& cls, |
83 const AbstractTypeArguments& arguments); | 82 const AbstractTypeArguments& arguments); |
84 static void ResolveType(const Class& cls, const AbstractType& type); | 83 static void ResolveType(const Class& cls, const AbstractType& type); |
85 static RawAbstractType* FinalizeType(const Class& cls, | |
86 const AbstractType& type); | |
87 static void ResolveAndFinalizeUpperBounds(const Class& cls); | 84 static void ResolveAndFinalizeUpperBounds(const Class& cls); |
88 static void VerifyUpperBounds(const Class& cls, | 85 static void VerifyUpperBounds(const Class& cls, |
89 const AbstractTypeArguments& arguments); | 86 const AbstractTypeArguments& arguments); |
90 static void ResolveAndFinalizeSignature(const Class& cls, | 87 static void ResolveAndFinalizeSignature(const Class& cls, |
91 const Function& function); | 88 const Function& function); |
92 static void ResolveAndFinalizeMemberTypes(const Class& cls); | 89 static void ResolveAndFinalizeMemberTypes(const Class& cls); |
93 static void PrintClassInformation(const Class& cls); | 90 static void PrintClassInformation(const Class& cls); |
94 static void VerifyClassImplements(const Class& cls); | 91 static void VerifyClassImplements(const Class& cls); |
95 static void CollectInterfaces(const Class& cls, | 92 static void CollectInterfaces(const Class& cls, |
96 GrowableArray<const Class*>* interfaces); | 93 GrowableArray<const Class*>* interfaces); |
97 static void ReportError(const Script& script, | 94 static void ReportError(const Script& script, |
98 intptr_t token_index, | 95 intptr_t token_index, |
99 const char* format, ...); | 96 const char* format, ...); |
100 static void ReportError(const char* format, ...); | 97 static void ReportError(const char* format, ...); |
101 static void ReportWarning(const Script& script, | 98 static void ReportWarning(const Script& script, |
102 intptr_t token_index, | 99 intptr_t token_index, |
103 const char* format, ...); | 100 const char* format, ...); |
104 }; | 101 }; |
105 | 102 |
106 } // namespace dart | 103 } // namespace dart |
107 | 104 |
108 #endif // VM_CLASS_FINALIZER_H_ | 105 #endif // VM_CLASS_FINALIZER_H_ |
OLD | NEW |