Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: runtime/vm/class_finalizer.h

Issue 8761011: Renaming type classes as discussed: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
11 namespace dart { 11 namespace dart {
12 12
13 class AbstractType;
13 class Class; 14 class Class;
14 class Function; 15 class Function;
16 class RawAbstractType;
15 class RawClass; 17 class RawClass;
16 class RawType;
17 class Script; 18 class Script;
18 class String; 19 class String;
19 class Type;
20 class TypeArguments; 20 class TypeArguments;
21 class UnresolvedClass; 21 class UnresolvedClass;
22 22
23 // Traverses all pending, unfinalized classes, validates and marks them as 23 // Traverses all pending, unfinalized classes, validates and marks them as
24 // finalized. 24 // finalized.
25 class ClassFinalizer : public AllStatic { 25 class ClassFinalizer : public AllStatic {
26 public: 26 public:
27 enum { 27 enum {
28 kGeneratingSnapshot = true, 28 kGeneratingSnapshot = true,
29 kNotGeneratingSnapshot = false 29 kNotGeneratingSnapshot = false
30 }; 30 };
31 31
32 // Add 'interface' to 'interface_list' if it is not already in the list and 32 // Add 'interface' to 'interface_list' if it is not already in the list and
33 // return true. Also return true if 'interface' is not added, because it is 33 // return true. Also return true if 'interface' is not added, because it is
34 // not unique, i.e. it is already in the list. 34 // not unique, i.e. it is already in the list.
35 // Return false if 'interface' conflicts with an interface already in the list 35 // Return false if 'interface' conflicts with an interface already in the list
36 // with the same class, but different type arguments. 36 // with the same class, but different type arguments.
37 // In the case of a conflict, set 'conflicting' to the existing interface. 37 // In the case of a conflict, set 'conflicting' to the existing interface.
38 static bool AddInterfaceIfUnique(GrowableArray<Type*>* interface_list, 38 static bool AddInterfaceIfUnique(GrowableArray<AbstractType*>* interface_list,
39 Type* interface, 39 AbstractType* interface,
40 Type* conflicting); 40 AbstractType* conflicting);
41 41
42 // Finalize and canonicalize type while parsing. 42 // Finalize and canonicalize type while parsing.
43 // Set the error message on failure (to String::null() if no error). 43 // Set the error message on failure (to String::null() if no error).
44 static RawType* FinalizeAndCanonicalizeType(const Type& type, String* errmsg); 44 static RawAbstractType* FinalizeAndCanonicalizeType(
45 const AbstractType& type, String* errmsg);
45 46
46 // Pending classes are classes that need to be finalized. 47 // Pending classes are classes that need to be finalized.
47 static void AddPendingClasses(const GrowableArray<const Class*>& classes); 48 static void AddPendingClasses(const GrowableArray<const Class*>& classes);
48 49
49 // Return false if we still have classes pending to be finalized. 50 // Return false if we still have classes pending to be finalized.
50 static bool AllClassesFinalized(); 51 static bool AllClassesFinalized();
51 52
52 // Return whether class finalization failed. 53 // Return whether class finalization failed.
53 // The function returns true if the finalization was successful. 54 // The function returns true if the finalization was successful.
54 // If finalization fails, an error message is set in the sticky error field 55 // If finalization fails, an error message is set in the sticky error field
(...skipping 15 matching lines...) Expand all
70 static bool IsSuperCycleFree(const Class& cls); 71 static bool IsSuperCycleFree(const Class& cls);
71 static void CheckForLegalConstClass(const Class& cls); 72 static void CheckForLegalConstClass(const Class& cls);
72 static RawClass* ResolveClass(const Class& cls, 73 static RawClass* ResolveClass(const Class& cls,
73 const UnresolvedClass& unresolved_class); 74 const UnresolvedClass& unresolved_class);
74 static void ResolveSuperType(const Class& cls); 75 static void ResolveSuperType(const Class& cls);
75 static void ResolveFactoryClass(const Class& cls); 76 static void ResolveFactoryClass(const Class& cls);
76 static void ResolveInterfaces(const Class& cls, 77 static void ResolveInterfaces(const Class& cls,
77 GrowableArray<const Class*>* visited); 78 GrowableArray<const Class*>* visited);
78 static void FinalizeTypeArguments(const Class& cls, 79 static void FinalizeTypeArguments(const Class& cls,
79 const TypeArguments& arguments); 80 const TypeArguments& arguments);
80 static RawType* ResolveType(const Class& cls, const Type& type); 81 static RawAbstractType* ResolveType(
81 static RawType* FinalizeType(const Type& type); 82 const Class& cls, const AbstractType& type);
83 static RawAbstractType* FinalizeType(const AbstractType& type);
82 static void ResolveAndFinalizeUpperBounds(const Class& cls); 84 static void ResolveAndFinalizeUpperBounds(const Class& cls);
83 static void VerifyUpperBounds(const Class& cls, 85 static void VerifyUpperBounds(const Class& cls,
84 const TypeArguments& arguments); 86 const TypeArguments& arguments);
85 static void ResolveAndFinalizeSignature(const Class& cls, 87 static void ResolveAndFinalizeSignature(const Class& cls,
86 const Function& function); 88 const Function& function);
87 static void ResolveAndFinalizeMemberTypes(const Class& cls); 89 static void ResolveAndFinalizeMemberTypes(const Class& cls);
88 static void PrintClassInformation(const Class& cls); 90 static void PrintClassInformation(const Class& cls);
89 static void VerifyClassImplements(const Class& cls); 91 static void VerifyClassImplements(const Class& cls);
90 static void CollectInterfaces(const Class& cls, 92 static void CollectInterfaces(const Class& cls,
91 GrowableArray<const Class*>* interfaces); 93 GrowableArray<const Class*>* interfaces);
92 static void ReportError(const Script& script, 94 static void ReportError(const Script& script,
93 intptr_t token_index, 95 intptr_t token_index,
94 const char* format, ...); 96 const char* format, ...);
95 static void ReportError(const char* format, ...); 97 static void ReportError(const char* format, ...);
96 static void ReportWarning(const Script& script, 98 static void ReportWarning(const Script& script,
97 intptr_t token_index, 99 intptr_t token_index,
98 const char* format, ...); 100 const char* format, ...);
99 }; 101 };
100 102
101 } // namespace dart 103 } // namespace dart
102 104
103 #endif // VM_CLASS_FINALIZER_H_ 105 #endif // VM_CLASS_FINALIZER_H_
OLDNEW
« no previous file with comments | « runtime/vm/ast_printer.cc ('k') | runtime/vm/class_finalizer.cc » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698