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

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: 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 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 } 1227 }
1228 } 1228 }
1229 } 1229 }
1230 1230
1231 1231
1232 // Copy the type parameters of the super and mixin classes to the 1232 // Copy the type parameters of the super and mixin classes to the
1233 // mixin application class. Change type arguments of super type and of 1233 // mixin application class. Change type arguments of super type and of
1234 // interfaces to refer to the respective type parameters of the mixin 1234 // interfaces to refer to the respective type parameters of the mixin
1235 // application class. 1235 // application class.
1236 void ClassFinalizer::CloneTypeParameters(const Class& mixapp_class) { 1236 void ClassFinalizer::CloneTypeParameters(const Class& mixapp_class) {
1237 ASSERT(mixapp_class.NumTypeParameters() == 0); 1237 if (mixapp_class.NumTypeParameters() != 0) {
rmacnak 2013/08/15 22:29:06 This isn't right.
1238 // Mixin applications created by typedef can introduce their own type
1239 // paramaters.
regis 2013/08/15 22:51:48 parameters
1240 return;
regis 2013/08/15 22:51:48 Mmm, nothing to clone? I have to think about this.
1241 }
1238 1242
1239 const AbstractType& super_type = 1243 const AbstractType& super_type =
1240 AbstractType::Handle(mixapp_class.super_type()); 1244 AbstractType::Handle(mixapp_class.super_type());
1241 ASSERT(super_type.IsResolved()); 1245 ASSERT(super_type.IsResolved());
1242 const Class& super_class = Class::Handle(super_type.type_class()); 1246 const Class& super_class = Class::Handle(super_type.type_class());
1243 const Type& mixin_type = Type::Handle(mixapp_class.mixin()); 1247 const Type& mixin_type = Type::Handle(mixapp_class.mixin());
1244 const Class& mixin_class = Class::Handle(mixin_type.type_class()); 1248 const Class& mixin_class = Class::Handle(mixin_type.type_class());
1245 const int num_super_parameters = super_class.NumTypeParameters(); 1249 const int num_super_parameters = super_class.NumTypeParameters();
1246 const int num_mixin_parameters = mixin_class.NumTypeParameters(); 1250 const int num_mixin_parameters = mixin_class.NumTypeParameters();
1247 if ((num_super_parameters + num_mixin_parameters) == 0) { 1251 if ((num_super_parameters + num_mixin_parameters) == 0) {
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
2245 expected_name ^= String::New("_offset"); 2249 expected_name ^= String::New("_offset");
2246 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); 2250 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name));
2247 field ^= fields_array.At(2); 2251 field ^= fields_array.At(2);
2248 ASSERT(field.Offset() == TypedDataView::length_offset()); 2252 ASSERT(field.Offset() == TypedDataView::length_offset());
2249 name ^= field.name(); 2253 name ^= field.name();
2250 ASSERT(name.Equals("length")); 2254 ASSERT(name.Equals("length"));
2251 #endif 2255 #endif
2252 } 2256 }
2253 2257
2254 } // namespace dart 2258 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698