Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::Deserializer::Local Class Reference
Inheritance diagram for dart::Deserializer::Local:
dart::ReadStream dart::ValueObject

Public Member Functions

 Local (Deserializer *d)
 
 ~Local ()
 
ObjectPtr Ref (intptr_t index) const
 
template<typename T >
T Read ()
 
uint64_t ReadUnsigned64 ()
 
ObjectPtr ReadRef ()
 
TokenPosition ReadTokenPosition ()
 
intptr_t ReadCid ()
 
template<typename T , typename... P>
void ReadFromTo (T obj, P &&... params)
 
- Public Member Functions inherited from dart::ReadStream
 ReadStream (const uint8_t *buffer, intptr_t size)
 
 ReadStream (const uint8_t *buffer, intptr_t size, intptr_t pos)
 
void ReadBytes (void *addr, intptr_t len)
 
template<typename T = intptr_t>
T ReadUnsigned ()
 
intptr_t ReadRefId ()
 
intptr_t Position () const
 
void SetPosition (intptr_t value)
 
void Align (intptr_t alignment, intptr_t offset=0)
 
const uint8_t * AddressOfCurrentPosition () const
 
void Advance (intptr_t value)
 
intptr_t PendingBytes () const
 
template<typename T >
T Read ()
 
uword ReadWordWith32BitReads ()
 
template<typename T = uintptr_t>
C::only_if_unsigned< T, TReadLEB128 ()
 
template<typename T >
C::only_if_signed< T, TReadLEB128 ()
 
template<typename T >
C::only_if_unsigned< T, TReadSLEB128 ()
 
template<typename T = intptr_t>
C::only_if_signed< T, TReadSLEB128 ()
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

Definition at line 797 of file app_snapshot.cc.

Constructor & Destructor Documentation

◆ Local()

dart::Deserializer::Local::Local ( Deserializer d)
inlineexplicit

Definition at line 799 of file app_snapshot.cc.

800 : ReadStream(d->stream_.buffer_, d->stream_.current_, d->stream_.end_),
801 d_(d),
802 refs_(d->refs_),
803 null_(Object::null()) {
804#if defined(DEBUG)
805 // Can't mix use of Deserializer::Read*.
806 d->stream_.current_ = nullptr;
807#endif
808 }
static ObjectPtr null()
Definition: object.h:433
ReadStream(const uint8_t *buffer, intptr_t size)
Definition: datastream.h:53
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19

◆ ~Local()

dart::Deserializer::Local::~Local ( )
inline

Definition at line 809 of file app_snapshot.cc.

809{ d_->stream_.current_ = current_; }

Member Function Documentation

◆ Read()

template<typename T >
T dart::Deserializer::Local::Read ( )
inline

Definition at line 818 of file app_snapshot.cc.

818 {
819 return ReadStream::Raw<sizeof(T), T>::Read(this);
820 }
#define T
Definition: precompiler.cc:65

◆ ReadCid()

intptr_t dart::Deserializer::Local::ReadCid ( )
inline

Definition at line 828 of file app_snapshot.cc.

828 {
830 return Read<int32_t>();
831 }
COMPILE_ASSERT(kUnreachableReference==WeakTable::kNoValue)

◆ ReadFromTo()

template<typename T , typename... P>
void dart::Deserializer::Local::ReadFromTo ( T  obj,
P &&...  params 
)
inline

Definition at line 834 of file app_snapshot.cc.

834 {
835 auto* from = obj->untag()->from();
836 auto* to_snapshot = obj->untag()->to_snapshot(d_->kind(), params...);
837 auto* to = obj->untag()->to(params...);
838 for (auto* p = from; p <= to_snapshot; p++) {
839 *p = ReadRef();
840 }
841 // This is necessary because, unlike Object::Allocate, the clustered
842 // deserializer allocates object without null-initializing them. Instead,
843 // each deserialization cluster is responsible for initializing every
844 // field, ensuring that every field is written to exactly once.
845 for (auto* p = to_snapshot + 1; p <= to; p++) {
846 *p = null_;
847 }
848 }
Snapshot::Kind kind() const
const EmbeddedViewParams * params

◆ ReadRef()

ObjectPtr dart::Deserializer::Local::ReadRef ( )
inline

Definition at line 823 of file app_snapshot.cc.

823{ return Ref(ReadRefId()); }
ObjectPtr Ref(intptr_t index) const
intptr_t ReadRefId()
Definition: datastream.h:103

◆ ReadTokenPosition()

TokenPosition dart::Deserializer::Local::ReadTokenPosition ( )
inline

Definition at line 824 of file app_snapshot.cc.

824 {
825 return TokenPosition::Deserialize(Read<int32_t>());
826 }
static TokenPosition Deserialize(int32_t value)

◆ ReadUnsigned64()

uint64_t dart::Deserializer::Local::ReadUnsigned64 ( )
inline

Definition at line 821 of file app_snapshot.cc.

821{ return ReadUnsigned<uint64_t>(); }

◆ Ref()

ObjectPtr dart::Deserializer::Local::Ref ( intptr_t  index) const
inline

Definition at line 811 of file app_snapshot.cc.

811 {
812 ASSERT(index > 0);
813 ASSERT(index <= d_->num_objects_);
814 return refs_->untag()->element(index);
815 }
#define ASSERT(E)

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