LLVM 22.0.0git
llvm::orc::SharedMemoryMapper Class Referencefinal

#include "llvm/ExecutionEngine/Orc/MemoryMapper.h"

Inheritance diagram for llvm::orc::SharedMemoryMapper:
[legend]

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.
charprepare (jitlink::LinkGraph &G, ExecutorAddr Addr, size_t ContentSize) override
 Provides working memory The LinkGraph parameter is included to allow implementations to allocate working memory from the LinkGraph's allocator, in which case it will be deallocated when the LinkGraph is destroyed.
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 ~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)>

Detailed Description

Definition at line 130 of file MemoryMapper.h.

Constructor & Destructor Documentation

◆ SharedMemoryMapper()

llvm::orc::SharedMemoryMapper::SharedMemoryMapper ( ExecutorProcessControl & EPC,
SymbolAddrs SAs,
size_t PageSize )

Definition at line 207 of file MemoryMapper.cpp.

References llvm_unreachable.

◆ ~SharedMemoryMapper()

llvm::orc::SharedMemoryMapper::~SharedMemoryMapper ( )
override

Definition at line 454 of file MemoryMapper.cpp.

Member Function Documentation

◆ Create()

Expected< std::unique_ptr< SharedMemoryMapper > > llvm::orc::SharedMemoryMapper::Create ( ExecutorProcessControl & EPC,
SymbolAddrs SAs )
static

◆ deinitialize()

void llvm::orc::SharedMemoryMapper::deinitialize ( ArrayRef< ExecutorAddr > Allocations,
OnDeinitializedFunction OnDeInitialized )
overridevirtual

Runs previously specified deinitialization actions Executor addresses returned by initialize should be passed.

Implements llvm::orc::MemoryMapper.

Definition at line 382 of file MemoryMapper.cpp.

References llvm::cantFail(), and llvm::orc::Result.

◆ getPageSize()

unsigned int llvm::orc::SharedMemoryMapper::getPageSize ( )
inlineoverridevirtual

Implements llvm::orc::MemoryMapper.

Definition at line 146 of file MemoryMapper.h.

◆ initialize()

void llvm::orc::SharedMemoryMapper::initialize ( AllocInfo & AI,
OnInitializedFunction OnInitialized )
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 339 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::cantFail(), llvm::orc::Finalize, 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.

◆ prepare()

char * llvm::orc::SharedMemoryMapper::prepare ( jitlink::LinkGraph & G,
ExecutorAddr Addr,
size_t ContentSize )
overridevirtual

Provides working memory The LinkGraph parameter is included to allow implementations to allocate working memory from the LinkGraph's allocator, in which case it will be deallocated when the LinkGraph is destroyed.

Implements llvm::orc::MemoryMapper.

Definition at line 328 of file MemoryMapper.cpp.

References assert(), G, and llvm::Offset.

◆ release()

void llvm::orc::SharedMemoryMapper::release ( ArrayRef< ExecutorAddr > Reservations,
OnReleasedFunction OnRelease )
overridevirtual

◆ reserve()

void llvm::orc::SharedMemoryMapper::reserve ( size_t NumBytes,
OnReservedFunction OnReserved )
overridevirtual

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