| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 // Finalize given type while parsing class cls. | 55 // Finalize given type while parsing class cls. |
| 56 // Also canonicalize type if applicable. | 56 // Also canonicalize type if applicable. |
| 57 static RawAbstractType* FinalizeType(const Class& cls, | 57 static RawAbstractType* FinalizeType(const Class& cls, |
| 58 const AbstractType& type, | 58 const AbstractType& type, |
| 59 FinalizationKind finalization); | 59 FinalizationKind finalization); |
| 60 | 60 |
| 61 // Replace the malformed type with Dynamic and, depending on the given type | 61 // Replace the malformed type with Dynamic and, depending on the given type |
| 62 // finalization mode and execution mode, mark the type as malformed or report | 62 // finalization mode and execution mode, mark the type as malformed or report |
| 63 // a compile time error. | 63 // a compile time error. Prepend prev_error if not null. |
| 64 static void FinalizeMalformedType(const Class& cls, | 64 static void FinalizeMalformedType(const Error& prev_error, |
| 65 const Class& cls, |
| 65 const Type& type, | 66 const Type& type, |
| 66 FinalizationKind finalization, | 67 FinalizationKind finalization, |
| 67 const char* format, ...); | 68 const char* format, ...); |
| 68 | 69 |
| 69 // Pending classes are classes that need to be finalized. | 70 // Pending classes are classes that need to be finalized. |
| 70 static void AddPendingClasses(const GrowableArray<const Class*>& classes); | 71 static void AddPendingClasses(const GrowableArray<const Class*>& classes); |
| 71 | 72 |
| 72 // Return false if we still have classes pending to be finalized. | 73 // Return false if we still have classes pending to be finalized. |
| 73 static bool AllClassesFinalized(); | 74 static bool AllClassesFinalized(); |
| 74 | 75 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 static void ReportError(const Error& error); | 116 static void ReportError(const Error& error); |
| 116 static void ReportError(const Script& script, | 117 static void ReportError(const Script& script, |
| 117 intptr_t token_index, | 118 intptr_t token_index, |
| 118 const char* format, ...); | 119 const char* format, ...); |
| 119 static void ReportError(const char* format, ...); | 120 static void ReportError(const char* format, ...); |
| 120 }; | 121 }; |
| 121 | 122 |
| 122 } // namespace dart | 123 } // namespace dart |
| 123 | 124 |
| 124 #endif // VM_CLASS_FINALIZER_H_ | 125 #endif // VM_CLASS_FINALIZER_H_ |
| OLD | NEW |