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

Public Member Functions

 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 ()
 

Protected Attributes

Zonezone_
 
ReadStream stream_
 
MessageFinalizableDatafinalizable_data_
 
intptr_t next_ref_index_
 

Detailed Description

Definition at line 343 of file message_snapshot.cc.

Constructor & Destructor Documentation

◆ BaseDeserializer()

dart::BaseDeserializer::BaseDeserializer ( Zone zone,
Message message 
)

Definition at line 3061 of file message_snapshot.cc.

3062 : zone_(zone),
3063 stream_(message->snapshot(), message->snapshot_length()),
3064 finalizable_data_(message->finalizable_data()),
MessageFinalizableData * finalizable_data_
Win32Message message
static constexpr intptr_t kFirstReference

◆ ~BaseDeserializer()

dart::BaseDeserializer::~BaseDeserializer ( )

Definition at line 3067 of file message_snapshot.cc.

3067{}

Member Function Documentation

◆ Advance()

void dart::BaseDeserializer::Advance ( intptr_t  value)
inline

Definition at line 368 of file message_snapshot.cc.

void Advance(intptr_t value)
Definition: datastream.h:142
uint8_t value

◆ CurrentBufferAddress()

const uint8_t * dart::BaseDeserializer::CurrentBufferAddress ( ) const
inline

Definition at line 364 of file message_snapshot.cc.

364 {
366 }
const uint8_t * AddressOfCurrentPosition() const
Definition: datastream.h:140

◆ finalizable_data()

MessageFinalizableData * dart::BaseDeserializer::finalizable_data ( ) const
inline

Definition at line 374 of file message_snapshot.cc.

374{ return finalizable_data_; }

◆ next_index()

intptr_t dart::BaseDeserializer::next_index ( ) const
inline

Definition at line 373 of file message_snapshot.cc.

373{ return next_ref_index_; }

◆ Read()

template<typename T >
T dart::BaseDeserializer::Read ( )
inline

Definition at line 351 of file message_snapshot.cc.

351 {
352 return ReadStream::Raw<sizeof(T), T>::Read(&stream_);
353 }
#define T
Definition: precompiler.cc:65

◆ ReadAscii()

const char * dart::BaseDeserializer::ReadAscii ( )
inline

Definition at line 357 of file message_snapshot.cc.

357 {
358 intptr_t len = ReadUnsigned();
359 const char* result = reinterpret_cast<const char*>(CurrentBufferAddress());
360 Advance(len + 1);
361 return result;
362 }
void Advance(intptr_t value)
const uint8_t * CurrentBufferAddress() const
GAsyncResult * result

◆ ReadBytes()

void dart::BaseDeserializer::ReadBytes ( void *  addr,
intptr_t  len 
)
inline

Definition at line 356 of file message_snapshot.cc.

void ReadBytes(void *addr, intptr_t len)
Definition: datastream.h:90

◆ ReadCluster()

MessageDeserializationCluster * dart::BaseDeserializer::ReadCluster ( )

Definition at line 3139 of file message_snapshot.cc.

3139 {
3140 const uint64_t cid_and_canonical = ReadUnsigned();
3141 const intptr_t cid = (cid_and_canonical >> 1) & kMaxUint32;
3142 const bool is_canonical = (cid_and_canonical & 0x1) == 0x1;
3143
3144 Zone* Z = zone_;
3148 ASSERT(!is_canonical);
3149 return new (Z) TypedDataViewMessageDeserializationCluster(cid);
3150 }
3152 ASSERT(!is_canonical);
3153 return new (Z) ExternalTypedDataMessageDeserializationCluster(cid);
3154 }
3155 if (IsTypedDataClassId(cid)) {
3156 ASSERT(!is_canonical);
3157 return new (Z) TypedDataMessageDeserializationCluster(cid);
3158 }
3159
3160 switch (cid) {
3161 case kNativePointer:
3162 ASSERT(!is_canonical);
3163 return new (Z) NativePointerMessageDeserializationCluster();
3164 case kClassCid:
3165 ASSERT(!is_canonical);
3166 return new (Z) ClassMessageDeserializationCluster();
3167 case kTypeArgumentsCid:
3168 return new (Z) TypeArgumentsMessageDeserializationCluster(is_canonical);
3169 case kTypeCid:
3170 return new (Z) TypeMessageDeserializationCluster(is_canonical);
3171 case kSmiCid:
3172 ASSERT(is_canonical);
3173 return new (Z) SmiMessageDeserializationCluster();
3174 case kMintCid:
3175 return new (Z) MintMessageDeserializationCluster(is_canonical);
3176 case kDoubleCid:
3177 return new (Z) DoubleMessageDeserializationCluster(is_canonical);
3178 case kGrowableObjectArrayCid:
3179 ASSERT(!is_canonical);
3180 return new (Z) GrowableObjectArrayMessageDeserializationCluster();
3181 case kSendPortCid:
3182 ASSERT(!is_canonical);
3183 return new (Z) SendPortMessageDeserializationCluster();
3184 case kCapabilityCid:
3185 ASSERT(!is_canonical);
3186 return new (Z) CapabilityMessageDeserializationCluster();
3187 case kTransferableTypedDataCid:
3188 ASSERT(!is_canonical);
3189 return new (Z) TransferableTypedDataMessageDeserializationCluster();
3190 case kMapCid:
3191 case kConstMapCid:
3192 return new (Z) MapMessageDeserializationCluster(is_canonical, cid);
3193 case kSetCid:
3194 case kConstSetCid:
3195 return new (Z) SetMessageDeserializationCluster(is_canonical, cid);
3196 case kArrayCid:
3197 case kImmutableArrayCid:
3198 return new (Z) ArrayMessageDeserializationCluster(is_canonical, cid);
3199 case kOneByteStringCid:
3200 return new (Z) OneByteStringMessageDeserializationCluster(is_canonical);
3201 case kTwoByteStringCid:
3202 return new (Z) TwoByteStringMessageDeserializationCluster(is_canonical);
3203 case kInt32x4Cid:
3204 case kFloat32x4Cid:
3205 case kFloat64x2Cid:
3206 ASSERT(!is_canonical);
3207 return new (Z) Simd128MessageDeserializationCluster(cid);
3208 default:
3209 break;
3210 }
3211
3212 FATAL("No cluster defined for cid %" Pd, cid);
3213 return nullptr;
3214}
#define Z
#define ASSERT(E)
#define FATAL(error)
bool IsTypedDataViewClassId(intptr_t index)
Definition: class_id.h:439
bool IsTypedDataClassId(intptr_t index)
Definition: class_id.h:433
bool IsUnmodifiableTypedDataViewClassId(intptr_t index)
Definition: class_id.h:453
@ kNativePointer
Definition: class_id.h:218
@ kByteDataViewCid
Definition: class_id.h:244
@ kUnmodifiableByteDataViewCid
Definition: class_id.h:245
constexpr uint32_t kMaxUint32
Definition: globals.h:484
const intptr_t cid
bool IsExternalTypedDataClassId(intptr_t index)
Definition: class_id.h:447
#define Pd
Definition: globals.h:408

◆ ReadUnsigned()

intptr_t dart::BaseDeserializer::ReadUnsigned ( )
inline

Definition at line 354 of file message_snapshot.cc.

354{ return stream_.ReadUnsigned(); }

◆ ReadWordWith32BitReads()

uword dart::BaseDeserializer::ReadWordWith32BitReads ( )
inline

Definition at line 355 of file message_snapshot.cc.

uword ReadWordWith32BitReads()
Definition: datastream.h:157

◆ zone()

Zone * dart::BaseDeserializer::zone ( ) const
inline

Definition at line 372 of file message_snapshot.cc.

372{ return zone_; }

Member Data Documentation

◆ finalizable_data_

MessageFinalizableData* dart::BaseDeserializer::finalizable_data_
protected

Definition at line 379 of file message_snapshot.cc.

◆ next_ref_index_

intptr_t dart::BaseDeserializer::next_ref_index_
protected

Definition at line 380 of file message_snapshot.cc.

◆ stream_

ReadStream dart::BaseDeserializer::stream_
protected

Definition at line 378 of file message_snapshot.cc.

◆ zone_

Zone* dart::BaseDeserializer::zone_
protected

Definition at line 377 of file message_snapshot.cc.


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