Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::MessageDeserializer Class Reference
Inheritance diagram for dart::MessageDeserializer:
dart::BaseDeserializer dart::ValueObject

Public Member Functions

 MessageDeserializer (Thread *thread, Message *message)
 
 ~MessageDeserializer ()
 
DART_NOINLINE void AddBaseObject (ObjectPtr base_object)
 
void AssignRef (ObjectPtr object)
 
ObjectPtr Ref (intptr_t index) const
 
void UpdateRef (intptr_t index, const Object &new_object)
 
ObjectPtr ReadRef ()
 
void AddBaseObjects ()
 
ObjectPtr Deserialize ()
 
Threadthread () const
 
IsolateGroupisolate_group () const
 
ArrayPtr refs () const
 
- Public Member Functions inherited from dart::BaseDeserializer
 BaseDeserializer (Zone *zone, Message *message)
 
 ~BaseDeserializer ()
 
template<typename T >
T Read ()
 
intptr_t ReadUnsigned ()
 
uword ReadWordWith32BitReads ()
 
void ReadBytes (void *addr, intptr_t len)
 
const char * ReadAscii ()
 
const uint8_t * CurrentBufferAddress () const
 
void Advance (intptr_t value)
 
MessageDeserializationClusterReadCluster ()
 
Zonezone () const
 
intptr_t next_index () const
 
MessageFinalizableDatafinalizable_data () const
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Additional Inherited Members

- Protected Attributes inherited from dart::BaseDeserializer
Zonezone_
 
ReadStream stream_
 
MessageFinalizableDatafinalizable_data_
 
intptr_t next_ref_index_
 

Detailed Description

Definition at line 383 of file message_snapshot.cc.

Constructor & Destructor Documentation

◆ MessageDeserializer()

dart::MessageDeserializer::MessageDeserializer ( Thread thread,
Message message 
)
inline

Definition at line 385 of file message_snapshot.cc.

387 thread_(thread),
388 refs_(Array::Handle(thread->zone())) {}
BaseDeserializer(Zone *zone, Message *message)
static Object & Handle()
Definition: object.h:407
Zone * zone() const
Definition: thread_state.h:37
Win32Message message

◆ ~MessageDeserializer()

dart::MessageDeserializer::~MessageDeserializer ( )
inline

Definition at line 389 of file message_snapshot.cc.

389{}

Member Function Documentation

◆ AddBaseObject()

DART_NOINLINE void dart::MessageDeserializer::AddBaseObject ( ObjectPtr  base_object)
inline

Definition at line 391 of file message_snapshot.cc.

391 {
392 AssignRef(base_object);
393 }
void AssignRef(ObjectPtr object)

◆ AddBaseObjects()

void dart::MessageDeserializer::AddBaseObjects ( )

Definition at line 3228 of file message_snapshot.cc.

3228 {
3230 AddBaseObject(Object::sentinel().ptr());
3231 AddBaseObject(Object::transition_sentinel().ptr());
3232 AddBaseObject(Object::empty_array().ptr());
3233 AddBaseObject(Object::dynamic_type().ptr());
3234 AddBaseObject(Object::void_type().ptr());
3235 AddBaseObject(Object::empty_type_arguments().ptr());
3236 AddBaseObject(Bool::True().ptr());
3237 AddBaseObject(Bool::False().ptr());
3238}
static const Bool & False()
Definition: object.h:10799
static const Bool & True()
Definition: object.h:10797
DART_NOINLINE void AddBaseObject(ObjectPtr base_object)
static ObjectPtr null()
Definition: object.h:433

◆ AssignRef()

void dart::MessageDeserializer::AssignRef ( ObjectPtr  object)
inline

Definition at line 394 of file message_snapshot.cc.

394 {
395 refs_.untag()->set_element(next_ref_index_, object);
397 }

◆ Deserialize()

ObjectPtr dart::MessageDeserializer::Deserialize ( )

Definition at line 3344 of file message_snapshot.cc.

3344 {
3345 intptr_t num_base_objects = ReadUnsigned();
3346 intptr_t num_objects = ReadUnsigned();
3347
3348 refs_ = Array::New(num_objects + kFirstReference);
3349
3351
3352 // Writer and reader must agree on number of base objects.
3353 ASSERT_EQUAL(num_base_objects, (next_ref_index_ - kFirstReference));
3354
3355 Object& error = Object::Handle(zone());
3356 for (intptr_t i = 0; i < static_cast<intptr_t>(MessagePhase::kNumPhases);
3357 i++) {
3358 intptr_t num_clusters = ReadUnsigned();
3359 MessageDeserializationCluster** clusters =
3360 zone()->Alloc<MessageDeserializationCluster*>(num_clusters);
3361 for (intptr_t i = 0; i < num_clusters; i++) {
3362 clusters[i] = ReadCluster();
3363 clusters[i]->ReadNodesWrapped(this);
3364 }
3365 for (intptr_t i = 0; i < num_clusters; i++) {
3366 clusters[i]->ReadEdges(this);
3367 }
3368 for (intptr_t i = 0; i < num_clusters; i++) {
3369 error = clusters[i]->PostLoad(this);
3370 if (error.IsError()) {
3371 return error.ptr(); // E.g., an UnwindError during rehashing.
3372 }
3373 }
3374 }
3375
3376 // We should have completely filled the ref array.
3378
3379 return ReadRef();
3380}
#define ASSERT_EQUAL(expected, actual)
Definition: assert.h:309
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
Definition: object.h:10959
MessageDeserializationCluster * ReadCluster()
ElementType * Alloc(intptr_t length)
const uint8_t uint32_t uint32_t GError ** error
static constexpr intptr_t kFirstReference

◆ isolate_group()

IsolateGroup * dart::MessageDeserializer::isolate_group ( ) const
inline

Definition at line 416 of file message_snapshot.cc.

416{ return thread_->isolate_group(); }
IsolateGroup * isolate_group() const
Definition: thread.h:541

◆ ReadRef()

ObjectPtr dart::MessageDeserializer::ReadRef ( )
inline

Definition at line 410 of file message_snapshot.cc.

410{ return Ref(ReadUnsigned()); }
ObjectPtr Ref(intptr_t index) const

◆ Ref()

ObjectPtr dart::MessageDeserializer::Ref ( intptr_t  index) const
inline

Definition at line 399 of file message_snapshot.cc.

399 {
400 ASSERT(index > 0);
401 ASSERT(index <= next_ref_index_);
402 return refs_.At(index);
403 }
ObjectPtr At(intptr_t index) const
Definition: object.h:10875
#define ASSERT(E)

◆ refs()

ArrayPtr dart::MessageDeserializer::refs ( ) const
inline

Definition at line 417 of file message_snapshot.cc.

417{ return refs_.ptr(); }
ObjectPtr ptr() const
Definition: object.h:332

◆ thread()

Thread * dart::MessageDeserializer::thread ( ) const
inline

Definition at line 415 of file message_snapshot.cc.

415{ return thread_; }

◆ UpdateRef()

void dart::MessageDeserializer::UpdateRef ( intptr_t  index,
const Object new_object 
)
inline

Definition at line 404 of file message_snapshot.cc.

404 {
405 ASSERT(index > 0);
406 ASSERT(index <= next_ref_index_);
407 refs_.SetAt(index, new_object);
408 }
void SetAt(intptr_t index, const Object &value) const
Definition: object.h:10880

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