Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::ObjectPoolDeserializationCluster Class Reference
Inheritance diagram for dart::ObjectPoolDeserializationCluster:
dart::DeserializationCluster dart::ZoneAllocated

Public Member Functions

 ObjectPoolDeserializationCluster ()
 
 ~ObjectPoolDeserializationCluster ()
 
void ReadAlloc (Deserializer *d) override
 
void ReadFill (Deserializer *d_) override
 
void PostLoad (Deserializer *d, const Array &refs) override
 
- Public Member Functions inherited from dart::DeserializationCluster
 DeserializationCluster (const char *name, bool is_canonical=false, bool is_immutable=false)
 
virtual ~DeserializationCluster ()
 
virtual void ReadAlloc (Deserializer *deserializer)=0
 
virtual void ReadFill (Deserializer *deserializer)=0
 
virtual void PostLoad (Deserializer *deserializer, const Array &refs)
 
const char * name () const
 
bool is_canonical () const
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Additional Inherited Members

- Protected Member Functions inherited from dart::DeserializationCluster
void ReadAllocFixedSize (Deserializer *deserializer, intptr_t instance_size)
 
- Protected Attributes inherited from dart::DeserializationCluster
const char *const name_
 
const bool is_canonical_
 
const bool is_immutable_
 
intptr_t start_index_
 
intptr_t stop_index_
 

Detailed Description

Definition at line 3234 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ ObjectPoolDeserializationCluster()

dart::ObjectPoolDeserializationCluster::ObjectPoolDeserializationCluster ( )
inline

Definition at line 3236 of file app_snapshot.cc.

3236: DeserializationCluster("ObjectPool") {}
DeserializationCluster(const char *name, bool is_canonical=false, bool is_immutable=false)

◆ ~ObjectPoolDeserializationCluster()

dart::ObjectPoolDeserializationCluster::~ObjectPoolDeserializationCluster ( )
inline

Definition at line 3237 of file app_snapshot.cc.

3237{}

Member Function Documentation

◆ PostLoad()

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

Reimplemented from dart::DeserializationCluster.

Definition at line 3317 of file app_snapshot.cc.

3317 {
3318#if defined(DART_PRECOMPILED_RUNTIME) && \
3319 (!defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER))
3320 if (FLAG_disassemble) {
3321 ObjectPool& pool = ObjectPool::Handle(
3322 d->isolate_group()->object_store()->global_object_pool());
3323 THR_Print("Global object pool:\n");
3324 pool.DebugPrint();
3325 }
3326#endif
3327 }
AutoreleasePool pool
static Object & Handle()
Definition: object.h:407
#define THR_Print(format,...)
Definition: log.h:20
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19

◆ ReadAlloc()

void dart::ObjectPoolDeserializationCluster::ReadAlloc ( Deserializer d)
inlineoverridevirtual

Implements dart::DeserializationCluster.

Definition at line 3239 of file app_snapshot.cc.

3239 {
3240 start_index_ = d->next_index();
3241 const intptr_t count = d->ReadUnsigned();
3242 for (intptr_t i = 0; i < count; i++) {
3243 const intptr_t length = d->ReadUnsigned();
3244 d->AssignRef(d->Allocate(ObjectPool::InstanceSize(length)));
3245 }
3246 stop_index_ = d->next_index();
3247 }
int count
Definition: FontMgrTest.cpp:50
static intptr_t InstanceSize()
Definition: object.h:5649
size_t length

◆ ReadFill()

void dart::ObjectPoolDeserializationCluster::ReadFill ( Deserializer d_)
inlineoverridevirtual

Implements dart::DeserializationCluster.

Definition at line 3249 of file app_snapshot.cc.

3249 {
3250 Deserializer::Local d(d_);
3251
3252 ASSERT(!is_canonical()); // Never canonical.
3253 fill_position_ = d.Position();
3254#if defined(DART_PRECOMPILED_RUNTIME)
3255 const uint8_t immediate_bits = ObjectPool::EncodeBits(
3256 ObjectPool::EntryType::kImmediate, ObjectPool::Patchability::kPatchable,
3257 ObjectPool::SnapshotBehavior::kSnapshotable);
3258 uword switchable_call_miss_entry_point =
3259 StubCode::SwitchableCallMiss().MonomorphicEntryPoint();
3260#endif // defined(DART_PRECOMPILED_RUNTIME)
3261
3262 for (intptr_t id = start_index_, n = stop_index_; id < n; id++) {
3263 const intptr_t length = d.ReadUnsigned();
3264 ObjectPoolPtr pool = static_cast<ObjectPoolPtr>(d.Ref(id));
3265 Deserializer::InitializeHeader(pool, kObjectPoolCid,
3267 pool->untag()->length_ = length;
3268 for (intptr_t j = 0; j < length; j++) {
3269 const uint8_t entry_bits = d.Read<uint8_t>();
3270 pool->untag()->entry_bits()[j] = entry_bits;
3271 UntaggedObjectPool::Entry& entry = pool->untag()->data()[j];
3272 const auto snapshot_behavior =
3274 ASSERT(snapshot_behavior !=
3275 ObjectPool::SnapshotBehavior::kNotSnapshotable);
3276 switch (snapshot_behavior) {
3277 case ObjectPool::SnapshotBehavior::kSnapshotable:
3278 // Handled below.
3279 break;
3280 case ObjectPool::SnapshotBehavior::kResetToBootstrapNative:
3281 entry.raw_obj_ = StubCode::CallBootstrapNative().ptr();
3282 continue;
3283#if defined(DART_PRECOMPILED_RUNTIME)
3284 case ObjectPool::SnapshotBehavior::
3285 kResetToSwitchableCallMissEntryPoint:
3286 pool->untag()->entry_bits()[j] = immediate_bits;
3287 entry.raw_value_ =
3288 static_cast<intptr_t>(switchable_call_miss_entry_point);
3289 continue;
3290#endif // defined(DART_PRECOMPILED_RUNTIME)
3291 case ObjectPool::SnapshotBehavior::kSetToZero:
3292 entry.raw_value_ = 0;
3293 continue;
3294 default:
3295 FATAL("Unexpected snapshot behavior: %d\n", snapshot_behavior);
3296 }
3297 switch (ObjectPool::TypeBits::decode(entry_bits)) {
3298 case ObjectPool::EntryType::kTaggedObject:
3299 entry.raw_obj_ = d.ReadRef();
3300 break;
3301 case ObjectPool::EntryType::kImmediate:
3302 entry.raw_value_ = d.Read<intptr_t>();
3303 break;
3304 case ObjectPool::EntryType::kNativeFunction: {
3305 // Read nothing. Initialize with the lazy link entry.
3307 entry.raw_value_ = static_cast<intptr_t>(new_entry);
3308 break;
3309 }
3310 default:
3311 UNREACHABLE();
3312 }
3313 }
3314 }
3315 }
#define UNREACHABLE()
Definition: assert.h:248
static constexpr T decode(S value)
Definition: bitfield.h:171
static void InitializeHeader(ObjectPtr raw, intptr_t cid, intptr_t size, bool is_canonical=false)
static uword LinkNativeCallEntry()
static uint8_t EncodeBits(EntryType type, Patchability patchable, SnapshotBehavior snapshot_behavior)
Definition: object.h:5611
#define ASSERT(E)
#define FATAL(error)
uintptr_t uword
Definition: globals.h:501

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