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 1905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1916 String& inserted_class_name = String::Handle(zone, mixin_app_class.Name()); | 1916 String& inserted_class_name = String::Handle(zone, mixin_app_class.Name()); |
1917 inserted_class_name = String::Concat(inserted_class_name, | 1917 inserted_class_name = String::Concat(inserted_class_name, |
1918 Symbols::Backtick()); | 1918 Symbols::Backtick()); |
1919 const Library& library = Library::Handle(zone, mixin_app_class.library()); | 1919 const Library& library = Library::Handle(zone, mixin_app_class.library()); |
1920 Class& inserted_class = Class::Handle(zone, | 1920 Class& inserted_class = Class::Handle(zone, |
1921 library.LookupLocalClass(inserted_class_name)); | 1921 library.LookupLocalClass(inserted_class_name)); |
1922 if (inserted_class.IsNull()) { | 1922 if (inserted_class.IsNull()) { |
1923 inserted_class_name = Symbols::New(thread, inserted_class_name); | 1923 inserted_class_name = Symbols::New(thread, inserted_class_name); |
1924 const Script& script = Script::Handle(zone, mixin_app_class.script()); | 1924 const Script& script = Script::Handle(zone, mixin_app_class.script()); |
1925 inserted_class = Class::New( | 1925 inserted_class = Class::New( |
1926 inserted_class_name, script, mixin_app_class.token_pos()); | 1926 library, inserted_class_name, script, mixin_app_class.token_pos()); |
1927 inserted_class.set_is_synthesized_class(); | 1927 inserted_class.set_is_synthesized_class(); |
1928 library.AddClass(inserted_class); | 1928 library.AddClass(inserted_class); |
1929 | 1929 |
1930 if (FLAG_trace_class_finalization) { | 1930 if (FLAG_trace_class_finalization) { |
1931 THR_Print("Creating mixin application alias %s\n", | 1931 THR_Print("Creating mixin application alias %s\n", |
1932 inserted_class.ToCString()); | 1932 inserted_class.ToCString()); |
1933 } | 1933 } |
1934 | 1934 |
1935 // The super type of the inserted class is identical to the super type of | 1935 // The super type of the inserted class is identical to the super type of |
1936 // this mixin application class, except that it must refer to the type | 1936 // this mixin application class, except that it must refer to the type |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2807 if (share_type_params) { | 2807 if (share_type_params) { |
2808 mixin_app_class_name = String::Concat(mixin_app_class_name, | 2808 mixin_app_class_name = String::Concat(mixin_app_class_name, |
2809 Symbols::Ampersand()); | 2809 Symbols::Ampersand()); |
2810 } | 2810 } |
2811 mixin_type_class_name = mixin_type.ClassName(); | 2811 mixin_type_class_name = mixin_type.ClassName(); |
2812 mixin_app_class_name = String::Concat(mixin_app_class_name, | 2812 mixin_app_class_name = String::Concat(mixin_app_class_name, |
2813 mixin_type_class_name); | 2813 mixin_type_class_name); |
2814 mixin_app_class = library.LookupLocalClass(mixin_app_class_name); | 2814 mixin_app_class = library.LookupLocalClass(mixin_app_class_name); |
2815 if (mixin_app_class.IsNull()) { | 2815 if (mixin_app_class.IsNull()) { |
2816 mixin_app_class_name = Symbols::New(thread, mixin_app_class_name); | 2816 mixin_app_class_name = Symbols::New(thread, mixin_app_class_name); |
2817 mixin_app_class = Class::New(mixin_app_class_name, | 2817 mixin_app_class = Class::New(library, |
| 2818 mixin_app_class_name, |
2818 script, | 2819 script, |
2819 mixin_type.token_pos()); | 2820 mixin_type.token_pos()); |
2820 mixin_app_class.set_super_type(mixin_super_type); | 2821 mixin_app_class.set_super_type(mixin_super_type); |
2821 mixin_type_class = mixin_type.type_class(); | 2822 mixin_type_class = mixin_type.type_class(); |
2822 const Type& generic_mixin_type = Type::Handle(zone, | 2823 const Type& generic_mixin_type = Type::Handle(zone, |
2823 Type::New(mixin_type_class, | 2824 Type::New(mixin_type_class, |
2824 Object::null_type_arguments(), | 2825 Object::null_type_arguments(), |
2825 mixin_type.token_pos())); | 2826 mixin_type.token_pos())); |
2826 mixin_app_class.set_mixin(generic_mixin_type); | 2827 mixin_app_class.set_mixin(generic_mixin_type); |
2827 // Add the mixin type to the list of interfaces that the mixin application | 2828 // Add the mixin type to the list of interfaces that the mixin application |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3320 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); | 3321 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); |
3321 field ^= fields_array.At(0); | 3322 field ^= fields_array.At(0); |
3322 ASSERT(field.Offset() == ByteBuffer::data_offset()); | 3323 ASSERT(field.Offset() == ByteBuffer::data_offset()); |
3323 name ^= field.name(); | 3324 name ^= field.name(); |
3324 expected_name ^= String::New("_data"); | 3325 expected_name ^= String::New("_data"); |
3325 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); | 3326 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
3326 #endif | 3327 #endif |
3327 } | 3328 } |
3328 | 3329 |
3329 } // namespace dart | 3330 } // namespace dart |
OLD | NEW |