Chromium Code Reviews| 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 24 matching lines...) Expand all Loading... | |
| 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 and canonicalize type while parsing class cls. |
| 45 // Set the error message on failure (to Error::null() if no error). | 45 static RawAbstractType* FinalizeType(const Class& cls, |
| 46 static RawAbstractType* FinalizeAndCanonicalizeType(const Class& cls, | 46 const AbstractType& type); |
|
siva
2012/02/06 18:13:08
Why not call it FinalizeAndCanonicalizeType ?
regis
2012/02/06 19:43:16
Not all types are canonicalized (e.g. ParameterTyp
| |
| 47 const AbstractType& type, | |
| 48 Error* error); | |
| 49 | 47 |
| 50 // Pending classes are classes that need to be finalized. | 48 // Pending classes are classes that need to be finalized. |
| 51 static void AddPendingClasses(const GrowableArray<const Class*>& classes); | 49 static void AddPendingClasses(const GrowableArray<const Class*>& classes); |
| 52 | 50 |
| 53 // Return false if we still have classes pending to be finalized. | 51 // Return false if we still have classes pending to be finalized. |
| 54 static bool AllClassesFinalized(); | 52 static bool AllClassesFinalized(); |
| 55 | 53 |
| 56 // Return whether class finalization failed. | 54 // Return whether class finalization failed. |
| 57 // The function returns true if the finalization was successful. | 55 // The function returns true if the finalization was successful. |
| 58 // If finalization fails, an error message is set in the sticky error field | 56 // 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); | 73 static void CheckForLegalConstClass(const Class& cls); |
| 76 static RawClass* ResolveClass(const Class& cls, | 74 static RawClass* ResolveClass(const Class& cls, |
| 77 const UnresolvedClass& unresolved_class); | 75 const UnresolvedClass& unresolved_class); |
| 78 static void ResolveSuperType(const Class& cls); | 76 static void ResolveSuperType(const Class& cls); |
| 79 static void ResolveDefaultClass(const Class& cls); | 77 static void ResolveDefaultClass(const Class& cls); |
| 80 static void ResolveInterfaces(const Class& cls, | 78 static void ResolveInterfaces(const Class& cls, |
| 81 GrowableArray<const Class*>* visited); | 79 GrowableArray<const Class*>* visited); |
| 82 static void FinalizeTypeArguments(const Class& cls, | 80 static void FinalizeTypeArguments(const Class& cls, |
| 83 const AbstractTypeArguments& arguments); | 81 const AbstractTypeArguments& arguments); |
| 84 static void ResolveType(const Class& cls, const AbstractType& type); | 82 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); | 83 static void ResolveAndFinalizeUpperBounds(const Class& cls); |
| 88 static void VerifyUpperBounds(const Class& cls, | 84 static void VerifyUpperBounds(const Class& cls, |
| 89 const AbstractTypeArguments& arguments); | 85 const AbstractTypeArguments& arguments); |
| 90 static void ResolveAndFinalizeSignature(const Class& cls, | 86 static void ResolveAndFinalizeSignature(const Class& cls, |
| 91 const Function& function); | 87 const Function& function); |
| 92 static void ResolveAndFinalizeMemberTypes(const Class& cls); | 88 static void ResolveAndFinalizeMemberTypes(const Class& cls); |
| 93 static void PrintClassInformation(const Class& cls); | 89 static void PrintClassInformation(const Class& cls); |
| 94 static void VerifyClassImplements(const Class& cls); | 90 static void VerifyClassImplements(const Class& cls); |
| 95 static void CollectInterfaces(const Class& cls, | 91 static void CollectInterfaces(const Class& cls, |
| 96 GrowableArray<const Class*>* interfaces); | 92 GrowableArray<const Class*>* interfaces); |
| 97 static void ReportError(const Script& script, | 93 static void ReportError(const Script& script, |
| 98 intptr_t token_index, | 94 intptr_t token_index, |
| 99 const char* format, ...); | 95 const char* format, ...); |
| 100 static void ReportError(const char* format, ...); | 96 static void ReportError(const char* format, ...); |
| 101 static void ReportWarning(const Script& script, | 97 static void ReportWarning(const Script& script, |
| 102 intptr_t token_index, | 98 intptr_t token_index, |
| 103 const char* format, ...); | 99 const char* format, ...); |
| 104 }; | 100 }; |
| 105 | 101 |
| 106 } // namespace dart | 102 } // namespace dart |
| 107 | 103 |
| 108 #endif // VM_CLASS_FINALIZER_H_ | 104 #endif // VM_CLASS_FINALIZER_H_ |
| OLD | NEW |