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

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

Issue 994103002: Make sure the mixin class is finalized immediately (and not some time later) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | tests/language/regress_22719_test.dart » ('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 2080 matching lines...) Expand 10 before | Expand all | Expand 10 after
2091 } 2091 }
2092 } 2092 }
2093 2093
2094 2094
2095 void ClassFinalizer::ApplyMixinMembers(const Class& cls) { 2095 void ClassFinalizer::ApplyMixinMembers(const Class& cls) {
2096 Isolate* isolate = Isolate::Current(); 2096 Isolate* isolate = Isolate::Current();
2097 const Type& mixin_type = Type::Handle(isolate, cls.mixin()); 2097 const Type& mixin_type = Type::Handle(isolate, cls.mixin());
2098 ASSERT(!mixin_type.IsNull()); 2098 ASSERT(!mixin_type.IsNull());
2099 ASSERT(mixin_type.HasResolvedTypeClass()); 2099 ASSERT(mixin_type.HasResolvedTypeClass());
2100 const Class& mixin_cls = Class::Handle(isolate, mixin_type.type_class()); 2100 const Class& mixin_cls = Class::Handle(isolate, mixin_type.type_class());
2101 const Error& error = Error::Handle(mixin_cls.EnsureIsFinalized(isolate)); 2101 FinalizeClass(mixin_cls);
2102 ASSERT(error.IsNull());
2103 // If the mixin is a mixin application alias class, there are no members to 2102 // If the mixin is a mixin application alias class, there are no members to
2104 // apply here. A new synthesized class representing the aliased mixin 2103 // apply here. A new synthesized class representing the aliased mixin
2105 // application class was inserted in the super chain of this mixin application 2104 // application class was inserted in the super chain of this mixin application
2106 // class. Members of the actual mixin class will be applied when visiting 2105 // class. Members of the actual mixin class will be applied when visiting
2107 // the mixin application class referring to the actual mixin. 2106 // the mixin application class referring to the actual mixin.
2108 ASSERT(!mixin_cls.is_mixin_app_alias() || 2107 ASSERT(!mixin_cls.is_mixin_app_alias() ||
2109 Class::Handle(isolate, cls.SuperClass()).IsMixinApplication()); 2108 Class::Handle(isolate, cls.SuperClass()).IsMixinApplication());
2110 // A default constructor will be created for the mixin app alias class. 2109 // A default constructor will be created for the mixin app alias class.
2111 2110
2112 if (FLAG_trace_class_finalization) { 2111 if (FLAG_trace_class_finalization) {
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
3160 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); 3159 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields());
3161 field ^= fields_array.At(0); 3160 field ^= fields_array.At(0);
3162 ASSERT(field.Offset() == ByteBuffer::data_offset()); 3161 ASSERT(field.Offset() == ByteBuffer::data_offset());
3163 name ^= field.name(); 3162 name ^= field.name();
3164 expected_name ^= String::New("_data"); 3163 expected_name ^= String::New("_data");
3165 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); 3164 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name));
3166 #endif 3165 #endif
3167 } 3166 }
3168 3167
3169 } // namespace dart 3168 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/regress_22719_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698