| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 const Library& lib) { | 670 const Library& lib) { |
| 671 ASSERT(public_class_name.Length() > 0); | 671 ASSERT(public_class_name.Length() > 0); |
| 672 ASSERT(public_class_name.CharAt(0) == '_'); | 672 ASSERT(public_class_name.CharAt(0) == '_'); |
| 673 String& str = String::Handle(); | 673 String& str = String::Handle(); |
| 674 str = lib.PrivateName(public_class_name); | 674 str = lib.PrivateName(public_class_name); |
| 675 cls.set_name(str); | 675 cls.set_name(str); |
| 676 lib.AddClass(cls); | 676 lib.AddClass(cls); |
| 677 } | 677 } |
| 678 | 678 |
| 679 | 679 |
| 680 #define LOAD_LIBRARY(name, raw_name) \ | |
| 681 url = Symbols::Dart##name().raw(); \ | |
| 682 lib = Library::LookupLibrary(url); \ | |
| 683 if (lib.IsNull()) { \ | |
| 684 lib = Library::NewLibraryHelper(url, true); \ | |
| 685 lib.Register(); \ | |
| 686 } \ | |
| 687 isolate->object_store()->set_##raw_name##_library(lib); \ | |
| 688 | |
| 689 #define INIT_LIBRARY(name, raw_name, has_patch) \ | |
| 690 LOAD_LIBRARY(name, raw_name) \ | |
| 691 script = Bootstrap::Load##name##Script(false); \ | |
| 692 error = Bootstrap::Compile(lib, script); \ | |
| 693 if (!error.IsNull()) { \ | |
| 694 return error.raw(); \ | |
| 695 } \ | |
| 696 if (has_patch) { \ | |
| 697 script = Bootstrap::Load##name##Script(true); \ | |
| 698 error = lib.Patch(script); \ | |
| 699 if (!error.IsNull()) { \ | |
| 700 return error.raw(); \ | |
| 701 } \ | |
| 702 } \ | |
| 703 | |
| 704 | |
| 705 RawError* Object::Init(Isolate* isolate) { | 680 RawError* Object::Init(Isolate* isolate) { |
| 706 TIMERSCOPE(time_bootstrap); | 681 TIMERSCOPE(time_bootstrap); |
| 707 ObjectStore* object_store = isolate->object_store(); | 682 ObjectStore* object_store = isolate->object_store(); |
| 708 | 683 |
| 709 Class& cls = Class::Handle(); | 684 Class& cls = Class::Handle(); |
| 710 Type& type = Type::Handle(); | 685 Type& type = Type::Handle(); |
| 711 Array& array = Array::Handle(); | 686 Array& array = Array::Handle(); |
| 712 String& url = String::Handle(); | |
| 713 Library& lib = Library::Handle(); | 687 Library& lib = Library::Handle(); |
| 714 Script& script = Script::Handle(); | |
| 715 Error& error = Error::Handle(); | |
| 716 | 688 |
| 717 // All RawArray fields will be initialized to an empty array, therefore | 689 // All RawArray fields will be initialized to an empty array, therefore |
| 718 // initialize array class first. | 690 // initialize array class first. |
| 719 cls = Class::New<Array>(); | 691 cls = Class::New<Array>(); |
| 720 object_store->set_array_class(cls); | 692 object_store->set_array_class(cls); |
| 721 | 693 |
| 722 // Array and ImmutableArray are the only VM classes that are parameterized. | 694 // Array and ImmutableArray are the only VM classes that are parameterized. |
| 723 // Since they are pre-finalized, CalculateFieldOffsets() is not called, so we | 695 // Since they are pre-finalized, CalculateFieldOffsets() is not called, so we |
| 724 // need to set the offset of their type_arguments_ field, which is explicitly | 696 // need to set the offset of their type_arguments_ field, which is explicitly |
| 725 // declared in RawArray. | 697 // declared in RawArray. |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 RegisterClass(cls, Symbols::StackTrace(), core_lib); | 808 RegisterClass(cls, Symbols::StackTrace(), core_lib); |
| 837 pending_classes.Add(cls, Heap::kOld); | 809 pending_classes.Add(cls, Heap::kOld); |
| 838 // Super type set below, after Object is allocated. | 810 // Super type set below, after Object is allocated. |
| 839 | 811 |
| 840 cls = Class::New<JSRegExp>(); | 812 cls = Class::New<JSRegExp>(); |
| 841 object_store->set_jsregexp_class(cls); | 813 object_store->set_jsregexp_class(cls); |
| 842 RegisterPrivateClass(cls, Symbols::JSSyntaxRegExp(), core_lib); | 814 RegisterPrivateClass(cls, Symbols::JSSyntaxRegExp(), core_lib); |
| 843 pending_classes.Add(cls, Heap::kOld); | 815 pending_classes.Add(cls, Heap::kOld); |
| 844 | 816 |
| 845 // Initialize the base interfaces used by the core VM classes. | 817 // Initialize the base interfaces used by the core VM classes. |
| 846 script = Bootstrap::LoadCoreScript(false); | |
| 847 | 818 |
| 848 // Allocate and initialize the pre-allocated classes in the core library. | 819 // Allocate and initialize the pre-allocated classes in the core library. |
| 820 // The script and token index of these pre-allocated classes is set up in |
| 821 // the parser when the corelib script is compiled (see |
| 822 // Parser::ParseClassDefinition). |
| 849 cls = Class::New<Instance>(kInstanceCid); | 823 cls = Class::New<Instance>(kInstanceCid); |
| 850 object_store->set_object_class(cls); | 824 object_store->set_object_class(cls); |
| 851 cls.set_name(Symbols::Object()); | 825 cls.set_name(Symbols::Object()); |
| 852 cls.set_script(script); | |
| 853 cls.set_is_prefinalized(); | 826 cls.set_is_prefinalized(); |
| 854 core_lib.AddClass(cls); | 827 core_lib.AddClass(cls); |
| 855 pending_classes.Add(cls, Heap::kOld); | 828 pending_classes.Add(cls, Heap::kOld); |
| 856 type = Type::NewNonParameterizedType(cls); | 829 type = Type::NewNonParameterizedType(cls); |
| 857 object_store->set_object_type(type); | 830 object_store->set_object_type(type); |
| 858 | 831 |
| 859 cls = object_store->type_class(); | 832 cls = object_store->type_class(); |
| 860 RegisterPrivateClass(cls, Symbols::Type(), core_lib); | 833 RegisterPrivateClass(cls, Symbols::Type(), core_lib); |
| 861 pending_classes.Add(cls, Heap::kOld); | 834 pending_classes.Add(cls, Heap::kOld); |
| 862 | 835 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 893 object_store->set_weak_property_class(cls); | 866 object_store->set_weak_property_class(cls); |
| 894 RegisterPrivateClass(cls, Symbols::_WeakProperty(), core_lib); | 867 RegisterPrivateClass(cls, Symbols::_WeakProperty(), core_lib); |
| 895 | 868 |
| 896 // Setup some default native field classes which can be extended for | 869 // Setup some default native field classes which can be extended for |
| 897 // specifying native fields in dart classes. | 870 // specifying native fields in dart classes. |
| 898 Library::InitNativeWrappersLibrary(isolate); | 871 Library::InitNativeWrappersLibrary(isolate); |
| 899 ASSERT(isolate->object_store()->native_wrappers_library() != Library::null()); | 872 ASSERT(isolate->object_store()->native_wrappers_library() != Library::null()); |
| 900 | 873 |
| 901 // Pre-register the typed_data library so the native class implementations | 874 // Pre-register the typed_data library so the native class implementations |
| 902 // can be hooked up before compiling it. | 875 // can be hooked up before compiling it. |
| 903 LOAD_LIBRARY(TypedData, typed_data); | 876 lib = Library::LookupLibrary(Symbols::DartTypedData()); |
| 877 if (lib.IsNull()) { |
| 878 lib = Library::NewLibraryHelper(Symbols::DartTypedData(), true); |
| 879 lib.Register(); |
| 880 isolate->object_store()->set_bootstrap_library(ObjectStore::kTypedData, |
| 881 lib); |
| 882 } |
| 904 ASSERT(!lib.IsNull()); | 883 ASSERT(!lib.IsNull()); |
| 905 ASSERT(lib.raw() == Library::TypedDataLibrary()); | 884 ASSERT(lib.raw() == Library::TypedDataLibrary()); |
| 906 const intptr_t typed_data_class_array_length = | 885 const intptr_t typed_data_class_array_length = |
| 907 RawObject::NumberOfTypedDataClasses(); | 886 RawObject::NumberOfTypedDataClasses(); |
| 908 Array& typed_data_classes = | 887 Array& typed_data_classes = |
| 909 Array::Handle(Array::New(typed_data_class_array_length)); | 888 Array::Handle(Array::New(typed_data_class_array_length)); |
| 910 int index = 0; | 889 int index = 0; |
| 911 #define REGISTER_TYPED_DATA_CLASS(clazz) \ | 890 #define REGISTER_TYPED_DATA_CLASS(clazz) \ |
| 912 cls = Class::NewTypedDataClass(kTypedData##clazz##Cid); \ | 891 cls = Class::NewTypedDataClass(kTypedData##clazz##Cid); \ |
| 913 index = kTypedData##clazz##Cid - kTypedDataInt8ArrayCid; \ | 892 index = kTypedData##clazz##Cid - kTypedDataInt8ArrayCid; \ |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 pending_classes.Add(cls, Heap::kOld); | 951 pending_classes.Add(cls, Heap::kOld); |
| 973 type = Type::NewNonParameterizedType(cls); | 952 type = Type::NewNonParameterizedType(cls); |
| 974 object_store->set_function_type(type); | 953 object_store->set_function_type(type); |
| 975 | 954 |
| 976 cls = Class::New<Number>(); | 955 cls = Class::New<Number>(); |
| 977 RegisterClass(cls, Symbols::Number(), core_lib); | 956 RegisterClass(cls, Symbols::Number(), core_lib); |
| 978 pending_classes.Add(cls, Heap::kOld); | 957 pending_classes.Add(cls, Heap::kOld); |
| 979 type = Type::NewNonParameterizedType(cls); | 958 type = Type::NewNonParameterizedType(cls); |
| 980 object_store->set_number_type(type); | 959 object_store->set_number_type(type); |
| 981 | 960 |
| 982 cls = Class::New<Instance>(Symbols::Int(), script, Scanner::kDummyTokenIndex); | 961 cls = Class::New<Instance>(kIllegalCid); |
| 983 RegisterClass(cls, Symbols::Int(), core_lib); | 962 RegisterClass(cls, Symbols::Int(), core_lib); |
| 984 pending_classes.Add(cls, Heap::kOld); | 963 pending_classes.Add(cls, Heap::kOld); |
| 985 type = Type::NewNonParameterizedType(cls); | 964 type = Type::NewNonParameterizedType(cls); |
| 986 object_store->set_int_type(type); | 965 object_store->set_int_type(type); |
| 987 | 966 |
| 988 cls = Class::New<Instance>(Symbols::Double(), | 967 cls = Class::New<Instance>(kIllegalCid); |
| 989 script, | |
| 990 Scanner::kDummyTokenIndex); | |
| 991 RegisterClass(cls, Symbols::Double(), core_lib); | 968 RegisterClass(cls, Symbols::Double(), core_lib); |
| 992 pending_classes.Add(cls, Heap::kOld); | 969 pending_classes.Add(cls, Heap::kOld); |
| 993 type = Type::NewNonParameterizedType(cls); | 970 type = Type::NewNonParameterizedType(cls); |
| 994 object_store->set_double_type(type); | 971 object_store->set_double_type(type); |
| 995 | 972 |
| 996 name = Symbols::New("String"); | 973 name = Symbols::New("String"); |
| 997 cls = Class::New<Instance>(name, script, Scanner::kDummyTokenIndex); | 974 cls = Class::New<Instance>(kIllegalCid); |
| 998 RegisterClass(cls, name, core_lib); | 975 RegisterClass(cls, name, core_lib); |
| 999 pending_classes.Add(cls, Heap::kOld); | 976 pending_classes.Add(cls, Heap::kOld); |
| 1000 type = Type::NewNonParameterizedType(cls); | 977 type = Type::NewNonParameterizedType(cls); |
| 1001 object_store->set_string_type(type); | 978 object_store->set_string_type(type); |
| 1002 | 979 |
| 1003 cls = Class::New<Instance>(Symbols::List(), | 980 cls = Class::New<Instance>(kIllegalCid); |
| 1004 script, | |
| 1005 Scanner::kDummyTokenIndex); | |
| 1006 RegisterClass(cls, Symbols::List(), core_lib); | 981 RegisterClass(cls, Symbols::List(), core_lib); |
| 1007 pending_classes.Add(cls, Heap::kOld); | 982 pending_classes.Add(cls, Heap::kOld); |
| 1008 object_store->set_list_class(cls); | 983 object_store->set_list_class(cls); |
| 1009 | 984 |
| 1010 cls = object_store->bool_class(); | 985 cls = object_store->bool_class(); |
| 1011 type = Type::NewNonParameterizedType(cls); | 986 type = Type::NewNonParameterizedType(cls); |
| 1012 object_store->set_bool_type(type); | 987 object_store->set_bool_type(type); |
| 1013 | 988 |
| 1014 cls = object_store->smi_class(); | 989 cls = object_store->smi_class(); |
| 1015 type = Type::NewNonParameterizedType(cls); | 990 type = Type::NewNonParameterizedType(cls); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1034 // The class 'dynamic' is registered in the class dictionary because its name | 1009 // The class 'dynamic' is registered in the class dictionary because its name |
| 1035 // is a built-in identifier, rather than a reserved keyword. Its name is not | 1010 // is a built-in identifier, rather than a reserved keyword. Its name is not |
| 1036 // heap allocated, because the class resides in the VM isolate. | 1011 // heap allocated, because the class resides in the VM isolate. |
| 1037 // The corresponding type, the "unknown type", is stored in the object store. | 1012 // The corresponding type, the "unknown type", is stored in the object store. |
| 1038 cls = dynamic_class(); | 1013 cls = dynamic_class(); |
| 1039 type = Type::NewNonParameterizedType(cls); | 1014 type = Type::NewNonParameterizedType(cls); |
| 1040 object_store->set_dynamic_type(type); | 1015 object_store->set_dynamic_type(type); |
| 1041 | 1016 |
| 1042 // Finish the initialization by compiling the bootstrap scripts containing the | 1017 // Finish the initialization by compiling the bootstrap scripts containing the |
| 1043 // base interfaces and the implementation of the internal classes. | 1018 // base interfaces and the implementation of the internal classes. |
| 1044 INIT_LIBRARY(Core, core, true); | 1019 const Error& error = Error::Handle(Bootstrap::LoadandCompileScripts()); |
| 1045 | 1020 if (!error.IsNull()) { |
| 1046 INIT_LIBRARY(Async, async, true); | 1021 return error.raw(); |
| 1047 INIT_LIBRARY(Collection, collection, true); | 1022 } |
| 1048 INIT_LIBRARY(CollectionDev, collection_dev, true); | |
| 1049 INIT_LIBRARY(Crypto, crypto, false); | |
| 1050 INIT_LIBRARY(Isolate, isolate, true); | |
| 1051 INIT_LIBRARY(Json, json, true); | |
| 1052 INIT_LIBRARY(Math, math, true); | |
| 1053 INIT_LIBRARY(Mirrors, mirrors, true); | |
| 1054 INIT_LIBRARY(TypedData, typed_data, true); | |
| 1055 INIT_LIBRARY(Utf, utf, false); | |
| 1056 INIT_LIBRARY(Uri, uri, false); | |
| 1057 | |
| 1058 Bootstrap::SetupNativeResolver(); | |
| 1059 | 1023 |
| 1060 // Remove the Object superclass cycle by setting the super type to null (not | 1024 // Remove the Object superclass cycle by setting the super type to null (not |
| 1061 // to the type of null). | 1025 // to the type of null). |
| 1062 cls = object_store->object_class(); | 1026 cls = object_store->object_class(); |
| 1063 cls.set_super_type(Type::Handle()); | 1027 cls.set_super_type(Type::Handle()); |
| 1064 | 1028 |
| 1065 ClassFinalizer::VerifyBootstrapClasses(); | 1029 ClassFinalizer::VerifyBootstrapClasses(); |
| 1066 MarkInvisibleFunctions(); | 1030 MarkInvisibleFunctions(); |
| 1067 | 1031 |
| 1068 // Set up the intrinsic state of all functions (core, math and scalar list). | 1032 // Set up the intrinsic state of all functions (core, math and scalar list). |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1833 result.raw_ptr()->state_bits_ = 0; | 1797 result.raw_ptr()->state_bits_ = 0; |
| 1834 result.raw_ptr()->type_arguments_field_offset_in_words_ = kNoTypeArguments; | 1798 result.raw_ptr()->type_arguments_field_offset_in_words_ = kNoTypeArguments; |
| 1835 result.raw_ptr()->num_native_fields_ = 0; | 1799 result.raw_ptr()->num_native_fields_ = 0; |
| 1836 result.raw_ptr()->token_pos_ = Scanner::kDummyTokenIndex; | 1800 result.raw_ptr()->token_pos_ = Scanner::kDummyTokenIndex; |
| 1837 result.InitEmptyFields(); | 1801 result.InitEmptyFields(); |
| 1838 Isolate::Current()->class_table()->Register(result); | 1802 Isolate::Current()->class_table()->Register(result); |
| 1839 return result.raw(); | 1803 return result.raw(); |
| 1840 } | 1804 } |
| 1841 | 1805 |
| 1842 | 1806 |
| 1843 template <class FakeInstance> | |
| 1844 RawClass* Class::New(const String& name, | 1807 RawClass* Class::New(const String& name, |
| 1845 const Script& script, | 1808 const Script& script, |
| 1846 intptr_t token_pos) { | 1809 intptr_t token_pos) { |
| 1847 Class& result = Class::Handle(New<FakeInstance>(kIllegalCid)); | 1810 Class& result = Class::Handle(New<Instance>(kIllegalCid)); |
| 1848 result.set_name(name); | 1811 result.set_name(name); |
| 1849 result.set_script(script); | 1812 result.set_script(script); |
| 1850 result.set_token_pos(token_pos); | 1813 result.set_token_pos(token_pos); |
| 1851 return result.raw(); | 1814 return result.raw(); |
| 1852 } | 1815 } |
| 1853 | 1816 |
| 1854 | 1817 |
| 1855 RawClass* Class::New(const String& name, | |
| 1856 const Script& script, | |
| 1857 intptr_t token_pos) { | |
| 1858 Class& result = Class::Handle(New<Instance>(name, script, token_pos)); | |
| 1859 return result.raw(); | |
| 1860 } | |
| 1861 | |
| 1862 | |
| 1863 RawClass* Class::NewSignatureClass(const String& name, | 1818 RawClass* Class::NewSignatureClass(const String& name, |
| 1864 const Function& signature_function, | 1819 const Function& signature_function, |
| 1865 const Script& script, | 1820 const Script& script, |
| 1866 intptr_t token_pos) { | 1821 intptr_t token_pos) { |
| 1867 const Class& result = Class::Handle(New<Instance>(name, script, token_pos)); | 1822 const Class& result = Class::Handle(New(name, script, token_pos)); |
| 1868 const Type& super_type = Type::Handle(Type::ObjectType()); | 1823 const Type& super_type = Type::Handle(Type::ObjectType()); |
| 1869 ASSERT(!super_type.IsNull()); | 1824 ASSERT(!super_type.IsNull()); |
| 1870 // Instances of a signature class can only be closures. | 1825 // Instances of a signature class can only be closures. |
| 1871 result.set_instance_size(Closure::InstanceSize()); | 1826 result.set_instance_size(Closure::InstanceSize()); |
| 1872 result.set_next_field_offset(Closure::InstanceSize()); | 1827 result.set_next_field_offset(Closure::InstanceSize()); |
| 1873 result.set_super_type(super_type); | 1828 result.set_super_type(super_type); |
| 1874 result.set_type_arguments_field_offset(Closure::type_arguments_offset()); | 1829 result.set_type_arguments_field_offset(Closure::type_arguments_offset()); |
| 1875 // Implements interface "Function". | 1830 // Implements interface "Function". |
| 1876 const Type& function_type = Type::Handle(Type::Function()); | 1831 const Type& function_type = Type::Handle(Type::Function()); |
| 1877 const Array& interfaces = Array::Handle(Array::New(1, Heap::kOld)); | 1832 const Array& interfaces = Array::Handle(Array::New(1, Heap::kOld)); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1912 } | 1867 } |
| 1913 set_is_prefinalized(); | 1868 set_is_prefinalized(); |
| 1914 } | 1869 } |
| 1915 | 1870 |
| 1916 | 1871 |
| 1917 RawClass* Class::NewNativeWrapper(const Library& library, | 1872 RawClass* Class::NewNativeWrapper(const Library& library, |
| 1918 const String& name, | 1873 const String& name, |
| 1919 int field_count) { | 1874 int field_count) { |
| 1920 Class& cls = Class::Handle(library.LookupClass(name)); | 1875 Class& cls = Class::Handle(library.LookupClass(name)); |
| 1921 if (cls.IsNull()) { | 1876 if (cls.IsNull()) { |
| 1922 cls = New<Instance>(name, Script::Handle(), Scanner::kDummyTokenIndex); | 1877 cls = New(name, Script::Handle(), Scanner::kDummyTokenIndex); |
| 1923 cls.SetFields(Object::empty_array()); | 1878 cls.SetFields(Object::empty_array()); |
| 1924 cls.SetFunctions(Object::empty_array()); | 1879 cls.SetFunctions(Object::empty_array()); |
| 1925 // Set super class to Object. | 1880 // Set super class to Object. |
| 1926 cls.set_super_type(Type::Handle(Type::ObjectType())); | 1881 cls.set_super_type(Type::Handle(Type::ObjectType())); |
| 1927 // Compute instance size. First word contains a pointer to a properly | 1882 // Compute instance size. First word contains a pointer to a properly |
| 1928 // sized typed array once the first native field has been set. | 1883 // sized typed array once the first native field has been set. |
| 1929 intptr_t instance_size = sizeof(RawObject) + kWordSize; | 1884 intptr_t instance_size = sizeof(RawObject) + kWordSize; |
| 1930 cls.set_instance_size(RoundedAllocationSize(instance_size)); | 1885 cls.set_instance_size(RoundedAllocationSize(instance_size)); |
| 1931 cls.set_next_field_offset(instance_size); | 1886 cls.set_next_field_offset(instance_size); |
| 1932 cls.set_num_native_fields(field_count); | 1887 cls.set_num_native_fields(field_count); |
| (...skipping 4505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6438 RawLibrary* Library::New(const String& url) { | 6393 RawLibrary* Library::New(const String& url) { |
| 6439 return NewLibraryHelper(url, false); | 6394 return NewLibraryHelper(url, false); |
| 6440 } | 6395 } |
| 6441 | 6396 |
| 6442 | 6397 |
| 6443 void Library::InitCoreLibrary(Isolate* isolate) { | 6398 void Library::InitCoreLibrary(Isolate* isolate) { |
| 6444 const String& core_lib_url = Symbols::DartCore(); | 6399 const String& core_lib_url = Symbols::DartCore(); |
| 6445 const Library& core_lib = | 6400 const Library& core_lib = |
| 6446 Library::Handle(Library::NewLibraryHelper(core_lib_url, false)); | 6401 Library::Handle(Library::NewLibraryHelper(core_lib_url, false)); |
| 6447 core_lib.Register(); | 6402 core_lib.Register(); |
| 6448 isolate->object_store()->set_core_library(core_lib); | 6403 isolate->object_store()->set_bootstrap_library(ObjectStore::kCore, core_lib); |
| 6449 isolate->object_store()->set_root_library(Library::Handle()); | 6404 isolate->object_store()->set_root_library(Library::Handle()); |
| 6450 | 6405 |
| 6451 // Hook up predefined classes without setting their library pointers. These | 6406 // Hook up predefined classes without setting their library pointers. These |
| 6452 // classes are coming from the VM isolate, and are shared between multiple | 6407 // classes are coming from the VM isolate, and are shared between multiple |
| 6453 // isolates so setting their library pointers would be wrong. | 6408 // isolates so setting their library pointers would be wrong. |
| 6454 const Class& cls = Class::Handle(Object::dynamic_class()); | 6409 const Class& cls = Class::Handle(Object::dynamic_class()); |
| 6455 core_lib.AddObject(cls, String::Handle(cls.Name())); | 6410 core_lib.AddObject(cls, String::Handle(cls.Name())); |
| 6456 } | 6411 } |
| 6457 | 6412 |
| 6458 | 6413 |
| (...skipping 6726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13185 } | 13140 } |
| 13186 return result.raw(); | 13141 return result.raw(); |
| 13187 } | 13142 } |
| 13188 | 13143 |
| 13189 | 13144 |
| 13190 const char* WeakProperty::ToCString() const { | 13145 const char* WeakProperty::ToCString() const { |
| 13191 return "_WeakProperty"; | 13146 return "_WeakProperty"; |
| 13192 } | 13147 } |
| 13193 | 13148 |
| 13194 } // namespace dart | 13149 } // namespace dart |
| OLD | NEW |