15#if !defined(DART_PRECOMPILED_RUNTIME)
33#if !defined(DART_PRECOMPILED_RUNTIME)
34#define MAKE_PROPERTIES(CamelName, name) \
35 {ObjectStore::k##CamelName, "dart:" #name},
47 FATAL(
"Error in class finalization during bootstrapping.");
62 for (intptr_t
i = 0;
i < fields.
Length(); ++
i) {
63 field ^= fields.
At(
i);
69 field ^= fields.
At(fields.
Length() - 1);
77 field ^= fields.
At(0);
80 field ^= fields.
At(1);
82 field ^= fields.
At(2);
84 field ^= fields.
At(3);
86 field ^= fields.
At(4);
88 field ^= fields.
At(5);
94 cls = object_store->null_class();
96 cls = object_store->bool_class();
98 cls = object_store->array_class();
100 cls = object_store->immutable_array_class();
102 cls = object_store->map_impl_class();
104 cls = object_store->const_map_impl_class();
106 cls = object_store->set_impl_class();
108 cls = object_store->const_set_impl_class();
114 std::unique_ptr<kernel::Program> program) {
117 if (setjmp(*jump.
Set()) == 0) {
122 if (isolate_group->obfuscate()) {
130 library = isolate_group->object_store()->bootstrap_library(
id);
137 isolate_group->object_store()->InitKnownObjects();
144 return Error::Cast(
result).ptr();
147 if (FLAG_precompiled_mode) {
160 const uint8_t* kernel_buffer,
161 intptr_t kernel_buffer_size) {
163 const char*
error =
nullptr;
165 kernel_buffer, kernel_buffer_size, &
error);
166 if (program ==
nullptr) {
167 const intptr_t kMessageBufferSize = 512;
168 char message_buffer[kMessageBufferSize];
170 "Can't load Kernel binary: %s.",
error);
175 if (program->is_single_program()) {
184 intptr_t subprogram_count = subprogram_file_starts.
length() - 1;
188 for (intptr_t
i = 0;
i < subprogram_count;
i++) {
189 intptr_t subprogram_start = subprogram_file_starts.
At(
i);
190 intptr_t subprogram_end = subprogram_file_starts.
At(
i + 1);
192 program->binary().ViewFromTo(subprogram_start, subprogram_end));
194 const char*
error =
nullptr;
195 std::unique_ptr<kernel::Program> subprogram =
197 if (subprogram ==
nullptr) {
198 FATAL(
"Failed to load kernel file: %s",
error);
200 ASSERT(subprogram->is_single_program());
214 if (load_result.IsError())
return load_result.ptr();
220 intptr_t kernel_buffer_size) {
233 lib = isolate_group->object_store()->bootstrap_library(
id);
236 lib = Library::NewLibraryHelper(uri,
false);
239 isolate_group->object_store()->set_bootstrap_library(
id, lib);
247 intptr_t kernel_buffer_size) {
#define ASSERT_EQUAL(expected, actual)
#define MAKE_PROPERTIES(CamelName, name)
ObjectPtr At(intptr_t index) const
const T & At(intptr_t index) const
static ErrorPtr DoBootstrapping(const uint8_t *kernel_buffer, intptr_t kernel_buffer_size)
static void SetupNativeResolver()
static bool ProcessPendingClasses()
ErrorPtr EnsureIsFinalized(Thread *thread) const
static intptr_t delayed_type_arguments_offset()
static intptr_t function_offset()
static intptr_t instantiator_type_arguments_offset()
static intptr_t function_type_arguments_offset()
static intptr_t hash_offset()
static intptr_t context_offset()
const char * UserVisibleNameCString() const
void set_is_unboxed(bool b) const
intptr_t HostOffset() const
void RecordStore(const Object &value) const
ObjectStore * object_store() const
void Register(Thread *thread) const
void SetLoadRequested() const
static LibraryPtr LookupLibrary(Thread *thread, const String &url)
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
static StringPtr New(Thread *thread, const char *cstr)
static Thread * Current()
DART_WARN_UNUSED_RESULT ErrorPtr StealStickyError()
IsolateGroup * isolate_group() const
static int SNPrint(char *str, size_t size, const char *format,...) PRINTF_ATTRIBUTE(3
static void index_programs(kernel::Reader *reader, GrowableArray< intptr_t > *subprogram_file_starts)
void LoadLibrary(const Library &library)
void ReadObfuscationProhibitions()
ObjectPtr LoadProgram(bool process_pending_classes=true)
static std::unique_ptr< Program > ReadFromBuffer(const uint8_t *buffer, intptr_t buffer_length, const char **error=nullptr)
static std::unique_ptr< Program > ReadFrom(Reader *reader, const char **error=nullptr)
const uint8_t uint32_t uint32_t GError ** error
#define HANDLESCOPE(thread)
static void Finish(Thread *thread)
static const BootstrapLibProps bootstrap_libraries[]
static ErrorPtr BootstrapFromKernel(Thread *thread, const uint8_t *kernel_buffer, intptr_t kernel_buffer_size)
static constexpr intptr_t kBootstrapLibraryCount
static ErrorPtr BootstrapFromKernelSingleProgram(Thread *thread, std::unique_ptr< kernel::Program > program)
#define FOR_EACH_BOOTSTRAP_LIBRARY(M)
ObjectStore::BootstrapLibraryId index
#define ARRAY_SIZE(array)