Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
object_store.cc
Go to the documentation of this file.
1// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
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.
4
5#include "vm/object_store.h"
6
7#include "vm/dart_entry.h"
8#include "vm/exceptions.h"
9#include "vm/isolate.h"
10#include "vm/object.h"
11#include "vm/raw_object.h"
12#include "vm/resolver.h"
13#include "vm/stub_code.h"
14#include "vm/symbols.h"
15#include "vm/visitor.h"
16
17namespace dart {
18
20 ASSERT(visitor != nullptr);
21 visitor->set_gc_root_type("isolate_object store");
22 visitor->VisitPointers(from(), to());
23 visitor->clear_gc_root_type();
24}
25
27 for (ObjectPtr* current = from(); current <= to(); current++) {
28 *current = Object::null();
29 }
30}
31
32#ifndef PRODUCT
34 jsobj->AddProperty("type", "_IsolateObjectStore");
35
36 {
37 JSONObject fields(jsobj, "fields");
39
40 static const char* const names[] = {
41#define EMIT_FIELD_NAME(type, name) #name "_",
43#undef EMIT_FIELD_NAME
44 };
45 ObjectPtr* current = from();
46 intptr_t i = 0;
47 while (current <= to()) {
48 value = *current;
49 fields.AddProperty(names[i], value);
50 current++;
51 i++;
52 }
53 ASSERT(i == ARRAY_SIZE(names));
54 }
55}
56#endif // !PRODUCT
57
58static StackTracePtr CreatePreallocatedStackTrace(Zone* zone) {
59 const Array& code_array = Array::Handle(
61 const TypedData& pc_offset_array = TypedData::Handle(
63 Heap::kOld));
64 const StackTrace& stack_trace =
65 StackTrace::Handle(zone, StackTrace::New(code_array, pc_offset_array));
66 // Expansion of inlined functions requires additional memory at run time,
67 // avoid it.
68 stack_trace.set_expand_inlined(false);
69 return stack_trace.ptr();
70}
71
72ErrorPtr IsolateObjectStore::PreallocateObjects(const Object& out_of_memory) {
73 Thread* thread = Thread::Current();
74 Isolate* isolate = thread->isolate();
75 Zone* zone = thread->zone();
76 ASSERT(isolate != nullptr && isolate->isolate_object_store() == this);
77 ASSERT(preallocated_stack_trace() == StackTrace::null());
78 resume_capabilities_ = GrowableObjectArray::New();
79 exit_listeners_ = GrowableObjectArray::New();
80 error_listeners_ = GrowableObjectArray::New();
81 dart_args_1_ = Array::New(1);
82 dart_args_2_ = Array::New(2);
83
84 // Allocate pre-allocated unhandled exception object initialized with the
85 // pre-allocated OutOfMemoryError.
86 const StackTrace& preallocated_stack_trace =
88 set_preallocated_stack_trace(preallocated_stack_trace);
89 set_preallocated_unhandled_exception(UnhandledException::Handle(
90 zone, UnhandledException::New(Instance::Cast(out_of_memory),
91 preallocated_stack_trace)));
92 const UnwindError& preallocated_unwind_error =
94 zone, String::New("isolate is exiting"))));
95 set_preallocated_unwind_error(preallocated_unwind_error);
96
97 return Error::null();
98}
99
101 :
102#define EMIT_FIELD_INIT(type, name) name##_(nullptr),
112#undef EMIT_FIELD_INIT
113 // Just to prevent a trailing comma.
114 unused_field_(0) {
115 for (ObjectPtr* current = from(); current <= to(); current++) {
116 *current = Object::null();
117 }
118}
119
121
123 ASSERT(visitor != nullptr);
124 visitor->set_gc_root_type("object store");
125 visitor->VisitPointers(from(), to());
126 visitor->clear_gc_root_type();
127}
128
130#define DO(member, name) set_##member(StubCode::name());
132#undef DO
133}
134
135#ifndef PRODUCT
137 jsobj->AddProperty("type", "_ObjectStore");
138
139 {
140 JSONObject fields(jsobj, "fields");
142 static const char* const names[] = {
143#define EMIT_FIELD_NAME(type, name) #name "_",
148#undef EMIT_FIELD_NAME
149 };
150 ObjectPtr* current = from();
151 intptr_t i = 0;
152 while (current <= to()) {
153 value = *current;
154 fields.AddProperty(names[i], value);
155 current++;
156 i++;
157 }
158 ASSERT(i == ARRAY_SIZE(names));
159 }
160}
161#endif // !PRODUCT
162
163static InstancePtr AllocateObjectByClassName(const Library& library,
164 const String& class_name) {
166 ASSERT(!cls.IsNull());
167 return Instance::New(cls);
168}
169
171 Thread* thread = Thread::Current();
172 IsolateGroup* isolate_group = thread->isolate_group();
173 // Either we are the object store on isolate group, or isolate group has no
174 // object store and we are the object store on the isolate.
175 ASSERT(isolate_group != nullptr && isolate_group->object_store() == this);
176
177 if (this->stack_overflow() != Instance::null()) {
178 ASSERT(this->out_of_memory() != Instance::null());
179 return Error::null();
180 }
181 ASSERT(this->stack_overflow() == Instance::null());
182 ASSERT(this->out_of_memory() == Instance::null());
183
185 const Library& library = Library::Handle(Library::CoreLibrary());
186
187 result = AllocateObjectByClassName(library, Symbols::StackOverflowError());
188 if (result.IsError()) {
189 return Error::Cast(result).ptr();
190 }
191 set_stack_overflow(Instance::Cast(result));
192
193 result = AllocateObjectByClassName(library, Symbols::OutOfMemoryError());
194 if (result.IsError()) {
195 return Error::Cast(result).ptr();
196 }
197 set_out_of_memory(Instance::Cast(result));
198
199 return Error::null();
200}
201
202FunctionPtr ObjectStore::PrivateObjectLookup(const String& name) {
203 const Library& core_lib = Library::Handle(core_library());
204 const String& mangled = String::ZoneHandle(core_lib.PrivateName(name));
205 const Class& cls = Class::Handle(object_class());
206 Thread* thread = Thread::Current();
207 const auto& error = cls.EnsureIsFinalized(thread);
210 Resolver::ResolveDynamicFunction(thread->zone(), cls, mangled));
211 ASSERT(!result.IsNull());
212 return result.ptr();
213}
214
216 Thread* thread = Thread::Current();
217 Zone* zone = thread->zone();
218 Class& cls = Class::Handle(zone);
219 const Library& collection_lib = Library::Handle(zone, collection_library());
220 cls = collection_lib.LookupClassAllowPrivate(Symbols::_Set());
221 ASSERT(!cls.IsNull());
222 set_set_impl_class(cls);
223
224#if defined(DART_PRECOMPILED_RUNTIME)
225 // The rest of these objects are only needed for code generation.
226 return;
227#else
228 auto isolate_group = thread->isolate_group();
229 ASSERT(isolate_group != nullptr && isolate_group->object_store() == this);
230
231 const Library& async_lib = Library::Handle(zone, async_library());
232 ASSERT(!async_lib.IsNull());
233 cls = async_lib.LookupClass(Symbols::Future());
234 ASSERT(!cls.IsNull());
235 set_future_class(cls);
236
239 Field& field = Field::Handle(zone);
240
241 cls =
242 async_lib.LookupClassAllowPrivate(Symbols::_AsyncStarStreamController());
243 ASSERT(!cls.IsNull());
245 set_async_star_stream_controller(cls);
246
247 function = cls.LookupFunctionAllowPrivate(Symbols::add());
248 ASSERT(!function.IsNull());
249 set_async_star_stream_controller_add(function);
250
251 function = cls.LookupFunctionAllowPrivate(Symbols::addStream());
252 ASSERT(!function.IsNull());
253 set_async_star_stream_controller_add_stream(function);
254
255 field = cls.LookupFieldAllowPrivate(Symbols::asyncStarBody());
256 ASSERT(!field.IsNull());
257 set_async_star_stream_controller_async_star_body(field);
258
259#if !defined(PRODUCT)
260 // Disable debugging and inlining of all functions on the
261 // _AsyncStarStreamController class.
262 const Array& functions = Array::Handle(zone, cls.current_functions());
263 for (intptr_t i = 0; i < functions.Length(); i++) {
264 function ^= functions.At(i);
265 if (function.IsNull()) {
266 break;
267 }
268 function.set_is_debuggable(false);
269 function.set_is_inlinable(false);
270 }
271#endif
272
273 cls = async_lib.LookupClassAllowPrivate(Symbols::Stream());
274 ASSERT(!cls.IsNull());
275 set_stream_class(cls);
276
277 cls = async_lib.LookupClassAllowPrivate(Symbols::_SuspendState());
278 ASSERT(!cls.IsNull());
279 const auto& error = cls.EnsureIsFinalized(thread);
281
282 function = cls.LookupFunctionAllowPrivate(Symbols::_initAsync());
283 ASSERT(!function.IsNull());
284 set_suspend_state_init_async(function);
285
286 function = cls.LookupFunctionAllowPrivate(Symbols::_await());
287 ASSERT(!function.IsNull());
288 set_suspend_state_await(function);
289
290 function = cls.LookupFunctionAllowPrivate(Symbols::_awaitWithTypeCheck());
291 ASSERT(!function.IsNull());
292 set_suspend_state_await_with_type_check(function);
293
294 function = cls.LookupFunctionAllowPrivate(Symbols::_returnAsync());
295 ASSERT(!function.IsNull());
296 set_suspend_state_return_async(function);
297
298 function = cls.LookupFunctionAllowPrivate(Symbols::_returnAsyncNotFuture());
299 ASSERT(!function.IsNull());
300 set_suspend_state_return_async_not_future(function);
301
302 function = cls.LookupFunctionAllowPrivate(Symbols::_initAsyncStar());
303 ASSERT(!function.IsNull());
304 set_suspend_state_init_async_star(function);
305
306 function = cls.LookupFunctionAllowPrivate(Symbols::_yieldAsyncStar());
307 ASSERT(!function.IsNull());
308 set_suspend_state_yield_async_star(function);
309
310 function = cls.LookupFunctionAllowPrivate(Symbols::_returnAsyncStar());
311 ASSERT(!function.IsNull());
312 set_suspend_state_return_async_star(function);
313
314 function = cls.LookupFunctionAllowPrivate(Symbols::_initSyncStar());
315 ASSERT(!function.IsNull());
316 set_suspend_state_init_sync_star(function);
317
318 function = cls.LookupFunctionAllowPrivate(Symbols::_suspendSyncStarAtStart());
319 ASSERT(!function.IsNull());
320 set_suspend_state_suspend_sync_star_at_start(function);
321
322 function = cls.LookupFunctionAllowPrivate(Symbols::_handleException());
323 ASSERT(!function.IsNull());
324 set_suspend_state_handle_exception(function);
325
326 cls = async_lib.LookupClassAllowPrivate(Symbols::_SyncStarIterator());
327 ASSERT(!cls.IsNull());
329 set_sync_star_iterator_class(cls);
330
331 field = cls.LookupFieldAllowPrivate(Symbols::_current());
332 ASSERT(!field.IsNull());
333 set_sync_star_iterator_current(field);
334
335 field = cls.LookupFieldAllowPrivate(Symbols::_state());
336 ASSERT(!field.IsNull());
337 set_sync_star_iterator_state(field);
338
339 field = cls.LookupFieldAllowPrivate(Symbols::_yieldStarIterable());
340 ASSERT(!field.IsNull());
341 set_sync_star_iterator_yield_star_iterable(field);
342
343 const Library& core_lib = Library::Handle(zone, core_library());
344 cls = core_lib.LookupClassAllowPrivate(Symbols::_CompileTimeError());
345 ASSERT(!cls.IsNull());
346 set_compiletime_error_class(cls);
347
348 cls = core_lib.LookupClassAllowPrivate(Symbols::Pragma());
349 ASSERT(!cls.IsNull());
350 set_pragma_class(cls);
352 set_pragma_name(Field::Handle(zone, cls.LookupField(Symbols::name())));
353 set_pragma_options(Field::Handle(zone, cls.LookupField(Symbols::options())));
354
355 cls = core_lib.LookupClassAllowPrivate(Symbols::_GrowableList());
356 ASSERT(!cls.IsNull());
358 growable_list_factory_ =
359 cls.LookupFactoryAllowPrivate(Symbols::_GrowableListFactory());
360 ASSERT(growable_list_factory_ != Function::null());
361
362 cls = core_lib.LookupClassAllowPrivate(Symbols::Error());
363 ASSERT(!cls.IsNull());
364 set_error_class(cls);
365
366 cls = core_lib.LookupClassAllowPrivate(Symbols::Expando());
367 ASSERT(!cls.IsNull());
368 set_expando_class(cls);
369
370 cls = core_lib.LookupClassAllowPrivate(Symbols::Iterable());
371 ASSERT(!cls.IsNull());
372 set_iterable_class(cls);
373
374 // Cache the core private functions used for fast instance of checks.
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());
381
382 // Ensure AddSmiSmiCheckForFastSmiStubs run by the background compiler
383 // will not create new functions.
384 const Class& smi_class = Class::Handle(zone, this->smi_class());
385 RELEASE_ASSERT(smi_class.EnsureIsFinalized(thread) == Error::null());
410#endif // defined(DART_PRECOMPILED_RUNTIME)
411}
412
413void ObjectStore::LazyInitCoreMembers() {
414 auto* const thread = Thread::Current();
415 SafepointWriteRwLocker locker(thread,
416 thread->isolate_group()->program_lock());
417 if (list_class_.load() == Type::null()) {
418 ASSERT(non_nullable_list_rare_type_.load() == Type::null());
419 ASSERT(non_nullable_map_rare_type_.load() == Type::null());
420 ASSERT(enum_index_field_.load() == Field::null());
421 ASSERT(enum_name_field_.load() == Field::null());
422 ASSERT(_object_equals_function_.load() == Function::null());
423 ASSERT(_object_hash_code_function_.load() == Function::null());
424 ASSERT(_object_to_string_function_.load() == Function::null());
425
426 auto* const zone = thread->zone();
427 const auto& core_lib = Library::Handle(zone, Library::CoreLibrary());
428 auto& cls = Class::Handle(zone);
429
430 cls = core_lib.LookupClass(Symbols::List());
431 ASSERT(!cls.IsNull());
432 list_class_.store(cls.ptr());
433
434 auto& type = Type::Handle(zone);
435 type = cls.RareType();
436 non_nullable_list_rare_type_.store(type.ptr());
437
438 cls = core_lib.LookupClass(Symbols::Map());
439 ASSERT(!cls.IsNull());
440 map_class_.store(cls.ptr());
441
442 type = cls.RareType();
443 non_nullable_map_rare_type_.store(type.ptr());
444
445 cls = core_lib.LookupClass(Symbols::Set());
446 ASSERT(!cls.IsNull());
447 set_class_.store(cls.ptr());
448
449 auto& field = Field::Handle(zone);
450
451 cls = core_lib.LookupClassAllowPrivate(Symbols::_Enum());
452 ASSERT(!cls.IsNull());
453 const auto& error = cls.EnsureIsFinalized(thread);
455
456 field = cls.LookupInstanceField(Symbols::Index());
457 ASSERT(!field.IsNull());
458 enum_index_field_.store(field.ptr());
459
460 field = cls.LookupInstanceFieldAllowPrivate(Symbols::_name());
461 ASSERT(!field.IsNull());
462 enum_name_field_.store(field.ptr());
463
464 auto& function = Function::Handle(zone);
465
466 function = core_lib.LookupFunctionAllowPrivate(Symbols::_objectHashCode());
467 ASSERT(!function.IsNull());
468 _object_hash_code_function_.store(function.ptr());
469
470 function = core_lib.LookupFunctionAllowPrivate(Symbols::_objectEquals());
471 ASSERT(!function.IsNull());
472 _object_equals_function_.store(function.ptr());
473
474 function = core_lib.LookupFunctionAllowPrivate(Symbols::_objectToString());
475 ASSERT(!function.IsNull());
476 _object_to_string_function_.store(function.ptr());
477 }
478}
479
480void ObjectStore::LazyInitAsyncMembers() {
481 auto* const thread = Thread::Current();
482 SafepointWriteRwLocker locker(thread,
483 thread->isolate_group()->program_lock());
484 if (nullable_future_null_type_.load() == Type::null()) {
485 ASSERT(non_nullable_future_never_type_.load() == Type::null());
486
487 auto* const zone = thread->zone();
488 const auto& cls = Class::Handle(zone, future_class());
489 ASSERT(!cls.IsNull());
490
491 auto& type_args = TypeArguments::Handle(zone);
492 auto& type = Type::Handle(zone);
493 type = never_type();
494 ASSERT(!type.IsNull());
495 type_args = TypeArguments::New(1);
496 type_args.SetTypeAt(0, type);
497 type = Type::New(cls, type_args, Nullability::kNonNullable);
498 type.SetIsFinalized();
499 type ^= type.Canonicalize(thread);
500 non_nullable_future_never_type_.store(type.ptr());
501
502 type = null_type();
503 ASSERT(!type.IsNull());
504 type_args = TypeArguments::New(1);
505 type_args.SetTypeAt(0, type);
506 type = Type::New(cls, type_args, Nullability::kNullable);
507 type.SetIsFinalized();
508 type ^= type.Canonicalize(thread);
509 nullable_future_null_type_.store(type.ptr());
510 }
511}
512
513void ObjectStore::LazyInitFfiMembers() {
514 auto* const thread = Thread::Current();
515 SafepointWriteRwLocker locker(thread,
516 thread->isolate_group()->program_lock());
517 if (handle_finalizer_message_function_.load() == Function::null()) {
518 auto* const zone = thread->zone();
519 auto& cls = Class::Handle(zone);
520 auto& function = Function::Handle(zone);
521 auto& error = Error::Handle(zone);
522
523 const auto& ffi_lib = Library::Handle(zone, Library::FfiLibrary());
524 ASSERT(!ffi_lib.IsNull());
525
526 cls = finalizer_class();
527 ASSERT(!cls.IsNull());
528 error = cls.EnsureIsFinalized(thread);
529 ASSERT(error.IsNull());
530 function =
531 cls.LookupFunctionAllowPrivate(Symbols::_handleFinalizerMessage());
532 ASSERT(!function.IsNull());
533 handle_finalizer_message_function_.store(function.ptr());
534
535 cls = native_finalizer_class();
536 ASSERT(!cls.IsNull());
537 error = cls.EnsureIsFinalized(thread);
538 ASSERT(error.IsNull());
540 Symbols::_handleNativeFinalizerMessage());
541 ASSERT(!function.IsNull());
542 handle_native_finalizer_message_function_.store(function.ptr());
543
544 cls = ffi_lib.LookupClass(Symbols::FfiNative());
545 ASSERT(!cls.IsNull());
546 error = cls.EnsureIsFinalized(thread);
547 ASSERT(error.IsNull());
548 function =
549 cls.LookupStaticFunctionAllowPrivate(Symbols::_ffi_resolver_function());
550 ASSERT(!function.IsNull());
551 ffi_resolver_function_.store(function.ptr());
552
553 cls = ffi_lib.LookupClass(Symbols::VarArgs());
554 ASSERT(!cls.IsNull());
555 varargs_class_.store(cls.ptr());
556 }
557}
558
559void ObjectStore::LazyInitIsolateMembers() {
560 auto* const thread = Thread::Current();
561 SafepointWriteRwLocker locker(thread,
562 thread->isolate_group()->program_lock());
563 if (lookup_port_handler_.load() == Type::null()) {
564 ASSERT(lookup_open_ports_.load() == Type::null());
565 ASSERT(handle_message_function_.load() == Type::null());
566
567 auto* const zone = thread->zone();
568 const auto& isolate_lib = Library::Handle(zone, Library::IsolateLibrary());
569 auto& cls = Class::Handle(zone);
570 auto& function = Function::Handle(zone);
571
572 cls = isolate_lib.LookupClass(Symbols::Capability());
573 ASSERT(!cls.IsNull());
574 capability_class_.store(cls.ptr());
575
576 cls = isolate_lib.LookupClass(Symbols::SendPort());
577 ASSERT(!cls.IsNull());
578 send_port_class_.store(cls.ptr());
579
580 cls = isolate_lib.LookupClass(Symbols::TransferableTypedData());
581 ASSERT(!cls.IsNull());
582 transferable_class_.store(cls.ptr());
583
584 cls = isolate_lib.LookupClassAllowPrivate(Symbols::_RawReceivePort());
585 ASSERT(!cls.IsNull());
586 const auto& error = cls.EnsureIsFinalized(thread);
588
589 function = cls.LookupFunctionAllowPrivate(Symbols::_lookupHandler());
590 ASSERT(!function.IsNull());
591 lookup_port_handler_.store(function.ptr());
592
593 function = cls.LookupFunctionAllowPrivate(Symbols::_lookupOpenPorts());
594 ASSERT(!function.IsNull());
595 lookup_open_ports_.store(function.ptr());
596
597 function = cls.LookupFunctionAllowPrivate(Symbols::_handleMessage());
598 ASSERT(!function.IsNull());
599 handle_message_function_.store(function.ptr());
600 }
601}
602
603void ObjectStore::LazyInitInternalMembers() {
604 auto* const thread = Thread::Current();
605 SafepointWriteRwLocker locker(thread,
606 thread->isolate_group()->program_lock());
607 if (symbol_class_.load() == Type::null()) {
608 ASSERT(symbol_name_field_.load() == Field::null());
609
610 auto* const zone = thread->zone();
611 auto& cls = Class::Handle(zone);
612 auto& field = Field::Handle(zone);
613 auto& error = Error::Handle(zone);
614
615 const auto& internal_lib =
617 cls = internal_lib.LookupClass(Symbols::Symbol());
618 ASSERT(!cls.IsNull());
619 error = cls.EnsureIsFinalized(thread);
620 ASSERT(error.IsNull());
621 symbol_class_.store(cls.ptr());
622
623 field = cls.LookupInstanceFieldAllowPrivate(Symbols::_name());
624 ASSERT(!field.IsNull());
625 symbol_name_field_.store(field.ptr());
626 }
627}
628
629} // namespace dart
#define RELEASE_ASSERT(cond)
Definition assert.h:327
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
Definition object.h:10933
ObjectPtr At(intptr_t index) const
Definition object.h:10854
intptr_t Length() const
Definition object.h:10808
FieldPtr LookupInstanceField(const String &name) const
Definition object.cc:6399
FunctionPtr LookupFunctionAllowPrivate(const String &name) const
Definition object.cc:6222
FieldPtr LookupInstanceFieldAllowPrivate(const String &name) const
Definition object.cc:6489
TypePtr RareType() const
Definition object.cc:3097
FunctionPtr LookupStaticFunctionAllowPrivate(const String &name) const
Definition object.cc:6198
ErrorPtr EnsureIsFinalized(Thread *thread) const
Definition object.cc:4979
FieldPtr LookupField(const String &name) const
Definition object.cc:6407
FunctionPtr LookupFactoryAllowPrivate(const String &name) const
Definition object.cc:6218
FieldPtr LookupFieldAllowPrivate(const String &name, bool instance_only=false) const
Definition object.cc:6458
ArrayPtr current_functions() const
Definition object.h:1643
static StringPtr CreateDynamicInvocationForwarderName(const String &name)
Definition object.cc:4255
static GrowableObjectArrayPtr New(Heap::Space space=Heap::kNew)
Definition object.h:11118
@ kOld
Definition heap.h:39
static InstancePtr New(const Class &cls, Heap::Space space=Heap::kNew)
Definition object.cc:20976
ObjectStore * object_store() const
Definition isolate.h:505
SafepointRwLock * program_lock()
Definition isolate.h:532
void PrintToJSONObject(JSONObject *jsobj)
ErrorPtr PreallocateObjects(const Object &out_of_memory)
void VisitObjectPointers(ObjectPointerVisitor *visitor)
IsolateObjectStore * isolate_object_store() const
Definition isolate.h:960
void AddProperty(const char *name, bool b) const
static LibraryPtr CoreLibrary()
Definition object.cc:14834
StringPtr PrivateName(const String &name) const
Definition object.cc:14751
static LibraryPtr IsolateLibrary()
Definition object.cc:14854
ClassPtr LookupClassAllowPrivate(const String &name) const
Definition object.cc:14160
FunctionPtr LookupFunctionAllowPrivate(const String &name) const
Definition object.cc:14131
ClassPtr LookupClass(const String &name) const
Definition object.cc:14152
static LibraryPtr InternalLibrary()
Definition object.cc:14850
static LibraryPtr FfiLibrary()
Definition object.cc:14846
void set_gc_root_type(const char *gc_root_type)
Definition visitor.h:58
virtual void VisitPointers(ObjectPtr *first, ObjectPtr *last)=0
ErrorPtr PreallocateObjects()
void VisitObjectPointers(ObjectPointerVisitor *visitor)
void PrintToJSONObject(JSONObject *jsobj)
static ObjectPtr null()
Definition object.h:433
ObjectPtr ptr() const
Definition object.h:332
bool IsNull() const
Definition object.h:363
static Object & Handle()
Definition object.h:407
static Object & ZoneHandle()
Definition object.h:419
static FunctionPtr ResolveDynamicFunction(Zone *zone, const Class &receiver_class, const String &function_name)
Definition resolver.cc:189
static FunctionPtr ResolveDynamicAnyArgs(Zone *zone, const Class &receiver_class, const String &function_name, bool allow_add=true)
Definition resolver.cc:198
static constexpr int kPreallocatedStackdepth
Definition object.h:12532
static StackTracePtr New(const Array &code_array, const TypedData &pc_offset_array, Heap::Space space=Heap::kNew)
Definition object.cc:26148
void set_expand_inlined(bool value) const
Definition object.cc:26140
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
Definition object.cc:23777
static const String & Symbol(intptr_t index)
Definition symbols.h:606
static const String & Plus()
Definition symbols.h:616
static const String & LAngleBracket()
Definition symbols.h:622
static const String & BitOr()
Definition symbols.h:618
static const String & RAngleBracket()
Definition symbols.h:625
static const String & Star()
Definition symbols.h:677
static const String & BitAnd()
Definition symbols.h:619
static const String & Minus()
Definition symbols.h:617
static const String & Equals()
Definition symbols.h:613
Zone * zone() const
static Thread * Current()
Definition thread.h:361
Isolate * isolate() const
Definition thread.h:533
IsolateGroup * isolate_group() const
Definition thread.h:540
static TypeArgumentsPtr New(intptr_t len, Heap::Space space=Heap::kOld)
Definition object.cc:7733
static TypePtr New(const Class &clazz, const TypeArguments &arguments, Nullability nullability=Nullability::kLegacy, Heap::Space space=Heap::kOld)
Definition object.cc:22492
static TypedDataPtr New(intptr_t class_id, intptr_t len, Heap::Space space=Heap::kNew)
Definition object.cc:25666
static UnhandledExceptionPtr New(const Instance &exception, const Instance &stacktrace, Heap::Space space=Heap::kNew)
Definition object.cc:19989
static UnwindErrorPtr New(const String &message, Heap::Space space=Heap::kNew)
Definition object.cc:20055
#define DO(type, attrs)
#define ASSERT(E)
const uint8_t uint32_t uint32_t GError ** error
uint8_t value
GAsyncResult * result
Dart_NativeFunction function
Definition fuchsia.cc:51
static const char *const names[]
Definition symbols.cc:24
const char *const name
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
#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 ISOLATE_OBJECT_STORE_FIELD_LIST(R_, RW)
#define OBJECT_STORE_STUB_CODE_LIST(DO)
#define ARRAY_SIZE(array)
Definition globals.h:72