20 ASSERT(visitor !=
nullptr);
27 for (
ObjectPtr* current = from(); current <= to(); current++) {
40 static const char*
const names[] = {
41#define EMIT_FIELD_NAME(type, name) #name "_",
47 while (current <= to()) {
69 return stack_trace.
ptr();
88 set_preallocated_stack_trace(preallocated_stack_trace);
91 preallocated_stack_trace)));
95 set_preallocated_unwind_error(preallocated_unwind_error);
115 for (
ObjectPtr* current = from(); current <= to(); current++) {
123 ASSERT(visitor !=
nullptr);
130#define DO(member, name) set_##member(StubCode::name());
142 static const char*
const names[] = {
143#define EMIT_FIELD_NAME(type, name) #name "_",
148#undef EMIT_FIELD_NAME
152 while (current <= to()) {
189 return Error::Cast(
result).ptr();
191 set_stack_overflow(Instance::Cast(
result));
195 return Error::Cast(
result).ptr();
197 set_out_of_memory(Instance::Cast(
result));
202FunctionPtr ObjectStore::PrivateObjectLookup(
const String&
name) {
222 set_set_impl_class(cls);
224#if defined(DART_PRECOMPILED_RUNTIME)
229 ASSERT(isolate_group !=
nullptr && isolate_group->object_store() ==
this);
235 set_future_class(cls);
245 set_async_star_stream_controller(cls);
249 set_async_star_stream_controller_add(
function);
253 set_async_star_stream_controller_add_stream(
function);
257 set_async_star_stream_controller_async_star_body(field);
263 for (intptr_t
i = 0;
i < functions.
Length();
i++) {
275 set_stream_class(cls);
284 set_suspend_state_init_async(
function);
292 set_suspend_state_await_with_type_check(
function);
296 set_suspend_state_return_async(
function);
300 set_suspend_state_return_async_not_future(
function);
304 set_suspend_state_init_async_star(
function);
308 set_suspend_state_yield_async_star(
function);
312 set_suspend_state_return_async_star(
function);
316 set_suspend_state_init_sync_star(
function);
320 set_suspend_state_suspend_sync_star_at_start(
function);
324 set_suspend_state_handle_exception(
function);
329 set_sync_star_iterator_class(cls);
333 set_sync_star_iterator_current(field);
337 set_sync_star_iterator_state(field);
341 set_sync_star_iterator_yield_star_iterable(field);
346 set_compiletime_error_class(cls);
350 set_pragma_class(cls);
358 growable_list_factory_ =
364 set_error_class(cls);
368 set_expando_class(cls);
372 set_iterable_class(cls);
375 simple_instance_of_function_ =
376 PrivateObjectLookup(Symbols::_simpleInstanceOf());
377 simple_instance_of_true_function_ =
378 PrivateObjectLookup(Symbols::_simpleInstanceOfTrue());
379 simple_instance_of_false_function_ =
380 PrivateObjectLookup(Symbols::_simpleInstanceOfFalse());
421void ObjectStore::LazyInitCoreMembers() {
434 auto*
const zone = thread->
zone();
440 list_class_.store(cls.
ptr());
444 non_nullable_list_rare_type_.store(
type.ptr());
448 map_class_.store(cls.
ptr());
451 non_nullable_map_rare_type_.store(
type.ptr());
455 set_class_.store(cls.
ptr());
466 enum_index_field_.store(field.ptr());
470 enum_name_field_.store(field.ptr());
476 _object_hash_code_function_.store(
function.ptr());
480 _object_equals_function_.store(
function.ptr());
484 _object_to_string_function_.store(
function.ptr());
488void ObjectStore::LazyInitAsyncMembers() {
490 SafepointWriteRwLocker locker(thread,
492 if (nullable_future_null_type_.load() ==
Type::null()) {
495 auto*
const zone = thread->
zone();
504 type_args.SetTypeAt(0,
type);
506 type.SetIsFinalized();
508 non_nullable_future_never_type_.store(
type.ptr());
513 type_args.SetTypeAt(0,
type);
515 type.SetIsFinalized();
517 nullable_future_null_type_.store(
type.ptr());
521void ObjectStore::LazyInitFfiMembers() {
523 SafepointWriteRwLocker locker(thread,
525 if (handle_finalizer_message_function_.load() ==
Function::null()) {
526 auto*
const zone = thread->
zone();
532 ASSERT(!ffi_lib.IsNull());
534 cls = finalizer_class();
541 handle_finalizer_message_function_.store(
function.ptr());
543 cls = native_finalizer_class();
548 Symbols::_handleNativeFinalizerMessage());
550 handle_native_finalizer_message_function_.store(
function.ptr());
552 cls = ffi_lib.LookupClass(Symbols::FfiNative());
559 ffi_resolver_function_.store(
function.ptr());
561 cls = ffi_lib.LookupClass(Symbols::VarArgs());
563 varargs_class_.store(cls.
ptr());
567void ObjectStore::LazyInitIsolateMembers() {
569 SafepointWriteRwLocker locker(thread,
571 if (lookup_port_handler_.load() ==
Type::null()) {
575 auto*
const zone = thread->
zone();
580 cls = isolate_lib.LookupClass(Symbols::Capability());
582 capability_class_.store(cls.
ptr());
584 cls = isolate_lib.LookupClass(Symbols::SendPort());
586 send_port_class_.store(cls.
ptr());
588 cls = isolate_lib.LookupClass(Symbols::TransferableTypedData());
590 transferable_class_.store(cls.
ptr());
592 cls = isolate_lib.LookupClassAllowPrivate(Symbols::_RawReceivePort());
599 lookup_port_handler_.store(
function.ptr());
603 lookup_open_ports_.store(
function.ptr());
607 handle_message_function_.store(
function.ptr());
611void ObjectStore::LazyInitInternalMembers() {
613 SafepointWriteRwLocker locker(thread,
618 auto*
const zone = thread->
zone();
623 const auto& internal_lib =
629 symbol_class_.store(cls.
ptr());
633 symbol_name_field_.store(field.ptr());
SkIDChangeListener::List List
#define RELEASE_ASSERT(cond)
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
ObjectPtr At(intptr_t index) const
FieldPtr LookupInstanceField(const String &name) const
FunctionPtr LookupFunctionAllowPrivate(const String &name) const
FieldPtr LookupInstanceFieldAllowPrivate(const String &name) const
FunctionPtr LookupStaticFunctionAllowPrivate(const String &name) const
ErrorPtr EnsureIsFinalized(Thread *thread) const
FieldPtr LookupField(const String &name) const
FunctionPtr LookupFactoryAllowPrivate(const String &name) const
FieldPtr LookupFieldAllowPrivate(const String &name, bool instance_only=false) const
ArrayPtr current_functions() const
static StringPtr CreateDynamicInvocationForwarderName(const String &name)
static GrowableObjectArrayPtr New(Heap::Space space=Heap::kNew)
static InstancePtr New(const Class &cls, Heap::Space space=Heap::kNew)
ObjectStore * object_store() const
SafepointRwLock * program_lock()
void PrintToJSONObject(JSONObject *jsobj)
ErrorPtr PreallocateObjects(const Object &out_of_memory)
void VisitObjectPointers(ObjectPointerVisitor *visitor)
IsolateObjectStore * isolate_object_store() const
void AddProperty(const char *name, bool b) const
static LibraryPtr CoreLibrary()
StringPtr PrivateName(const String &name) const
static LibraryPtr IsolateLibrary()
ClassPtr LookupClassAllowPrivate(const String &name) const
FunctionPtr LookupFunctionAllowPrivate(const String &name) const
ClassPtr LookupClass(const String &name) const
static LibraryPtr InternalLibrary()
static LibraryPtr FfiLibrary()
void clear_gc_root_type()
void set_gc_root_type(const char *gc_root_type)
virtual void VisitPointers(ObjectPtr *first, ObjectPtr *last)=0
ErrorPtr PreallocateObjects()
void VisitObjectPointers(ObjectPointerVisitor *visitor)
void PrintToJSONObject(JSONObject *jsobj)
OBJECT_STORE_FIELD_LIST(DECLARE_GETTER, DECLARE_GETTER_AND_SETTER, DECLARE_RELAXED_ATOMIC_GETTER_AND_SETTER, DECLARE_ACQREL_ATOMIC_GETTER_AND_SETTER, DECLARE_LAZY_INIT_CORE_GETTER, DECLARE_LAZY_INIT_ASYNC_GETTER, DECLARE_LAZY_INIT_ISOLATE_GETTER, DECLARE_LAZY_INIT_INTERNAL_GETTER, DECLARE_LAZY_INIT_FFI_GETTER) LibraryPtr bootstrap_library(BootstrapLibraryId index)
static Object & ZoneHandle()
static FunctionPtr ResolveDynamicAnyArgs(Zone *zone, const Class &receiver_class, const String &function_name, bool allow_add)
static FunctionPtr ResolveDynamicFunction(Zone *zone, const Class &receiver_class, const String &function_name)
static constexpr int kPreallocatedStackdepth
static StackTracePtr New(const Array &code_array, const TypedData &pc_offset_array, Heap::Space space=Heap::kNew)
void set_expand_inlined(bool value) const
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
static const String & Symbol(intptr_t index)
static const String & Plus()
static const String & LAngleBracket()
static const String & BitOr()
static const String & RAngleBracket()
static const String & Star()
static const String & BitAnd()
static const String & Minus()
static const String & Equals()
static Thread * Current()
Isolate * isolate() const
IsolateGroup * isolate_group() const
static TypeArgumentsPtr New(intptr_t len, Heap::Space space=Heap::kOld)
static TypePtr New(const Class &clazz, const TypeArguments &arguments, Nullability nullability=Nullability::kNonNullable, Heap::Space space=Heap::kOld)
static TypedDataPtr New(intptr_t class_id, intptr_t len, Heap::Space space=Heap::kNew)
static UnhandledExceptionPtr New(const Instance &exception, const Instance &stacktrace, Heap::Space space=Heap::kNew)
static UnwindErrorPtr New(const String &message, Heap::Space space=Heap::kNew)
const uint8_t uint32_t uint32_t GError ** error
Dart_NativeFunction function
static const char *const names[]
const char *const class_name
static StackTracePtr CreatePreallocatedStackTrace(Zone *zone)
static InstancePtr AllocateObjectByClassName(const Library &library, const String &class_name)
const char *const function_name
DEF_SWITCHES_START aot vmservice shared library name
#define EMIT_FIELD_INIT(type, name)
#define EMIT_FIELD_NAME(type, name)
#define OBJECT_STORE_FIELD_LIST(R_, RW, ARW_RELAXED, ARW_AR, LAZY_CORE, LAZY_ASYNC, LAZY_ISOLATE, LAZY_INTERNAL, LAZY_FFI)
#define OBJECT_STORE_STUB_CODE_LIST(DO)
#define ARRAY_SIZE(array)