Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::ProgramDeserializationRoots Class Reference
Inheritance diagram for dart::ProgramDeserializationRoots:
dart::DeserializationRoots

Public Member Functions

 ProgramDeserializationRoots (ObjectStore *object_store)
 
void AddBaseObjects (Deserializer *d) override
 
void ReadRoots (Deserializer *d) override
 
void PostLoad (Deserializer *d, const Array &refs) override
 
- Public Member Functions inherited from dart::DeserializationRoots
virtual ~DeserializationRoots ()
 
virtual void AddBaseObjects (Deserializer *deserializer)=0
 
virtual void ReadRoots (Deserializer *deserializer)=0
 
virtual void PostLoad (Deserializer *deserializer, const Array &refs)=0
 

Detailed Description

Definition at line 7185 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ ProgramDeserializationRoots()

dart::ProgramDeserializationRoots::ProgramDeserializationRoots ( ObjectStore object_store)
inlineexplicit

Definition at line 7187 of file app_snapshot.cc.

7188 : object_store_(object_store) {}

Member Function Documentation

◆ AddBaseObjects()

void dart::ProgramDeserializationRoots::AddBaseObjects ( Deserializer d)
inlineoverridevirtual

Implements dart::DeserializationRoots.

Definition at line 7190 of file app_snapshot.cc.

7190 {
7191 // N.B.: Skipping index 0 because ref 0 is illegal.
7192 const Array& base_objects = Object::vm_isolate_snapshot_object_table();
7193 for (intptr_t i = kFirstReference; i < base_objects.Length(); i++) {
7194 d->AddBaseObject(base_objects.At(i));
7195 }
7196 }
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
static constexpr intptr_t kFirstReference

◆ PostLoad()

void dart::ProgramDeserializationRoots::PostLoad ( Deserializer d,
const Array refs 
)
inlineoverridevirtual

Implements dart::DeserializationRoots.

Definition at line 7232 of file app_snapshot.cc.

7232 {
7233 auto isolate_group = d->isolate_group();
7234 {
7235 isolate_group->class_table()->CopySizesFromClassObjects();
7236 }
7237 d->heap()->old_space()->EvaluateAfterLoading();
7238
7239 auto object_store = isolate_group->object_store();
7240 const Array& units = Array::Handle(object_store->loading_units());
7241 if (!units.IsNull()) {
7242 LoadingUnit& unit = LoadingUnit::Handle();
7243 unit ^= units.At(LoadingUnit::kRootId);
7244 unit.set_base_objects(refs);
7245 }
7246
7247 // Setup native resolver for bootstrap impl.
7249 }
static void SetupNativeResolver()
static constexpr intptr_t kRootId
Definition: object.h:7969
static Object & Handle()
Definition: object.h:407

◆ ReadRoots()

void dart::ProgramDeserializationRoots::ReadRoots ( Deserializer d)
inlineoverridevirtual

Implements dart::DeserializationRoots.

Definition at line 7198 of file app_snapshot.cc.

7198 {
7199 // Read roots.
7200 ObjectPtr* from = object_store_->from();
7201 ObjectPtr* to = object_store_->to_snapshot(d->kind());
7202 for (ObjectPtr* p = from; p <= to; p++) {
7203 *p = d->ReadRef();
7204 }
7205
7206 {
7207 FieldTable* initial_field_table =
7208 d->thread()->isolate_group()->initial_field_table();
7209 intptr_t n = d->ReadUnsigned();
7210 initial_field_table->AllocateIndex(n - 1);
7211 for (intptr_t i = 0; i < n; i++) {
7212 initial_field_table->SetAt(i, d->ReadRef());
7213 }
7214 }
7215
7216 {
7217 FieldTable* shared_initial_field_table =
7218 d->thread()->isolate_group()->shared_initial_field_table();
7219 intptr_t n_shared = d->ReadUnsigned();
7220 if (n_shared > 0) {
7221 shared_initial_field_table->AllocateIndex(n_shared - 1);
7222 for (intptr_t i = 0; i < n_shared; i++) {
7223 shared_initial_field_table->SetAt(i, d->ReadRef());
7224 }
7225 }
7226 }
7227
7228 // Deserialize dispatch table (when applicable)
7229 d->ReadDispatchTable();
7230 }

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