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

Public Member Functions

 ApiMessageDeserializer (Zone *zone, Message *message)
 
 ~ApiMessageDeserializer ()
 
void AddBaseObject (Dart_CObject *base_object)
 
void AssignRef (Dart_CObject *object)
 
Dart_CObjectAllocate (Dart_CObject_Type type)
 
Dart_CObjectRef (intptr_t index) const
 
Dart_CObjectReadRef ()
 
void AddBaseObjects ()
 
Dart_CObjectDeserialize ()
 
- 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 424 of file message_snapshot.cc.

Constructor & Destructor Documentation

◆ ApiMessageDeserializer()

dart::ApiMessageDeserializer::ApiMessageDeserializer ( Zone zone,
Message message 
)
inline

Definition at line 426 of file message_snapshot.cc.

427 : BaseDeserializer(zone, message), refs_(nullptr) {}
BaseDeserializer(Zone *zone, Message *message)
Win32Message message

◆ ~ApiMessageDeserializer()

dart::ApiMessageDeserializer::~ApiMessageDeserializer ( )
inline

Definition at line 428 of file message_snapshot.cc.

428{}

Member Function Documentation

◆ AddBaseObject()

void dart::ApiMessageDeserializer::AddBaseObject ( Dart_CObject base_object)
inline

Definition at line 430 of file message_snapshot.cc.

430{ AssignRef(base_object); }
void AssignRef(Dart_CObject *object)

◆ AddBaseObjects()

void dart::ApiMessageDeserializer::AddBaseObjects ( )

Definition at line 3252 of file message_snapshot.cc.

3252 {
3262}
void AddBaseObject(Dart_CObject *base_object)
static Dart_CObject * cobj_empty_array()
static Dart_CObject * cobj_null()
static Dart_CObject cobj_transition_sentinel
static Dart_CObject cobj_empty_type_arguments
static Dart_CObject cobj_true
static Dart_CObject cobj_false
static Dart_CObject cobj_dynamic_type
static Dart_CObject cobj_void_type
static Dart_CObject cobj_sentinel

◆ Allocate()

Dart_CObject * dart::ApiMessageDeserializer::Allocate ( Dart_CObject_Type  type)
inline

Definition at line 436 of file message_snapshot.cc.

436 {
438 result->type = type;
439 return result;
440 }
GLenum type
ElementType * Alloc(intptr_t length)
GAsyncResult * result

◆ AssignRef()

void dart::ApiMessageDeserializer::AssignRef ( Dart_CObject object)
inline

Definition at line 431 of file message_snapshot.cc.

431 {
432 refs_[next_ref_index_] = object;
434 }

◆ Deserialize()

Dart_CObject * dart::ApiMessageDeserializer::Deserialize ( )

Definition at line 3382 of file message_snapshot.cc.

3382 {
3383 intptr_t num_base_objects = ReadUnsigned();
3384 intptr_t num_objects = ReadUnsigned();
3385
3386 refs_ = zone()->Alloc<Dart_CObject*>(num_objects + kFirstReference);
3387
3389
3390 // Writer and reader must agree on number of base objects.
3391 ASSERT_EQUAL(num_base_objects, (next_ref_index_ - kFirstReference));
3392
3393 for (intptr_t i = 0; i < static_cast<intptr_t>(MessagePhase::kNumPhases);
3394 i++) {
3395 intptr_t num_clusters = ReadUnsigned();
3396 MessageDeserializationCluster** clusters =
3397 zone()->Alloc<MessageDeserializationCluster*>(num_clusters);
3398 for (intptr_t i = 0; i < num_clusters; i++) {
3399 clusters[i] = ReadCluster();
3400 clusters[i]->ReadNodesWrappedApi(this);
3401 }
3402 for (intptr_t i = 0; i < num_clusters; i++) {
3403 clusters[i]->ReadEdgesApi(this);
3404 }
3405 for (intptr_t i = 0; i < num_clusters; i++) {
3406 clusters[i]->PostLoadApi(this);
3407 }
3408 }
3409
3410 // We should have completely filled the ref array.
3412
3413 return ReadRef();
3414}
#define ASSERT_EQUAL(expected, actual)
Definition: assert.h:309
MessageDeserializationCluster * ReadCluster()
static constexpr intptr_t kFirstReference

◆ ReadRef()

Dart_CObject * dart::ApiMessageDeserializer::ReadRef ( )
inline

Definition at line 448 of file message_snapshot.cc.

448{ return Ref(ReadUnsigned()); }
Dart_CObject * Ref(intptr_t index) const

◆ Ref()

Dart_CObject * dart::ApiMessageDeserializer::Ref ( intptr_t  index) const
inline

Definition at line 442 of file message_snapshot.cc.

442 {
443 ASSERT(index > 0);
444 ASSERT(index <= next_ref_index_);
445 return refs_[index];
446 }
#define ASSERT(E)

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