Flutter Engine
The Flutter Engine
Public Member Functions | Friends | List of all members
dart::IsolateObjectStore Class Reference

#include <object_store.h>

Public Member Functions

 IsolateObjectStore ()
 
 ~IsolateObjectStore ()
 
void VisitObjectPointers (ObjectPointerVisitor *visitor)
 
ErrorPtr PreallocateObjects (const Object &out_of_memory)
 
void Init ()
 
void PostLoad ()
 
void PrintToJSONObject (JSONObject *jsobj)
 

Friends

class Serializer
 
class Deserializer
 

Detailed Description

Definition at line 402 of file object_store.h.

Constructor & Destructor Documentation

◆ IsolateObjectStore()

dart::IsolateObjectStore::IsolateObjectStore ( )
inline

Definition at line 404 of file object_store.h.

404{}

◆ ~IsolateObjectStore()

dart::IsolateObjectStore::~IsolateObjectStore ( )
inline

Definition at line 405 of file object_store.h.

405{}

Member Function Documentation

◆ Init()

void dart::IsolateObjectStore::Init ( )

Definition at line 26 of file object_store.cc.

26 {
27 for (ObjectPtr* current = from(); current <= to(); current++) {
28 *current = Object::null();
29 }
30}
static ObjectPtr null()
Definition: object.h:433

◆ PostLoad()

void dart::IsolateObjectStore::PostLoad ( )

◆ PreallocateObjects()

ErrorPtr dart::IsolateObjectStore::PreallocateObjects ( const Object out_of_memory)

Definition at line 72 of file object_store.cc.

72 {
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}
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
Definition: object.h:10959
static GrowableObjectArrayPtr New(Heap::Space space=Heap::kNew)
Definition: object.h:11144
static Object & Handle()
Definition: object.h:407
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
Definition: object.cc:23698
static Thread * Current()
Definition: thread.h:362
static UnhandledExceptionPtr New(const Instance &exception, const Instance &stacktrace, Heap::Space space=Heap::kNew)
Definition: object.cc:19939
static UnwindErrorPtr New(const String &message, Heap::Space space=Heap::kNew)
Definition: object.cc:20005
#define ASSERT(E)
static StackTracePtr CreatePreallocatedStackTrace(Zone *zone)
Definition: object_store.cc:58

◆ PrintToJSONObject()

void dart::IsolateObjectStore::PrintToJSONObject ( JSONObject jsobj)

Definition at line 33 of file object_store.cc.

33 {
34 jsobj->AddProperty("type", "_IsolateObjectStore");
35
36 {
37 JSONObject fields(jsobj, "fields");
38 Object& value = Object::Handle();
39
40 static const char* const names[] = {
41#define EMIT_FIELD_NAME(type, name) #name "_",
42 ISOLATE_OBJECT_STORE_FIELD_LIST(EMIT_FIELD_NAME, EMIT_FIELD_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 }
54 }
55}
uint8_t value
static const char *const names[]
Definition: symbols.cc:24
#define EMIT_FIELD_NAME(type, name)
#define ARRAY_SIZE(array)
Definition: globals.h:72

◆ VisitObjectPointers()

void dart::IsolateObjectStore::VisitObjectPointers ( ObjectPointerVisitor visitor)

Definition at line 19 of file object_store.cc.

19 {
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}

Friends And Related Function Documentation

◆ Deserializer

friend class Deserializer
friend

Definition at line 449 of file object_store.h.

◆ Serializer

friend class Serializer
friend

Definition at line 448 of file object_store.h.


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