Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dart::ImageReader Class Reference

#include <image_snapshot.h>

Inheritance diagram for dart::ImageReader:
dart::ZoneAllocated

Public Member Functions

 ImageReader (const uint8_t *data_image, const uint8_t *instructions_image)
 
ApiErrorPtr VerifyAlignment () const
 
 ONLY_IN_PRECOMPILED (uword GetBareInstructionsAt(uint32_t offset) const)
 
 ONLY_IN_PRECOMPILED (uword GetBareInstructionsEnd() const)
 
InstructionsPtr GetInstructionsAt (uint32_t offset) const
 
ObjectPtr GetObjectAt (uint32_t offset) 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)
 

Detailed Description

Definition at line 152 of file image_snapshot.h.

Constructor & Destructor Documentation

◆ ImageReader()

dart::ImageReader::ImageReader ( const uint8_t *  data_image,
const uint8_t *  instructions_image 
)

Definition at line 1927 of file image_snapshot.cc.

1929 : data_image_(ASSERT_NOTNULL(data_image)),
1930 instructions_image_(ASSERT_NOTNULL(instructions_image)) {}
#define ASSERT_NOTNULL(ptr)
Definition assert.h:323

Member Function Documentation

◆ GetInstructionsAt()

InstructionsPtr dart::ImageReader::GetInstructionsAt ( uint32_t  offset) const

Definition at line 1954 of file image_snapshot.cc.

1954 {
1955 ASSERT(!FLAG_precompiled_mode);
1957
1958 ObjectPtr result = UntaggedObject::FromAddr(
1959 reinterpret_cast<uword>(instructions_image_) + offset);
1960 ASSERT(result->IsInstructions());
1961 ASSERT(result->untag()->IsMarked());
1962
1964}
static ObjectPtr RawCast(ObjectPtr obj)
Definition object.h:325
static ObjectPtr FromAddr(uword addr)
Definition raw_object.h:495
static constexpr bool IsAligned(T x, uintptr_t alignment, uintptr_t offset=0)
Definition utils.h:77
#define ASSERT(E)
GAsyncResult * result
uintptr_t uword
Definition globals.h:501
static constexpr intptr_t kObjectAlignment
Point offset

◆ GetObjectAt()

ObjectPtr dart::ImageReader::GetObjectAt ( uint32_t  offset) const

Definition at line 1966 of file image_snapshot.cc.

1966 {
1968
1969 ObjectPtr result =
1970 UntaggedObject::FromAddr(reinterpret_cast<uword>(data_image_) + offset);
1971 ASSERT(result->untag()->IsMarked());
1972
1973 return result;
1974}

◆ ONLY_IN_PRECOMPILED() [1/2]

dart::ImageReader::ONLY_IN_PRECOMPILED ( uword GetBareInstructionsAt(uint32_t offset) const  )

◆ ONLY_IN_PRECOMPILED() [2/2]

dart::ImageReader::ONLY_IN_PRECOMPILED ( uword GetBareInstructionsEnd() const  )

◆ VerifyAlignment()

ApiErrorPtr dart::ImageReader::VerifyAlignment ( ) const

Definition at line 1932 of file image_snapshot.cc.

1932 {
1933 if (!Utils::IsAligned(data_image_, kObjectStartAlignment) ||
1934 !Utils::IsAligned(instructions_image_, kObjectStartAlignment)) {
1935 return ApiError::New(
1936 String::Handle(String::New("Snapshot is misaligned", Heap::kOld)),
1937 Heap::kOld);
1938 }
1939 return ApiError::null();
1940}
@ kOld
Definition heap.h:39
static ObjectPtr null()
Definition object.h:433
static Object & Handle()
Definition object.h:407
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
Definition object.cc:23777
static constexpr intptr_t kObjectStartAlignment

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