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

#include <mapped_resource.h>

Public Member Functions

 ElfSnapshot ()
 
 ~ElfSnapshot ()
 
 ElfSnapshot (ElfSnapshot &&other)
 
ElfSnapshotoperator= (ElfSnapshot &&other)
 
bool Load (fdio_ns_t *namespc, const std::string &path)
 
bool Load (int dirfd, const std::string &path)
 
const uint8_t * VmData () const
 
const uint8_t * VmInstrs () const
 
const uint8_t * IsolateData () const
 
const uint8_t * IsolateInstrs () const
 

Detailed Description

Definition at line 15 of file mapped_resource.h.

Constructor & Destructor Documentation

◆ ElfSnapshot() [1/2]

dart_utils::ElfSnapshot::ElfSnapshot ( )
inline

Definition at line 17 of file mapped_resource.h.

17{}

◆ ~ElfSnapshot()

dart_utils::ElfSnapshot::~ElfSnapshot ( )

Definition at line 166 of file mapped_resource.cc.

166 {
167 Dart_UnloadELF(handle_);
168}
DART_EXPORT void Dart_UnloadELF(Dart_LoadedElf *loaded)

◆ ElfSnapshot() [2/2]

dart_utils::ElfSnapshot::ElfSnapshot ( ElfSnapshot &&  other)
inline

Definition at line 19 of file mapped_resource.h.

19 : handle_(other.handle_) {
20 other.handle_ = nullptr;
21 }

Member Function Documentation

◆ IsolateData()

const uint8_t * dart_utils::ElfSnapshot::IsolateData ( ) const
inline

Definition at line 32 of file mapped_resource.h.

32{ return isolate_data_; }

◆ IsolateInstrs()

const uint8_t * dart_utils::ElfSnapshot::IsolateInstrs ( ) const
inline

Definition at line 33 of file mapped_resource.h.

33{ return isolate_instrs_; }

◆ Load() [1/2]

bool dart_utils::ElfSnapshot::Load ( fdio_ns_t *  namespc,
const std::string &  path 
)

Definition at line 132 of file mapped_resource.cc.

132 {
133 int root_dir = -1;
134 if (namespc == nullptr) {
135 root_dir = AT_FDCWD;
136 } else {
137 root_dir = fdio_ns_opendir(namespc);
138 if (root_dir < 0) {
139 FML_LOG(ERROR) << "Failed to open namespace directory";
140 return false;
141 }
142 }
143 return Load(root_dir, path);
144}
bool Load(fdio_ns_t *namespc, const std::string &path)
#define FML_LOG(severity)
Definition logging.h:82
#define ERROR(message)

◆ Load() [2/2]

bool dart_utils::ElfSnapshot::Load ( int  dirfd,
const std::string &  path 
)

Definition at line 146 of file mapped_resource.cc.

146 {
147 const int fd = OpenFdExec(path, dirfd);
148 if (fd < 0) {
149 FML_LOG(ERROR) << "Failed to open VMO for " << path << " from dir.";
150 return false;
151 }
152 return Load(fd);
153}
static int OpenFdExec(const std::string &path, int dirfd)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switches.h:57

◆ operator=()

ElfSnapshot & dart_utils::ElfSnapshot::operator= ( ElfSnapshot &&  other)
inline

Definition at line 22 of file mapped_resource.h.

22 {
23 std::swap(handle_, other.handle_);
24 return *this;
25 }

◆ VmData()

const uint8_t * dart_utils::ElfSnapshot::VmData ( ) const
inline

Definition at line 30 of file mapped_resource.h.

30{ return vm_data_; }

◆ VmInstrs()

const uint8_t * dart_utils::ElfSnapshot::VmInstrs ( ) const
inline

Definition at line 31 of file mapped_resource.h.

31{ return vm_instrs_; }

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