Flutter Engine
The Flutter Engine
Static Public Member Functions | List of all members
dart::Bootstrap Class Reference

#include <bootstrap.h>

Inheritance diagram for dart::Bootstrap:
dart::AllStatic

Static Public Member Functions

static ErrorPtr DoBootstrapping (const uint8_t *kernel_buffer, intptr_t kernel_buffer_size)
 
static void SetupNativeResolver ()
 
static bool IsBootstrapResolver (Dart_NativeEntryResolver resolver)
 

Detailed Description

Definition at line 19 of file bootstrap.h.

Member Function Documentation

◆ DoBootstrapping()

ErrorPtr dart::Bootstrap::DoBootstrapping ( const uint8_t *  kernel_buffer,
intptr_t  kernel_buffer_size 
)
static

Definition at line 219 of file bootstrap.cc.

220 {
221 Thread* thread = Thread::Current();
222 auto isolate_group = thread->isolate_group();
223 Zone* zone = thread->zone();
224 String& uri = String::Handle(zone);
225 Library& lib = Library::Handle(zone);
226
227 HANDLESCOPE(thread);
228
229 // Ensure there are library objects for all the bootstrap libraries.
230 for (intptr_t i = 0; i < kBootstrapLibraryCount; ++i) {
232 uri = Symbols::New(thread, bootstrap_libraries[i].uri);
233 lib = isolate_group->object_store()->bootstrap_library(id);
234 ASSERT(lib.ptr() == Library::LookupLibrary(thread, uri));
235 if (lib.IsNull()) {
236 lib = Library::NewLibraryHelper(uri, false);
237 lib.SetLoadRequested();
238 lib.Register(thread);
239 isolate_group->object_store()->set_bootstrap_library(id, lib);
240 }
241 }
242
243 return BootstrapFromKernel(thread, kernel_buffer, kernel_buffer_size);
244}
static LibraryPtr LookupLibrary(Thread *thread, const String &url)
Definition: object.cc:14599
static Object & Handle()
Definition: object.h:407
static StringPtr New(Thread *thread, const char *cstr)
Definition: symbols.h:723
static Thread * Current()
Definition: thread.h:362
#define ASSERT(E)
#define HANDLESCOPE(thread)
Definition: handles.h:321
static const BootstrapLibProps bootstrap_libraries[]
Definition: bootstrap.cc:37
static ErrorPtr BootstrapFromKernel(Thread *thread, const uint8_t *kernel_buffer, intptr_t kernel_buffer_size)
Definition: bootstrap.cc:159
static constexpr intptr_t kBootstrapLibraryCount
Definition: bootstrap.cc:42
ObjectStore::BootstrapLibraryId index
Definition: bootstrap.cc:27

◆ IsBootstrapResolver()

bool dart::Bootstrap::IsBootstrapResolver ( Dart_NativeEntryResolver  resolver)
static

Definition at line 166 of file bootstrap_natives.cc.

166 {
167 return resolver == BootstrapNatives::Lookup;
168}
static Dart_NativeFunction Lookup(Dart_Handle name, int argument_count, bool *auto_setup_scope)

◆ SetupNativeResolver()

void dart::Bootstrap::SetupNativeResolver ( )
static

Definition at line 91 of file bootstrap_natives.cc.

91 {
92 Library& library = Library::Handle();
93
95
96 Dart_FfiNativeResolver ffi_native_resolver =
98
100
101 library = Library::AsyncLibrary();
102 ASSERT(!library.IsNull());
103 library.set_native_entry_resolver(resolver);
104 library.set_native_entry_symbol_resolver(symbol_resolver);
105
106 library = Library::CollectionLibrary();
107 ASSERT(!library.IsNull());
108 library.set_native_entry_resolver(resolver);
109 library.set_native_entry_symbol_resolver(symbol_resolver);
110
111 library = Library::ConvertLibrary();
112 ASSERT(!library.IsNull());
113 library.set_native_entry_resolver(resolver);
114 library.set_native_entry_symbol_resolver(symbol_resolver);
115
116 library = Library::CoreLibrary();
117 ASSERT(!library.IsNull());
118 library.set_native_entry_resolver(resolver);
119 library.set_native_entry_symbol_resolver(symbol_resolver);
120
121 library = Library::DeveloperLibrary();
122 ASSERT(!library.IsNull());
123 library.set_native_entry_resolver(resolver);
124 library.set_native_entry_symbol_resolver(symbol_resolver);
125
126 library = Library::FfiLibrary();
127 ASSERT(!library.IsNull());
128 library.set_native_entry_resolver(resolver);
129 library.set_native_entry_symbol_resolver(symbol_resolver);
130 library.set_ffi_native_resolver(ffi_native_resolver);
131
132 library = Library::InternalLibrary();
133 ASSERT(!library.IsNull());
134 library.set_native_entry_resolver(resolver);
135 library.set_native_entry_symbol_resolver(symbol_resolver);
136 library.set_ffi_native_resolver(ffi_native_resolver);
137
138 library = Library::IsolateLibrary();
139 ASSERT(!library.IsNull());
140 library.set_native_entry_resolver(resolver);
141 library.set_native_entry_symbol_resolver(symbol_resolver);
142
143 library = Library::MathLibrary();
144 ASSERT(!library.IsNull());
145 library.set_native_entry_resolver(resolver);
146 library.set_native_entry_symbol_resolver(symbol_resolver);
147
148#if !defined(DART_PRECOMPILED_RUNTIME)
149 library = Library::MirrorsLibrary();
150 ASSERT(!library.IsNull());
151 library.set_native_entry_resolver(resolver);
152 library.set_native_entry_symbol_resolver(symbol_resolver);
153#endif
154
155 library = Library::TypedDataLibrary();
156 ASSERT(!library.IsNull());
157 library.set_native_entry_resolver(resolver);
158 library.set_native_entry_symbol_resolver(symbol_resolver);
159
160 library = Library::VMServiceLibrary();
161 ASSERT(!library.IsNull());
162 library.set_native_entry_resolver(resolver);
163 library.set_native_entry_symbol_resolver(symbol_resolver);
164}
static void * LookupFfiNative(const char *name, uintptr_t argument_count)
static const uint8_t * Symbol(Dart_NativeFunction nf)
static LibraryPtr CoreLibrary()
Definition: object.cc:14787
static LibraryPtr VMServiceLibrary()
Definition: object.cc:14829
static LibraryPtr MirrorsLibrary()
Definition: object.cc:14816
static LibraryPtr IsolateLibrary()
Definition: object.cc:14807
static LibraryPtr ConvertLibrary()
Definition: object.cc:14783
static LibraryPtr CollectionLibrary()
Definition: object.cc:14791
static LibraryPtr AsyncLibrary()
Definition: object.cc:14779
static LibraryPtr InternalLibrary()
Definition: object.cc:14803
static LibraryPtr FfiLibrary()
Definition: object.cc:14799
static LibraryPtr MathLibrary()
Definition: object.cc:14811
static LibraryPtr DeveloperLibrary()
Definition: object.cc:14795
static LibraryPtr TypedDataLibrary()
Definition: object.cc:14825
Dart_NativeFunction(* Dart_NativeEntryResolver)(Dart_Handle name, int num_of_arguments, bool *auto_setup_scope)
Definition: dart_api.h:3234
const uint8_t *(* Dart_NativeEntrySymbol)(Dart_NativeFunction nf)
Definition: dart_api.h:3255
void *(* Dart_FfiNativeResolver)(const char *name, uintptr_t args_n)
Definition: dart_api.h:3262

The documentation for this class was generated from the following files: