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

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

Issue 1653593002: Relax assert when applying a mixin application alias (fixes #25617). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months 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
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #include "vm/class_finalizer.h" 5 #include "vm/class_finalizer.h"
6 6
7 #include "vm/code_generator.h" 7 #include "vm/code_generator.h"
8 #include "vm/flags.h" 8 #include "vm/flags.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 // class rather than to those of the mixin application alias class. 1956 // class rather than to those of the mixin application alias class.
1957 // This type parameter substitution is performed by an instantiation step. 1957 // This type parameter substitution is performed by an instantiation step.
1958 // It is important that the type parameters of the mixin application class 1958 // It is important that the type parameters of the mixin application class
1959 // are not finalized yet, because new type parameters may have been added 1959 // are not finalized yet, because new type parameters may have been added
1960 // to the super class. 1960 // to the super class.
1961 const Class& super_class = Class::Handle(zone, super_type.type_class()); 1961 const Class& super_class = Class::Handle(zone, super_type.type_class());
1962 ASSERT(mixin_app_class.SuperClass() == super_class.raw()); // Will change. 1962 ASSERT(mixin_app_class.SuperClass() == super_class.raw()); // Will change.
1963 const intptr_t num_super_type_params = super_class.NumTypeParameters(); 1963 const intptr_t num_super_type_params = super_class.NumTypeParameters();
1964 AbstractType& type = AbstractType::Handle(zone); 1964 AbstractType& type = AbstractType::Handle(zone);
1965 // The instantiator is mapping finalized type parameters of mixin_class to 1965 // The instantiator is mapping finalized type parameters of mixin_class to
1966 // unfinalized type parameters of mixin_app_class. 1966 // unfinalized type parameters of mixin_app_class. Therefore, the type
1967 ASSERT(aliased_mixin_type.IsFinalized()); 1967 // arguments of mixin_class_super_type must be finalized, since they get
1968 // instantiated by this instantiator. Finalizing the types in mixin_class
1969 // will finalize mixin_class_super_type.
1970 // The aliased_mixin_type does not need to be finalized, but only resolved.
1971 ASSERT(aliased_mixin_type.IsResolved());
1968 const Class& aliased_mixin_type_class = Class::Handle(zone, 1972 const Class& aliased_mixin_type_class = Class::Handle(zone,
1969 aliased_mixin_type.type_class()); 1973 aliased_mixin_type.type_class());
1974 FinalizeTypesInClass(mixin_class);
1970 const intptr_t num_aliased_mixin_type_params = 1975 const intptr_t num_aliased_mixin_type_params =
1971 aliased_mixin_type_class.NumTypeParameters(); 1976 aliased_mixin_type_class.NumTypeParameters();
1972 ASSERT(inserted_class.NumTypeParameters() == 1977 ASSERT(inserted_class.NumTypeParameters() ==
1973 (num_super_type_params + num_aliased_mixin_type_params)); 1978 (num_super_type_params + num_aliased_mixin_type_params));
1974 const AbstractType& mixin_class_super_type = 1979 const AbstractType& mixin_class_super_type =
1975 AbstractType::Handle(zone, mixin_class.super_type()); 1980 AbstractType::Handle(zone, mixin_class.super_type());
1976 ASSERT(mixin_class_super_type.IsFinalized()); 1981 ASSERT(mixin_class_super_type.IsFinalized());
1977 // The aliased_mixin_type may be raw. 1982 // The aliased_mixin_type may be raw.
1978 const TypeArguments& mixin_class_super_type_args = 1983 const TypeArguments& mixin_class_super_type_args =
1979 TypeArguments::Handle(zone, mixin_class_super_type.arguments()); 1984 TypeArguments::Handle(zone, mixin_class_super_type.arguments());
(...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after
3283 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); 3288 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields());
3284 field ^= fields_array.At(0); 3289 field ^= fields_array.At(0);
3285 ASSERT(field.Offset() == ByteBuffer::data_offset()); 3290 ASSERT(field.Offset() == ByteBuffer::data_offset());
3286 name ^= field.name(); 3291 name ^= field.name();
3287 expected_name ^= String::New("_data"); 3292 expected_name ^= String::New("_data");
3288 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); 3293 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name));
3289 #endif 3294 #endif
3290 } 3295 }
3291 3296
3292 } // namespace dart 3297 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698