1680 {
1682 Zone* zone = thread->zone();
1683 ASSERT(isolate_group == thread->isolate_group());
1685
1686#if defined(DART_PRECOMPILED_RUNTIME)
1687 const bool bootstrapping = false;
1688#else
1689 const bool is_kernel = (kernel_buffer != nullptr);
1690 const bool bootstrapping =
1692#endif
1693
1694 if (bootstrapping) {
1695#if !defined(DART_PRECOMPILED_RUNTIME)
1696
1697
1698
1699
1700 ObjectStore* object_store = isolate_group->object_store();
1701 SafepointWriteRwLocker ml(thread, isolate_group->program_lock());
1702
1709
1710
1711
1712 cls = Class::New<Array, RTN::Array>(isolate_group);
1714 object_store->set_array_class(cls);
1715
1716
1717
1718
1719
1720
1721
1724 cls.set_num_type_arguments_unsafe(1);
1725
1726
1727
1728 cls = Class::New<GrowableObjectArray, RTN::GrowableObjectArray>(
1729 isolate_group);
1730 object_store->set_growable_object_array_class(cls);
1731 cls.set_type_arguments_field_offset(
1734 cls.set_num_type_arguments_unsafe(1);
1735
1736
1737 const intptr_t kInitialCanonicalRegExpSize = 4;
1738 weak_array = HashTables::New<CanonicalRegExpSet>(
1740 object_store->set_regexp_table(weak_array);
1741
1742
1743 const intptr_t kInitialCanonicalTypeSize = 16;
1744 array = HashTables::New<CanonicalTypeSet>(kInitialCanonicalTypeSize,
1746 object_store->set_canonical_types(array);
1747
1748
1749 const intptr_t kInitialCanonicalFunctionTypeSize = 16;
1750 array = HashTables::New<CanonicalFunctionTypeSet>(
1751 kInitialCanonicalFunctionTypeSize,
Heap::kOld);
1752 object_store->set_canonical_function_types(array);
1753
1754
1755 const intptr_t kInitialCanonicalRecordTypeSize = 16;
1756 array = HashTables::New<CanonicalRecordTypeSet>(
1757 kInitialCanonicalRecordTypeSize,
Heap::kOld);
1758 object_store->set_canonical_record_types(array);
1759
1760
1761 const intptr_t kInitialCanonicalTypeParameterSize = 4;
1762 array = HashTables::New<CanonicalTypeParameterSet>(
1763 kInitialCanonicalTypeParameterSize,
Heap::kOld);
1764 object_store->set_canonical_type_parameters(array);
1765
1766
1767 const intptr_t kInitialCanonicalTypeArgumentsSize = 4;
1768 array = HashTables::New<CanonicalTypeArgumentsSet>(
1769 kInitialCanonicalTypeArgumentsSize,
Heap::kOld);
1770 object_store->set_canonical_type_arguments(array);
1771
1772
1773 const Class& type_cls =
1774 Class::Handle(zone, Class::New<Type, RTN::Type>(isolate_group));
1776 zone, Class::New<FunctionType, RTN::FunctionType>(isolate_group));
1778 zone, Class::New<RecordType, RTN::RecordType>(isolate_group));
1780 zone, Class::New<TypeParameter, RTN::TypeParameter>(isolate_group));
1782 zone, Class::New<LibraryPrefix, RTN::LibraryPrefix>(isolate_group));
1783
1784
1786 object_store->set_one_byte_string_class(cls);
1787
1788
1790 object_store->set_two_byte_string_class(cls);
1791
1792
1794
1795
1796 const GrowableObjectArray& libraries =
1798 object_store->set_libraries(libraries);
1799
1800
1802
1803
1805 ASSERT(!core_lib.IsNull());
1806
1807 const GrowableObjectArray& pending_classes =
1809 object_store->set_pending_classes(pending_classes);
1810
1811
1812
1813
1815 cls = object_store->array_class();
1816 RegisterPrivateClass(cls, Symbols::_List(), core_lib);
1817 pending_classes.Add(cls);
1818
1819
1820
1821
1822
1825 type.SetIsFinalized();
1827 object_store->set_array_type(
type);
1828
1829 cls = object_store->growable_object_array_class();
1830 RegisterPrivateClass(cls, Symbols::_GrowableList(), core_lib);
1831 pending_classes.Add(cls);
1832
1833 cls = Class::New<Array, RTN::Array>(kImmutableArrayCid, isolate_group);
1834 object_store->set_immutable_array_class(cls);
1837 cls.set_num_type_arguments_unsafe(1);
1838 ASSERT(object_store->immutable_array_class() !=
1839 object_store->array_class());
1840 cls.set_is_prefinalized();
1841 RegisterPrivateClass(cls, Symbols::_ImmutableList(), core_lib);
1842 pending_classes.Add(cls);
1843
1844 cls = object_store->one_byte_string_class();
1845 RegisterPrivateClass(cls, Symbols::OneByteString(), core_lib);
1846 pending_classes.Add(cls);
1847
1848 cls = object_store->two_byte_string_class();
1849 RegisterPrivateClass(cls, Symbols::TwoByteString(), core_lib);
1850 pending_classes.Add(cls);
1851
1852
1853
1856 if (isolate_lib.IsNull()) {
1857 isolate_lib = Library::NewLibraryHelper(Symbols::DartIsolate(), true);
1858 isolate_lib.SetLoadRequested();
1859 isolate_lib.Register(thread);
1860 }
1862 ASSERT(!isolate_lib.IsNull());
1864
1865 cls = Class::New<Capability, RTN::Capability>(isolate_group);
1866 RegisterPrivateClass(cls, Symbols::_Capability(), isolate_lib);
1867 pending_classes.Add(cls);
1868
1869 cls = Class::New<ReceivePort, RTN::ReceivePort>(isolate_group);
1870 RegisterPrivateClass(cls, Symbols::_RawReceivePort(), isolate_lib);
1871 pending_classes.Add(cls);
1872
1873 cls = Class::New<SendPort, RTN::SendPort>(isolate_group);
1874 RegisterPrivateClass(cls, Symbols::_SendPort(), isolate_lib);
1875 pending_classes.Add(cls);
1876
1877 cls = Class::New<TransferableTypedData, RTN::TransferableTypedData>(
1878 isolate_group);
1879 RegisterPrivateClass(cls, Symbols::_TransferableTypedDataImpl(),
1880 isolate_lib);
1881 pending_classes.Add(cls);
1882
1884 zone, Class::New<StackTrace, RTN::StackTrace>(isolate_group));
1885 RegisterPrivateClass(stacktrace_cls, Symbols::_StackTrace(), core_lib);
1886 pending_classes.Add(stacktrace_cls);
1887
1888
1889 cls = Class::New<RegExp, RTN::RegExp>(isolate_group);
1890 RegisterPrivateClass(cls, Symbols::_RegExp(), core_lib);
1891 pending_classes.Add(cls);
1892
1893
1894
1895
1896
1897
1898 cls = Class::New<Instance, RTN::Instance>(kInstanceCid, isolate_group);
1899 object_store->set_object_class(cls);
1900 cls.set_name(Symbols::Object());
1901 cls.set_num_type_arguments_unsafe(0);
1902 cls.set_is_prefinalized();
1903 cls.set_is_const();
1904 core_lib.AddClass(cls);
1905 pending_classes.Add(cls);
1908 object_store->set_object_type(
type);
1911 object_store->set_non_nullable_object_type(
type);
1914 object_store->set_nullable_object_type(
type);
1915
1916 cls = Class::New<Bool, RTN::Bool>(isolate_group);
1917 object_store->set_bool_class(cls);
1918 RegisterClass(cls, Symbols::Bool(), core_lib);
1919 pending_classes.Add(cls);
1920
1921 cls = Class::New<Instance, RTN::Instance>(
kNullCid, isolate_group);
1922 object_store->set_null_class(cls);
1923 cls.set_num_type_arguments_unsafe(0);
1924 cls.set_is_prefinalized();
1926 pending_classes.Add(cls);
1927
1928 cls = Class::New<Instance, RTN::Instance>(
kNeverCid, isolate_group);
1929 cls.set_num_type_arguments_unsafe(0);
1930 cls.set_is_allocate_finalized();
1931 cls.set_is_declaration_loaded();
1932 cls.set_is_type_finalized();
1933 cls.set_name(Symbols::Never());
1934 object_store->set_never_class(cls);
1935
1936 ASSERT(!library_prefix_cls.IsNull());
1937 RegisterPrivateClass(library_prefix_cls, Symbols::_LibraryPrefix(),
1938 core_lib);
1939 pending_classes.Add(library_prefix_cls);
1940
1941 RegisterPrivateClass(type_cls, Symbols::_Type(), core_lib);
1942 pending_classes.Add(type_cls);
1943
1944 RegisterPrivateClass(function_type_cls, Symbols::_FunctionType(), core_lib);
1945 pending_classes.Add(function_type_cls);
1946
1947 RegisterPrivateClass(record_type_cls, Symbols::_RecordType(), core_lib);
1948 pending_classes.Add(record_type_cls);
1949
1950 RegisterPrivateClass(type_parameter_cls, Symbols::_TypeParameter(),
1951 core_lib);
1952 pending_classes.Add(type_parameter_cls);
1953
1954 cls = Class::New<Integer, RTN::Integer>(isolate_group);
1955 object_store->set_integer_implementation_class(cls);
1956 RegisterPrivateClass(cls, Symbols::_IntegerImplementation(), core_lib);
1957 pending_classes.Add(cls);
1958
1959 cls = Class::New<Smi, RTN::Smi>(isolate_group);
1960 object_store->set_smi_class(cls);
1961 RegisterPrivateClass(cls, Symbols::_Smi(), core_lib);
1962 pending_classes.Add(cls);
1963
1964 cls = Class::New<Mint, RTN::Mint>(isolate_group);
1965 object_store->set_mint_class(cls);
1966 RegisterPrivateClass(cls, Symbols::_Mint(), core_lib);
1967 pending_classes.Add(cls);
1968
1969 cls = Class::New<Double, RTN::Double>(isolate_group);
1970 object_store->set_double_class(cls);
1971 RegisterPrivateClass(cls, Symbols::_Double(), core_lib);
1972 pending_classes.Add(cls);
1973
1974
1975 cls = Class::New<Closure, RTN::Closure>(isolate_group);
1976 object_store->set_closure_class(cls);
1977 RegisterPrivateClass(cls, Symbols::_Closure(), core_lib);
1978 pending_classes.Add(cls);
1979
1980 cls = Class::New<Record, RTN::Record>(isolate_group);
1981 RegisterPrivateClass(cls, Symbols::_Record(), core_lib);
1982 pending_classes.Add(cls);
1983
1984 cls = Class::New<WeakProperty, RTN::WeakProperty>(isolate_group);
1985 object_store->set_weak_property_class(cls);
1986 RegisterPrivateClass(cls, Symbols::_WeakProperty(), core_lib);
1987
1988 cls = Class::New<WeakReference, RTN::WeakReference>(isolate_group);
1989 cls.set_type_arguments_field_offset(
1992 cls.set_num_type_arguments_unsafe(1);
1993 object_store->set_weak_reference_class(cls);
1994 RegisterPrivateClass(cls, Symbols::_WeakReference(), core_lib);
1995
1996
1997
1999 if (lib.IsNull()) {
2000 lib = Library::NewLibraryHelper(Symbols::DartMirrors(), true);
2001 lib.SetLoadRequested();
2002 lib.Register(thread);
2003 }
2004 object_store->set_bootstrap_library(ObjectStore::kMirrors, lib);
2007
2008 cls = Class::New<MirrorReference, RTN::MirrorReference>(isolate_group);
2009 RegisterPrivateClass(cls, Symbols::_MirrorReference(), lib);
2010
2011
2012
2014 if (lib.IsNull()) {
2015 lib = Library::NewLibraryHelper(Symbols::DartCollection(), true);
2016 lib.SetLoadRequested();
2017 lib.Register(thread);
2018 }
2019
2020 object_store->set_bootstrap_library(ObjectStore::kCollection, lib);
2023 cls = Class::New<Map, RTN::Map>(isolate_group);
2024 object_store->set_map_impl_class(cls);
2027 cls.set_num_type_arguments_unsafe(2);
2028 RegisterPrivateClass(cls, Symbols::_Map(), lib);
2029 pending_classes.Add(cls);
2030
2031 cls = Class::New<Map, RTN::Map>(kConstMapCid, isolate_group);
2032 object_store->set_const_map_impl_class(cls);
2035 cls.set_num_type_arguments_unsafe(2);
2036 cls.set_is_prefinalized();
2037 RegisterPrivateClass(cls, Symbols::_ConstMap(), lib);
2038 pending_classes.Add(cls);
2039
2040 cls = Class::New<Set, RTN::Set>(isolate_group);
2041 object_store->set_set_impl_class(cls);
2044 cls.set_num_type_arguments_unsafe(1);
2045 RegisterPrivateClass(cls, Symbols::_Set(), lib);
2046 pending_classes.Add(cls);
2047
2048 cls = Class::New<Set, RTN::Set>(kConstSetCid, isolate_group);
2049 object_store->set_const_set_impl_class(cls);
2052 cls.set_num_type_arguments_unsafe(1);
2053 cls.set_is_prefinalized();
2054 RegisterPrivateClass(cls, Symbols::_ConstSet(), lib);
2055 pending_classes.Add(cls);
2056
2057
2058
2060 if (lib.IsNull()) {
2061 lib = Library::NewLibraryHelper(Symbols::DartAsync(), true);
2062 lib.SetLoadRequested();
2063 lib.Register(thread);
2064 }
2065 object_store->set_bootstrap_library(ObjectStore::kAsync, lib);
2068 cls = Class::New<FutureOr, RTN::FutureOr>(isolate_group);
2071 cls.set_num_type_arguments_unsafe(1);
2072 RegisterClass(cls, Symbols::FutureOr(), lib);
2073 pending_classes.Add(cls);
2074 object_store->set_future_or_class(cls);
2075
2076 cls = Class::New<SuspendState, RTN::SuspendState>(isolate_group);
2077 RegisterPrivateClass(cls, Symbols::_SuspendState(), lib);
2078 pending_classes.Add(cls);
2079
2080
2081
2083 if (lib.IsNull()) {
2084 lib = Library::NewLibraryHelper(Symbols::DartDeveloper(), true);
2085 lib.SetLoadRequested();
2086 lib.Register(thread);
2087 }
2088 object_store->set_bootstrap_library(ObjectStore::kDeveloper, lib);
2091 cls = Class::New<UserTag, RTN::UserTag>(isolate_group);
2092 RegisterPrivateClass(cls, Symbols::_UserTag(), lib);
2093 pending_classes.Add(cls);
2094
2095
2096
2099
2100
2101
2103 if (lib.IsNull()) {
2104 lib = Library::NewLibraryHelper(Symbols::DartTypedData(), true);
2105 lib.SetLoadRequested();
2106 lib.Register(thread);
2107 }
2108 object_store->set_bootstrap_library(ObjectStore::kTypedData, lib);
2111#define REGISTER_TYPED_DATA_CLASS(clazz) \
2112 cls = Class::NewTypedDataClass(kTypedData##clazz##ArrayCid, isolate_group); \
2113 RegisterPrivateClass(cls, Symbols::_##clazz##List(), lib);
2114
2116#undef REGISTER_TYPED_DATA_CLASS
2117#define REGISTER_TYPED_DATA_VIEW_CLASS(clazz) \
2118 cls = \
2119 Class::NewTypedDataViewClass(kTypedData##clazz##ViewCid, isolate_group); \
2120 RegisterPrivateClass(cls, Symbols::_##clazz##View(), lib); \
2121 pending_classes.Add(cls); \
2122 cls = Class::NewUnmodifiableTypedDataViewClass( \
2123 kUnmodifiableTypedData##clazz##ViewCid, isolate_group); \
2124 RegisterPrivateClass(cls, Symbols::_Unmodifiable##clazz##View(), lib); \
2125 pending_classes.Add(cls);
2126
2128
2130 RegisterPrivateClass(cls, Symbols::_ByteDataView(), lib);
2131 pending_classes.Add(cls);
2133 isolate_group);
2134 RegisterPrivateClass(cls, Symbols::_UnmodifiableByteDataView(), lib);
2135 pending_classes.Add(cls);
2136
2137#undef REGISTER_TYPED_DATA_VIEW_CLASS
2138#define REGISTER_EXT_TYPED_DATA_CLASS(clazz) \
2139 cls = Class::NewExternalTypedDataClass(kExternalTypedData##clazz##Cid, \
2140 isolate_group); \
2141 RegisterPrivateClass(cls, Symbols::_External##clazz(), lib);
2142
2143 cls = Class::New<Instance, RTN::Instance>(
kByteBufferCid, isolate_group,
2144 false);
2145 cls.set_instance_size(0, 0);
2147 isolate_group->class_table()->Register(cls);
2148 RegisterPrivateClass(cls, Symbols::_ByteBuffer(), lib);
2149 pending_classes.Add(cls);
2150
2152#undef REGISTER_EXT_TYPED_DATA_CLASS
2153
2154 cls = Class::New<Float32x4, RTN::Float32x4>(isolate_group);
2155 RegisterPrivateClass(cls, Symbols::_Float32x4(), lib);
2156 pending_classes.Add(cls);
2157 object_store->set_float32x4_class(cls);
2158
2159 cls = Class::New<Instance, RTN::Instance>(
kIllegalCid, isolate_group,
2160 true,
2161 true);
2162 RegisterClass(cls, Symbols::Float32x4(), lib);
2163 cls.set_num_type_arguments_unsafe(0);
2164 cls.set_is_prefinalized();
2166 object_store->set_float32x4_type(
type);
2167
2168 cls = Class::New<Int32x4, RTN::Int32x4>(isolate_group);
2169 RegisterPrivateClass(cls, Symbols::_Int32x4(), lib);
2170 pending_classes.Add(cls);
2171 object_store->set_int32x4_class(cls);
2172
2173 cls = Class::New<Instance, RTN::Instance>(
kIllegalCid, isolate_group,
2174 true,
2175 true);
2176 RegisterClass(cls, Symbols::Int32x4(), lib);
2177 cls.set_num_type_arguments_unsafe(0);
2178 cls.set_is_prefinalized();
2180 object_store->set_int32x4_type(
type);
2181
2182 cls = Class::New<Float64x2, RTN::Float64x2>(isolate_group);
2183 RegisterPrivateClass(cls, Symbols::_Float64x2(), lib);
2184 pending_classes.Add(cls);
2185 object_store->set_float64x2_class(cls);
2186
2187 cls = Class::New<Instance, RTN::Instance>(
kIllegalCid, isolate_group,
2188 true,
2189 true);
2190 RegisterClass(cls, Symbols::Float64x2(), lib);
2191 cls.set_num_type_arguments_unsafe(0);
2192 cls.set_is_prefinalized();
2194 object_store->set_float64x2_type(
type);
2195
2196
2197
2198 type = object_store->object_type();
2199 stacktrace_cls.set_super_type(
type);
2200
2201
2202
2203 cls = Class::New<Instance, RTN::Instance>(
kIllegalCid, isolate_group,
2204 true,
2205 true);
2206 cls.set_num_type_arguments_unsafe(0);
2207 cls.set_is_prefinalized();
2209 pending_classes.Add(cls);
2211 object_store->set_type_type(
type);
2212
2213
2214 cls = Class::New<Instance, RTN::Instance>(
kIllegalCid, isolate_group,
2215 true,
2216 true);
2217 cls.set_num_type_arguments_unsafe(0);
2218 cls.set_is_prefinalized();
2219 RegisterClass(cls, Symbols::Function(), core_lib);
2220 pending_classes.Add(cls);
2222 object_store->set_function_type(
type);
2223
2224
2225 cls = Class::New<Instance, RTN::Instance>(
kIllegalCid, isolate_group,
2226 true,
2227 true);
2228 RegisterClass(cls, Symbols::Record(), core_lib);
2229 pending_classes.Add(cls);
2230 object_store->set_record_class(cls);
2231
2232 cls = Class::New<Number, RTN::Number>(isolate_group);
2233 RegisterClass(cls, Symbols::Number(), core_lib);
2234 pending_classes.Add(cls);
2236 object_store->set_number_type(
type);
2238 object_store->set_nullable_number_type(
type);
2239
2240 cls = Class::New<Instance, RTN::Instance>(
kIllegalCid, isolate_group,
2241 true,
2242 true);
2243 RegisterClass(cls, Symbols::Int(), core_lib);
2244 cls.set_num_type_arguments_unsafe(0);
2245 cls.set_is_prefinalized();
2246 pending_classes.Add(cls);
2248 object_store->set_int_type(
type);
2250 object_store->set_non_nullable_int_type(
type);
2252 object_store->set_nullable_int_type(
type);
2253
2254 cls = Class::New<Instance, RTN::Instance>(
kIllegalCid, isolate_group,
2255 true,
2256 true);
2257 RegisterClass(cls, Symbols::Double(), core_lib);
2258 cls.set_num_type_arguments_unsafe(0);
2259 cls.set_is_prefinalized();
2260 pending_classes.Add(cls);
2262 object_store->set_double_type(
type);
2264 object_store->set_nullable_double_type(
type);
2265
2266 name = Symbols::_String().ptr();
2267 cls = Class::New<Instance, RTN::Instance>(
kIllegalCid, isolate_group,
2268 true,
2269 true);
2270 RegisterClass(cls,
name, core_lib);
2271 cls.set_num_type_arguments_unsafe(0);
2272 cls.set_is_prefinalized();
2273 pending_classes.Add(cls);
2275 object_store->set_string_type(
type);
2276
2277 cls = object_store->bool_class();
2279 object_store->set_bool_type(
type);
2280
2281 cls = object_store->smi_class();
2283 object_store->set_smi_type(
type);
2284
2285 cls = object_store->mint_class();
2287 object_store->set_mint_type(
type);
2288
2289
2290
2291
2292
2293
2294
2295 cls = object_store->null_class();
2298 type.SetIsFinalized();
2300 object_store->set_null_type(
type);
2301 cls.set_declaration_type(
type);
2303
2304
2305 type = object_store->object_type();
2306 cls.set_super_type(
type);
2307
2308 cls = object_store->never_class();
2311 type.SetIsFinalized();
2313 object_store->set_never_type(
type);
2315 type_args.SetTypeAt(0,
type);
2316 type_args = type_args.Canonicalize(thread);
2317 object_store->set_type_argument_never(type_args);
2318
2319
2320
2322 type = object_store->int_type();
2323 type_args.SetTypeAt(0,
type);
2324 type_args = type_args.Canonicalize(thread);
2325 object_store->set_type_argument_int(type_args);
2326
2328 type = object_store->double_type();
2329 type_args.SetTypeAt(0,
type);
2330 type_args = type_args.Canonicalize(thread);
2331 object_store->set_type_argument_double(type_args);
2332
2334 type = object_store->string_type();
2335 type_args.SetTypeAt(0,
type);
2336 type_args = type_args.Canonicalize(thread);
2337 object_store->set_type_argument_string(type_args);
2338
2340 type = object_store->string_type();
2341 type_args.SetTypeAt(0,
type);
2342 type_args.SetTypeAt(1, Object::dynamic_type());
2343 type_args = type_args.Canonicalize(thread);
2344 object_store->set_type_argument_string_dynamic(type_args);
2345
2347 type = object_store->string_type();
2348 type_args.SetTypeAt(0,
type);
2349 type_args.SetTypeAt(1,
type);
2350 type_args = type_args.Canonicalize(thread);
2351 object_store->set_type_argument_string_string(type_args);
2352
2354 if (lib.IsNull()) {
2355 lib = Library::NewLibraryHelper(Symbols::DartFfi(), true);
2356 lib.SetLoadRequested();
2357 lib.Register(thread);
2358 }
2359 object_store->set_bootstrap_library(ObjectStore::kFfi, lib);
2360
2361 cls = Class::New<Instance, RTN::Instance>(kFfiNativeTypeCid, isolate_group);
2362 cls.set_num_type_arguments_unsafe(0);
2363 cls.set_is_prefinalized();
2364 pending_classes.Add(cls);
2365 object_store->set_ffi_native_type_class(cls);
2366 RegisterClass(cls, Symbols::FfiNativeType(), lib);
2367
2368#define REGISTER_FFI_TYPE_MARKER(clazz) \
2369 cls = Class::New<Instance, RTN::Instance>(kFfi##clazz##Cid, isolate_group); \
2370 cls.set_num_type_arguments_unsafe(0); \
2371 cls.set_is_prefinalized(); \
2372 pending_classes.Add(cls); \
2373 RegisterClass(cls, Symbols::Ffi##clazz(), lib);
2375#undef REGISTER_FFI_TYPE_MARKER
2376
2377 cls = Class::New<Instance, RTN::Instance>(kFfiNativeFunctionCid,
2378 isolate_group);
2381 cls.set_num_type_arguments_unsafe(1);
2382 cls.set_is_prefinalized();
2383 pending_classes.Add(cls);
2384 RegisterClass(cls, Symbols::FfiNativeFunction(), lib);
2385
2387 object_store->set_ffi_pointer_class(cls);
2388 pending_classes.Add(cls);
2389 RegisterClass(cls, Symbols::FfiPointer(), lib);
2390
2391 cls = Class::New<DynamicLibrary, RTN::DynamicLibrary>(kDynamicLibraryCid,
2392 isolate_group);
2396 cls.set_is_prefinalized();
2397 pending_classes.Add(cls);
2398 RegisterClass(cls, Symbols::FfiDynamicLibrary(), lib);
2399
2400 cls = Class::New<NativeFinalizer, RTN::NativeFinalizer>(isolate_group);
2401 object_store->set_native_finalizer_class(cls);
2402 RegisterPrivateClass(cls, Symbols::_NativeFinalizer(), lib);
2403
2404 cls = Class::New<Finalizer, RTN::Finalizer>(isolate_group);
2405 cls.set_type_arguments_field_offset(
2408 cls.set_num_type_arguments_unsafe(1);
2409 object_store->set_finalizer_class(cls);
2410 pending_classes.Add(cls);
2411 RegisterPrivateClass(cls, Symbols::_FinalizerImpl(), core_lib);
2412
2413
2414
2416 if (lib.IsNull()) {
2417 lib = Library::NewLibraryHelper(Symbols::DartInternal(), true);
2418 lib.SetLoadRequested();
2419 lib.Register(thread);
2420 }
2421 object_store->set_bootstrap_library(ObjectStore::kInternal, lib);
2424
2425 cls = Class::New<FinalizerEntry, RTN::FinalizerEntry>(isolate_group);
2426 object_store->set_finalizer_entry_class(cls);
2427 pending_classes.Add(cls);
2428 RegisterClass(cls, Symbols::FinalizerEntry(), lib);
2429
2430
2431
2434 if (!
error.IsNull()) {
2436 }
2437
2438 isolate_group->class_table()->CopySizesFromClassObjects();
2439
2441
2442
2444
2445
2448 cls = lib.LookupClassAllowPrivate(Symbols::ClassID());
2450 const bool injected = cls.InjectCIDFields();
2452
2453
2455#endif
2456 } else {
2457
2458
2459
2460 ObjectStore* object_store = isolate_group->object_store();
2461 SafepointWriteRwLocker ml(thread, isolate_group->program_lock());
2462
2464
2465
2466
2467
2468
2469
2470
2471 cls = Class::New<Instance, RTN::Instance>(kInstanceCid, isolate_group);
2472 object_store->set_object_class(cls);
2473
2474 cls = Class::New<LibraryPrefix, RTN::LibraryPrefix>(isolate_group);
2475 cls = Class::New<Type, RTN::Type>(isolate_group);
2476 cls = Class::New<FunctionType, RTN::FunctionType>(isolate_group);
2477 cls = Class::New<RecordType, RTN::RecordType>(isolate_group);
2478 cls = Class::New<TypeParameter, RTN::TypeParameter>(isolate_group);
2479
2480 cls = Class::New<Array, RTN::Array>(isolate_group);
2481 object_store->set_array_class(cls);
2482
2483 cls = Class::New<Array, RTN::Array>(kImmutableArrayCid, isolate_group);
2484 object_store->set_immutable_array_class(cls);
2485
2486 cls = Class::New<GrowableObjectArray, RTN::GrowableObjectArray>(
2487 isolate_group);
2488 object_store->set_growable_object_array_class(cls);
2489
2490 cls = Class::New<Map, RTN::Map>(isolate_group);
2491 object_store->set_map_impl_class(cls);
2492
2493 cls = Class::New<Map, RTN::Map>(kConstMapCid, isolate_group);
2494 object_store->set_const_map_impl_class(cls);
2495
2496 cls = Class::New<Set, RTN::Set>(isolate_group);
2497 object_store->set_set_impl_class(cls);
2498
2499 cls = Class::New<Set, RTN::Set>(kConstSetCid, isolate_group);
2500 object_store->set_const_set_impl_class(cls);
2501
2502 cls = Class::New<Float32x4, RTN::Float32x4>(isolate_group);
2503 object_store->set_float32x4_class(cls);
2504
2505 cls = Class::New<Int32x4, RTN::Int32x4>(isolate_group);
2506 object_store->set_int32x4_class(cls);
2507
2508 cls = Class::New<Float64x2, RTN::Float64x2>(isolate_group);
2509 object_store->set_float64x2_class(cls);
2510
2511#define REGISTER_TYPED_DATA_CLASS(clazz) \
2512 cls = Class::NewTypedDataClass(kTypedData##clazz##Cid, isolate_group);
2514#undef REGISTER_TYPED_DATA_CLASS
2515#define REGISTER_TYPED_DATA_VIEW_CLASS(clazz) \
2516 cls = \
2517 Class::NewTypedDataViewClass(kTypedData##clazz##ViewCid, isolate_group); \
2518 cls = Class::NewUnmodifiableTypedDataViewClass( \
2519 kUnmodifiableTypedData##clazz##ViewCid, isolate_group);
2521#undef REGISTER_TYPED_DATA_VIEW_CLASS
2524 isolate_group);
2525#define REGISTER_EXT_TYPED_DATA_CLASS(clazz) \
2526 cls = Class::NewExternalTypedDataClass(kExternalTypedData##clazz##Cid, \
2527 isolate_group);
2529#undef REGISTER_EXT_TYPED_DATA_CLASS
2530
2531 cls = Class::New<Instance, RTN::Instance>(kFfiNativeTypeCid, isolate_group);
2532 object_store->set_ffi_native_type_class(cls);
2533
2534#define REGISTER_FFI_CLASS(clazz) \
2535 cls = Class::New<Instance, RTN::Instance>(kFfi##clazz##Cid, isolate_group);
2537#undef REGISTER_FFI_CLASS
2538
2539 cls = Class::New<Instance, RTN::Instance>(kFfiNativeFunctionCid,
2540 isolate_group);
2541
2543 object_store->set_ffi_pointer_class(cls);
2544
2545 cls = Class::New<DynamicLibrary, RTN::DynamicLibrary>(kDynamicLibraryCid,
2546 isolate_group);
2547
2548 cls = Class::New<Instance, RTN::Instance>(
kByteBufferCid, isolate_group,
2549 false);
2550 cls.set_instance_size_in_words(0, 0);
2551 isolate_group->class_table()->Register(cls);
2552
2553 cls = Class::New<Integer, RTN::Integer>(isolate_group);
2554 object_store->set_integer_implementation_class(cls);
2555
2556 cls = Class::New<Smi, RTN::Smi>(isolate_group);
2557 object_store->set_smi_class(cls);
2558
2559 cls = Class::New<Mint, RTN::Mint>(isolate_group);
2560 object_store->set_mint_class(cls);
2561
2562 cls = Class::New<Double, RTN::Double>(isolate_group);
2563 object_store->set_double_class(cls);
2564
2565 cls = Class::New<Closure, RTN::Closure>(isolate_group);
2566 object_store->set_closure_class(cls);
2567
2568 cls = Class::New<Record, RTN::Record>(isolate_group);
2569
2571 object_store->set_one_byte_string_class(cls);
2572
2574 object_store->set_two_byte_string_class(cls);
2575
2576 cls = Class::New<Bool, RTN::Bool>(isolate_group);
2577 object_store->set_bool_class(cls);
2578
2579 cls = Class::New<Instance, RTN::Instance>(
kNullCid, isolate_group);
2580 object_store->set_null_class(cls);
2581
2582 cls = Class::New<Instance, RTN::Instance>(
kNeverCid, isolate_group);
2583 object_store->set_never_class(cls);
2584
2585 cls = Class::New<Capability, RTN::Capability>(isolate_group);
2586 cls = Class::New<ReceivePort, RTN::ReceivePort>(isolate_group);
2587 cls = Class::New<SendPort, RTN::SendPort>(isolate_group);
2588 cls = Class::New<StackTrace, RTN::StackTrace>(isolate_group);
2589 cls = Class::New<SuspendState, RTN::SuspendState>(isolate_group);
2590 cls = Class::New<RegExp, RTN::RegExp>(isolate_group);
2591 cls = Class::New<Number, RTN::Number>(isolate_group);
2592
2593 cls = Class::New<WeakProperty, RTN::WeakProperty>(isolate_group);
2594 object_store->set_weak_property_class(cls);
2595 cls = Class::New<WeakReference, RTN::WeakReference>(isolate_group);
2596 object_store->set_weak_reference_class(cls);
2597 cls = Class::New<Finalizer, RTN::Finalizer>(isolate_group);
2598 object_store->set_finalizer_class(cls);
2599 cls = Class::New<NativeFinalizer, RTN::NativeFinalizer>(isolate_group);
2600 object_store->set_native_finalizer_class(cls);
2601 cls = Class::New<FinalizerEntry, RTN::FinalizerEntry>(isolate_group);
2602 object_store->set_finalizer_entry_class(cls);
2603
2604 cls = Class::New<MirrorReference, RTN::MirrorReference>(isolate_group);
2605 cls = Class::New<UserTag, RTN::UserTag>(isolate_group);
2606 cls = Class::New<FutureOr, RTN::FutureOr>(isolate_group);
2607 object_store->set_future_or_class(cls);
2608 cls = Class::New<TransferableTypedData, RTN::TransferableTypedData>(
2609 isolate_group);
2610 }
2612}
#define CLASS_LIST_FFI_TYPE_MARKER(V)
#define CLASS_LIST_TYPED_DATA(V)
#define DART_CLASS_LIST_TYPED_DATA(V)
static ErrorPtr DoBootstrapping(const uint8_t *kernel_buffer, intptr_t kernel_buffer_size)
static void VerifyBootstrapClasses()
static ClassPtr NewTypedDataViewClass(intptr_t class_id, IsolateGroup *isolate_group)
static ClassPtr NewPointerClass(intptr_t class_id, IsolateGroup *isolate_group)
static ClassPtr NewUnmodifiableTypedDataViewClass(intptr_t class_id, IsolateGroup *isolate_group)
static Snapshot::Kind vm_snapshot_kind()
static intptr_t InstanceSize()
static intptr_t type_arguments_offset()
static intptr_t type_arguments_offset()
static GrowableObjectArrayPtr New(Heap::Space space=Heap::kNew)
static intptr_t NextFieldOffset()
static LibraryPtr CoreLibrary()
static LibraryPtr MirrorsLibrary()
static LibraryPtr IsolateLibrary()
static LibraryPtr CollectionLibrary()
static LibraryPtr AsyncLibrary()
static LibraryPtr LookupLibrary(Thread *thread, const String &url)
static LibraryPtr InternalLibrary()
static void InitNativeWrappersLibrary(IsolateGroup *isolate_group, bool is_kernel_file)
static void InitCoreLibrary(IsolateGroup *isolate_group)
static LibraryPtr DeveloperLibrary()
static LibraryPtr TypedDataLibrary()
static intptr_t type_arguments_offset()
static void InitializeState()
static void SetupSymbolTable(IsolateGroup *isolate_group)
static TypeArgumentsPtr New(intptr_t len, Heap::Space space=Heap::kOld)
static TypePtr NewNonParameterizedType(const Class &type_class)
static intptr_t type_arguments_offset()
static void InitializeState()
static word InstanceSize()
static word type_arguments_offset()
static word type_arguments_offset()
static word NextFieldOffset()
static word type_arguments_offset()
static word type_arguments_offset()
const uint8_t uint32_t uint32_t GError ** error
SK_API sk_sp< SkSurface > Null(int width, int height)
static constexpr intptr_t kWordSize
@ kUnmodifiableByteDataViewCid
#define TIMELINE_DURATION(thread, stream, name)
#define REGISTER_TYPED_DATA_CLASS(clazz)
#define REGISTER_FFI_CLASS(clazz)
#define REGISTER_EXT_TYPED_DATA_CLASS(clazz)
#define REGISTER_TYPED_DATA_VIEW_CLASS(clazz)
#define REGISTER_FFI_TYPE_MARKER(clazz)