| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |