Chromium Code Reviews| Index: runtime/vm/class_finalizer.h |
| =================================================================== |
| --- runtime/vm/class_finalizer.h (revision 4727) |
| +++ runtime/vm/class_finalizer.h (working copy) |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| @@ -41,11 +41,30 @@ |
| AbstractType* interface, |
| AbstractType* conflicting); |
| + enum TypeFinalization { |
|
srdjan
2012/02/29 00:15:54
Maybe FinalizationKind is a better name?
regis
2012/02/29 02:10:01
Renamed to FinalizationMode.
|
| + kIgnore, // Parsed type is ignored and replaced by Dynamic. |
| + kDoNotResolve, // Type resolution is postponed. |
| + kTryResolve, // Type resolution is attempted, but not required. |
| + kFinalize, // Type resolution and type finalization are required. |
| + // A malformed type is tolerated. |
| + kFinalizeWellFormed // Error-free resolution and finalization are required. |
|
hausner
2012/02/28 23:52:59
There is at least one place in the parser where yo
regis
2012/02/29 00:05:23
Done.
|
| + // A malformed type is not tolerated. |
| + }; |
| + |
| // Finalize given type while parsing class cls. |
| // Also canonicalize type if applicable. |
| static RawAbstractType* FinalizeType(const Class& cls, |
| - const AbstractType& type); |
| + const AbstractType& type, |
| + TypeFinalization finalization); |
| + // Replace the malformed type with Dynamic and, depending on the given type |
| + // finalization mode and execution mode, mark the type as malformed or report |
| + // a compile time error. |
| + static void FinalizeMalformedType(const Class& cls, |
| + const Type& type, |
| + TypeFinalization finalization, |
| + const char* format, ...); |
| + |
| // Pending classes are classes that need to be finalized. |
| static void AddPendingClasses(const GrowableArray<const Class*>& classes); |
| @@ -79,8 +98,11 @@ |
| static void ResolveInterfaces(const Class& cls, |
| GrowableArray<const Class*>* visited); |
| static void FinalizeTypeArguments(const Class& cls, |
| - const AbstractTypeArguments& arguments); |
| - static void ResolveType(const Class& cls, const AbstractType& type); |
| + const AbstractTypeArguments& arguments, |
| + TypeFinalization finalization); |
| + static void ResolveType(const Class& cls, |
| + const AbstractType& type, |
| + TypeFinalization finalization); |
| static void ResolveAndFinalizeUpperBounds(const Class& cls); |
| static void ResolveAndFinalizeSignature(const Class& cls, |
| const Function& function); |
| @@ -89,13 +111,11 @@ |
| static void VerifyClassImplements(const Class& cls); |
| static void CollectInterfaces(const Class& cls, |
| GrowableArray<const Class*>* interfaces); |
| + static void ReportError(const Error& error); |
| static void ReportError(const Script& script, |
| intptr_t token_index, |
| const char* format, ...); |
| static void ReportError(const char* format, ...); |
| - static void ReportWarning(const Script& script, |
| - intptr_t token_index, |
| - const char* format, ...); |
| }; |
| } // namespace dart |