LLVM 20.0.0git
|
#include "llvm/ExecutionEngine/Orc/MemoryMapper.h"
Classes | |
struct | SymbolAddrs |
Public Member Functions | |
SharedMemoryMapper (ExecutorProcessControl &EPC, SymbolAddrs SAs, size_t PageSize) | |
unsigned int | getPageSize () override |
void | reserve (size_t NumBytes, OnReservedFunction OnReserved) override |
Reserves address space in executor process. | |
char * | prepare (ExecutorAddr Addr, size_t ContentSize) override |
Provides working memory. | |
void | initialize (AllocInfo &AI, OnInitializedFunction OnInitialized) override |
Ensures executor memory is synchronized with working copy memory, sends functions to be called after initilization and before deinitialization and applies memory protections Returns a unique address identifying the allocation. | |
void | deinitialize (ArrayRef< ExecutorAddr > Allocations, OnDeinitializedFunction OnDeInitialized) override |
Runs previously specified deinitialization actions Executor addresses returned by initialize should be passed. | |
void | release (ArrayRef< ExecutorAddr > Reservations, OnReleasedFunction OnRelease) override |
Release address space acquired through reserve() | |
~SharedMemoryMapper () override | |
Public Member Functions inherited from llvm::orc::MemoryMapper | |
virtual unsigned int | getPageSize ()=0 |
virtual void | reserve (size_t NumBytes, OnReservedFunction OnReserved)=0 |
Reserves address space in executor process. | |
virtual char * | prepare (ExecutorAddr Addr, size_t ContentSize)=0 |
Provides working memory. | |
virtual void | initialize (AllocInfo &AI, OnInitializedFunction OnInitialized)=0 |
Ensures executor memory is synchronized with working copy memory, sends functions to be called after initilization and before deinitialization and applies memory protections Returns a unique address identifying the allocation. | |
virtual void | deinitialize (ArrayRef< ExecutorAddr > Allocations, OnDeinitializedFunction OnDeInitialized)=0 |
Runs previously specified deinitialization actions Executor addresses returned by initialize should be passed. | |
virtual void | release (ArrayRef< ExecutorAddr > Reservations, OnReleasedFunction OnRelease)=0 |
Release address space acquired through reserve() | |
virtual | ~MemoryMapper () |
Static Public Member Functions | |
static Expected< std::unique_ptr< SharedMemoryMapper > > | Create (ExecutorProcessControl &EPC, SymbolAddrs SAs) |
Additional Inherited Members | |
Public Types inherited from llvm::orc::MemoryMapper | |
using | OnReservedFunction = unique_function< void(Expected< ExecutorAddrRange >)> |
using | OnInitializedFunction = unique_function< void(Expected< ExecutorAddr >)> |
using | OnDeinitializedFunction = unique_function< void(Error)> |
using | OnReleasedFunction = unique_function< void(Error)> |
Definition at line 124 of file MemoryMapper.h.
llvm::orc::SharedMemoryMapper::SharedMemoryMapper | ( | ExecutorProcessControl & | EPC, |
SymbolAddrs | SAs, | ||
size_t | PageSize | ||
) |
Definition at line 197 of file MemoryMapper.cpp.
References llvm_unreachable.
|
override |
Definition at line 440 of file MemoryMapper.cpp.
|
static |
Definition at line 206 of file MemoryMapper.cpp.
References llvm::sys::Process::getPageSize(), and llvm::inconvertibleErrorCode().
|
overridevirtual |
Runs previously specified deinitialization actions Executor addresses returned by initialize should be passed.
Implements llvm::orc::MemoryMapper.
Definition at line 369 of file MemoryMapper.cpp.
References llvm::orc::ExecutorProcessControl::callSPSWrapperAsync(), llvm::cantFail(), llvm::orc::SharedMemoryMapper::SymbolAddrs::Deinitialize, llvm::orc::SharedMemoryMapper::SymbolAddrs::Instance, and llvm::orc::Result.
|
inlineoverridevirtual |
Implements llvm::orc::MemoryMapper.
Definition at line 140 of file MemoryMapper.h.
|
overridevirtual |
Ensures executor memory is synchronized with working copy memory, sends functions to be called after initilization and before deinitialization and applies memory protections Returns a unique address identifying the allocation.
This address should be passed to deinitialize to run deallocation actions (and reset permissions where possible).
Implements llvm::orc::MemoryMapper.
Definition at line 326 of file MemoryMapper.cpp.
References llvm::orc::MemoryMapper::AllocInfo::Actions, llvm::orc::tpctypes::SharedMemoryFinalizeRequest::Actions, llvm::orc::tpctypes::SharedMemorySegFinalizeRequest::Addr, assert(), llvm::sampleprof::Base, llvm::orc::ExecutorProcessControl::callSPSWrapperAsync(), llvm::cantFail(), llvm::orc::Finalize, llvm::orc::SharedMemoryMapper::SymbolAddrs::Initialize, llvm::orc::SharedMemoryMapper::SymbolAddrs::Instance, llvm::orc::MemoryMapper::AllocInfo::MappingBase, llvm::orc::tpctypes::SharedMemorySegFinalizeRequest::RAG, llvm::orc::Result, llvm::orc::MemoryMapper::AllocInfo::Segments, llvm::orc::tpctypes::SharedMemoryFinalizeRequest::Segments, and llvm::orc::tpctypes::SharedMemorySegFinalizeRequest::Size.
|
overridevirtual |
Provides working memory.
Implements llvm::orc::MemoryMapper.
Definition at line 316 of file MemoryMapper.cpp.
References Addr, assert(), and llvm::Offset.
|
overridevirtual |
Release address space acquired through reserve()
Implements llvm::orc::MemoryMapper.
Definition at line 387 of file MemoryMapper.cpp.
References llvm::sampleprof::Base, llvm::orc::ExecutorProcessControl::callSPSWrapperAsync(), llvm::cantFail(), llvm::errnoAsErrorCode(), llvm::errorCodeToError(), llvm::inconvertibleErrorCode(), llvm::orc::SharedMemoryMapper::SymbolAddrs::Instance, llvm::joinErrors(), llvm::mapWindowsError(), llvm::orc::SharedMemoryMapper::SymbolAddrs::Release, llvm::orc::Result, Size, and llvm::Error::success().
|
overridevirtual |
Reserves address space in executor process.
Implements llvm::orc::MemoryMapper.
Definition at line 220 of file MemoryMapper.cpp.
References llvm::orc::ExecutorProcessControl::callSPSWrapperAsync(), llvm::cantFail(), llvm::Data, llvm::errnoAsErrorCode(), llvm::errorCodeToError(), llvm::inconvertibleErrorCode(), llvm::orc::SharedMemoryMapper::SymbolAddrs::Instance, llvm::mapWindowsError(), llvm::orc::SharedMemoryMapper::SymbolAddrs::Reserve, and llvm::orc::Result.