| Index: runtime/vm/class_finalizer.cc
|
| ===================================================================
|
| --- runtime/vm/class_finalizer.cc (revision 1948)
|
| +++ runtime/vm/class_finalizer.cc (working copy)
|
| @@ -119,7 +119,7 @@
|
| GrowableArray<const Class*>* collected) {
|
| const Array& interface_array = Array::ZoneHandle(cls.interfaces());
|
| for (intptr_t i = 0; i < interface_array.Length(); i++) {
|
| - Type& interface = Type::Handle();
|
| + AbstractType& interface = AbstractType::Handle();
|
| interface ^= interface_array.At(i);
|
| const Class& interface_class = Class::ZoneHandle(interface.type_class());
|
| collected->Add(&interface_class);
|
| @@ -292,7 +292,7 @@
|
| if (cls.is_finalized()) {
|
| return;
|
| }
|
| - Type& super_type = Type::Handle(cls.super_type());
|
| + AbstractType& super_type = AbstractType::Handle(cls.super_type());
|
| if (super_type.IsNull()) {
|
| return;
|
| }
|
| @@ -406,8 +406,8 @@
|
| }
|
| String& expected_type_name = String::Handle();
|
| String& actual_type_name = String::Handle();
|
| - Type& expected_type_extends = Type::Handle();
|
| - Type& actual_type_extends = Type::Handle();
|
| + AbstractType& expected_type_extends = AbstractType::Handle();
|
| + AbstractType& actual_type_extends = AbstractType::Handle();
|
| const Array& expected_type_names =
|
| Array::Handle(factory_signature_class.type_parameters());
|
| const Array& actual_type_names =
|
| @@ -443,7 +443,8 @@
|
|
|
| // TODO(regis): Now that we do not resolve type parameters anymore, we could
|
| // make this function void and resolve the type in place.
|
| -RawType* ClassFinalizer::ResolveType(const Class& cls, const Type& type) {
|
| +RawAbstractType* ClassFinalizer::ResolveType(
|
| + const Class& cls, const AbstractType& type) {
|
| if (type.IsResolved()) {
|
| return type.raw();
|
| }
|
| @@ -466,8 +467,8 @@
|
| Class::Handle(ResolveClass(cls, unresolved_class));
|
|
|
| // Replace unresolved class with resolved type class.
|
| - ASSERT(type.IsParameterizedType());
|
| - ParameterizedType& parameterized_type = ParameterizedType::Handle();
|
| + ASSERT(type.IsType());
|
| + Type& parameterized_type = Type::Handle();
|
| parameterized_type ^= type.raw();
|
| parameterized_type.set_type_class(Object::Handle(type_class.raw()));
|
| }
|
| @@ -476,7 +477,7 @@
|
| const TypeArguments& arguments = TypeArguments::Handle(type.arguments());
|
| if (!arguments.IsNull()) {
|
| intptr_t num_arguments = arguments.Length();
|
| - Type& type_argument = Type::Handle();
|
| + AbstractType& type_argument = AbstractType::Handle();
|
| for (intptr_t i = 0; i < num_arguments; i++) {
|
| type_argument = arguments.TypeAt(i);
|
| type_argument = ResolveType(cls, type_argument);
|
| @@ -504,7 +505,7 @@
|
| void ClassFinalizer::FinalizeTypeArguments(const Class& cls,
|
| const TypeArguments& arguments) {
|
| ASSERT(arguments.Length() >= cls.NumTypeArguments());
|
| - Type& super_type = Type::Handle(cls.super_type());
|
| + AbstractType& super_type = AbstractType::Handle(cls.super_type());
|
| if (!super_type.IsNull()) {
|
| super_type = FinalizeType(super_type);
|
| cls.set_super_type(super_type);
|
| @@ -515,7 +516,7 @@
|
| const intptr_t offset = super_class.NumTypeArguments();
|
| const intptr_t super_offset = offset - num_super_type_params;
|
| ASSERT(offset == (cls.NumTypeArguments() - cls.NumTypeParameters()));
|
| - Type& super_type_arg = Type::Handle();
|
| + AbstractType& super_type_arg = AbstractType::Handle();
|
| for (intptr_t i = 0; i < num_super_type_params; i++) {
|
| super_type_arg = super_type_args.TypeAt(super_offset + i);
|
| if (!super_type_arg.IsInstantiated()) {
|
| @@ -536,8 +537,8 @@
|
| ASSERT(arguments.Length() >= cls.NumTypeArguments());
|
| const intptr_t num_type_params = cls.NumTypeParameters();
|
| const intptr_t offset = cls.NumTypeArguments() - num_type_params;
|
| - Type& type = Type::Handle();
|
| - Type& type_extends = Type::Handle();
|
| + AbstractType& type = AbstractType::Handle();
|
| + AbstractType& type_extends = AbstractType::Handle();
|
| const TypeArguments& extends_array =
|
| TypeArguments::Handle(cls.type_parameter_extends());
|
| ASSERT((extends_array.IsNull() && (num_type_params == 0)) ||
|
| @@ -567,7 +568,7 @@
|
| }
|
| }
|
| }
|
| - Type& super_type = Type::Handle(cls.super_type());
|
| + AbstractType& super_type = AbstractType::Handle(cls.super_type());
|
| if (!super_type.IsNull()) {
|
| ASSERT(super_type.IsFinalized());
|
| const Class& super_class = Class::Handle(super_type.type_class());
|
| @@ -576,7 +577,7 @@
|
| }
|
|
|
|
|
| -RawType* ClassFinalizer::FinalizeType(const Type& type) {
|
| +RawAbstractType* ClassFinalizer::FinalizeType(const AbstractType& type) {
|
| ASSERT(type.IsResolved());
|
| if (type.IsFinalized()) {
|
| return type.raw();
|
| @@ -586,7 +587,7 @@
|
| }
|
|
|
| // At this point, we can only have a parameterized_type.
|
| - ParameterizedType& parameterized_type = ParameterizedType::Handle();
|
| + Type& parameterized_type = Type::Handle();
|
| parameterized_type ^= type.raw();
|
|
|
| if (parameterized_type.IsBeingFinalized()) {
|
| @@ -604,7 +605,7 @@
|
| if (!arguments.IsNull()) {
|
| intptr_t num_arguments = arguments.Length();
|
| for (intptr_t i = 0; i < num_arguments; i++) {
|
| - Type& type_argument = Type::Handle(arguments.TypeAt(i));
|
| + AbstractType& type_argument = AbstractType::Handle(arguments.TypeAt(i));
|
| type_argument = FinalizeType(type_argument);
|
| arguments.SetTypeAt(i, type_argument);
|
| }
|
| @@ -652,7 +653,7 @@
|
| // Copy the parsed type arguments at the correct offset in the full type
|
| // argument vector.
|
| const intptr_t offset = num_type_arguments - num_type_parameters;
|
| - Type& type = Type::Handle(Type::DynamicType());
|
| + AbstractType& type = AbstractType::Handle(Type::DynamicType());
|
| for (intptr_t i = 0; i < num_type_parameters; i++) {
|
| // If no type parameters were provided, a raw type is desired, so we
|
| // create a vector of DynamicType.
|
| @@ -687,15 +688,16 @@
|
| }
|
|
|
|
|
| -RawType* ClassFinalizer::FinalizeAndCanonicalizeType(const Type& type,
|
| - String* errmsg) {
|
| +RawAbstractType* ClassFinalizer::FinalizeAndCanonicalizeType(
|
| + const AbstractType& type, String* errmsg) {
|
| Isolate* isolate = Isolate::Current();
|
| ASSERT(isolate != NULL);
|
| LongJump* base = isolate->long_jump_base();
|
| LongJump jump;
|
| isolate->set_long_jump_base(&jump);
|
| if (setjmp(*jump.Set()) == 0) {
|
| - const Type& canonical_type = Type::Handle(FinalizeType(type));
|
| + const AbstractType& canonical_type =
|
| + AbstractType::Handle(FinalizeType(type));
|
| isolate->set_long_jump_base(base);
|
| *errmsg = String::null();
|
| return canonical_type.raw();
|
| @@ -713,7 +715,7 @@
|
| void ClassFinalizer::ResolveAndFinalizeSignature(const Class& cls,
|
| const Function& function) {
|
| // Resolve result type.
|
| - Type& type = Type::Handle(function.result_type());
|
| + AbstractType& type = AbstractType::Handle(function.result_type());
|
| if (!type.IsResolved()) {
|
| if (function.IsFactory()) {
|
| // The signature class of the factory for a generic class holds the type
|
| @@ -819,7 +821,7 @@
|
| // Resolve and finalize the upper bounds of the type parameters of class cls.
|
| void ClassFinalizer::ResolveAndFinalizeUpperBounds(const Class& cls) {
|
| const intptr_t num_type_params = cls.NumTypeParameters();
|
| - Type& type_extends = Type::Handle();
|
| + AbstractType& type_extends = AbstractType::Handle();
|
| const TypeArguments& extends_array =
|
| TypeArguments::Handle(cls.type_parameter_extends());
|
| ASSERT((extends_array.IsNull() && (num_type_params == 0)) ||
|
| @@ -849,7 +851,7 @@
|
| // Resolve type of fields and check for conflicts in super classes.
|
| Array& array = Array::Handle(cls.fields());
|
| Field& field = Field::Handle();
|
| - Type& type = Type::Handle();
|
| + AbstractType& type = AbstractType::Handle();
|
| String& name = String::Handle();
|
| Class& super_class = Class::Handle();
|
| intptr_t num_fields = array.Length();
|
| @@ -1002,7 +1004,7 @@
|
| }
|
| GrowableArray<const Class*> visited;
|
| ResolveInterfaces(cls, &visited);
|
| - Type& super_type = Type::Handle(cls.super_type());
|
| + AbstractType& super_type = AbstractType::Handle(cls.super_type());
|
| if (!super_type.IsNull()) {
|
| const Class& super_class = Class::Handle(super_type.type_class());
|
| // Finalize super class and super type.
|
| @@ -1025,7 +1027,7 @@
|
| }
|
| // Finalize interface types (but not necessarily interface classes).
|
| Array& interface_types = Array::Handle(cls.interfaces());
|
| - Type& interface_type = Type::Handle();
|
| + AbstractType& interface_type = AbstractType::Handle();
|
| for (intptr_t i = 0; i < interface_types.Length(); i++) {
|
| interface_type ^= interface_types.At(i);
|
| interface_type = FinalizeType(interface_type);
|
| @@ -1079,9 +1081,10 @@
|
| }
|
|
|
|
|
| -bool ClassFinalizer::AddInterfaceIfUnique(GrowableArray<Type*>* interface_list,
|
| - Type* interface,
|
| - Type* conflicting) {
|
| +bool ClassFinalizer::AddInterfaceIfUnique(
|
| + GrowableArray<AbstractType*>* interface_list,
|
| + AbstractType* interface,
|
| + AbstractType* conflicting) {
|
| String& interface_class_name = String::Handle(interface->ClassName());
|
| String& existing_interface_class_name = String::Handle();
|
| for (intptr_t i = 0; i < interface_list->length(); i++) {
|
| @@ -1150,7 +1153,7 @@
|
|
|
| // Resolve and check the interfaces of cls.
|
| visited->Add(&cls);
|
| - Type& interface = Type::Handle();
|
| + AbstractType& interface = AbstractType::Handle();
|
| for (intptr_t i = 0; i < super_interfaces.Length(); i++) {
|
| interface ^= super_interfaces.At(i);
|
| interface = ResolveType(cls, interface);
|
| @@ -1240,7 +1243,7 @@
|
| OS::Print(" (null library):\n");
|
| }
|
| const Array& interfaces_array = Array::Handle(cls.interfaces());
|
| - Type& interface = Type::Handle();
|
| + AbstractType& interface = AbstractType::Handle();
|
| intptr_t len = interfaces_array.Length();
|
| for (intptr_t i = 0; i < len; i++) {
|
| interface ^= interfaces_array.At(i);
|
|
|