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

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

Issue 23190003: ClassMirror.mixin (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 7 years, 4 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 | Annotate | Revision Log
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/flags.h" 7 #include "vm/flags.h"
8 #include "vm/heap.h" 8 #include "vm/heap.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 } 1290 }
1291 } 1291 }
1292 } 1292 }
1293 1293
1294 1294
1295 // Copy the type parameters of the super and mixin classes to the 1295 // Copy the type parameters of the super and mixin classes to the
1296 // mixin application class. Change type arguments of super type and of 1296 // mixin application class. Change type arguments of super type and of
1297 // interfaces to refer to the respective type parameters of the mixin 1297 // interfaces to refer to the respective type parameters of the mixin
1298 // application class. 1298 // application class.
1299 void ClassFinalizer::CloneTypeParameters(const Class& mixapp_class) { 1299 void ClassFinalizer::CloneTypeParameters(const Class& mixapp_class) {
1300 ASSERT(mixapp_class.NumTypeParameters() == 0); 1300 if (mixapp_class.NumTypeParameters() != 0) {
1301 // Mixin applications created by typedef can introduce their own type
1302 // paramaters.
1303 return;
regis 2013/08/20 18:56:37 I think that returning here is actually correct if
1304 }
1301 1305
1302 const AbstractType& super_type = 1306 const AbstractType& super_type =
1303 AbstractType::Handle(mixapp_class.super_type()); 1307 AbstractType::Handle(mixapp_class.super_type());
1304 ASSERT(super_type.IsResolved()); 1308 ASSERT(super_type.IsResolved());
1305 const Class& super_class = Class::Handle(super_type.type_class()); 1309 const Class& super_class = Class::Handle(super_type.type_class());
1306 const Type& mixin_type = Type::Handle(mixapp_class.mixin()); 1310 const Type& mixin_type = Type::Handle(mixapp_class.mixin());
1307 const Class& mixin_class = Class::Handle(mixin_type.type_class()); 1311 const Class& mixin_class = Class::Handle(mixin_type.type_class());
1308 const int num_super_parameters = super_class.NumTypeParameters(); 1312 const int num_super_parameters = super_class.NumTypeParameters();
1309 const int num_mixin_parameters = mixin_class.NumTypeParameters(); 1313 const int num_mixin_parameters = mixin_class.NumTypeParameters();
1310 if ((num_super_parameters + num_mixin_parameters) == 0) { 1314 if ((num_super_parameters + num_mixin_parameters) == 0) {
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
2308 expected_name ^= String::New("_offset"); 2312 expected_name ^= String::New("_offset");
2309 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); 2313 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name));
2310 field ^= fields_array.At(2); 2314 field ^= fields_array.At(2);
2311 ASSERT(field.Offset() == TypedDataView::length_offset()); 2315 ASSERT(field.Offset() == TypedDataView::length_offset());
2312 name ^= field.name(); 2316 name ^= field.name();
2313 ASSERT(name.Equals("length")); 2317 ASSERT(name.Equals("length"));
2314 #endif 2318 #endif
2315 } 2319 }
2316 2320
2317 } // namespace dart 2321 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/parser.h » ('j') | runtime/vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698