13#ifndef LLVM_EXECUTIONENGINE_ORC_MEMORYMAPPER_H 
   14#define LLVM_EXECUTIONENGINE_ORC_MEMORYMAPPER_H 
   58                        size_t ContentSize) = 0;
 
 
   95  void reserve(
size_t NumBytes, OnReservedFunction OnReserved) 
override;
 
  100                size_t ContentSize) 
override;
 
  103                    OnDeinitializedFunction OnDeInitialized) 
override;
 
  106               OnReleasedFunction OnRelease) 
override;
 
  113    std::vector<shared::WrapperFunctionCall> DeinitializationActions;
 
  119    std::vector<ExecutorAddr> Allocations;
 
  121  using ReservationMap = DenseMap<void *, Reservation>;
 
  124  ReservationMap Reservations;
 
  125  AllocationMap Allocations;
 
 
  148  void reserve(
size_t NumBytes, OnReservedFunction OnReserved) 
override;
 
  151                size_t ContentSize) 
override;
 
  156                    OnDeinitializedFunction OnDeInitialized) 
override;
 
  159               OnReleasedFunction OnRelease) 
override;
 
  170  ExecutorProcessControl &EPC;
 
  175  std::map<ExecutorAddr, Reservation> Reservations;
 
 
static cl::opt< int > PageSize("imp-null-check-page-size", cl::desc("The page size of the target in bytes"), cl::init(4096), cl::Hidden)
 
Provides a library for accessing information about this process and other processes on the operating ...
 
static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, ArrayRef< StringLiteral > StandardNames)
Initialize the set of available library functions based on the specified target triple.
 
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
 
Lightweight error class with error context and mandatory checking.
 
Tagged union holding either a T or a Error.
 
A pair of memory protections and allocation policies.
 
Represents an address in the executor process.
 
ExecutorProcessControl supports interaction with a JIT target process.
 
InProcessMemoryMapper(size_t PageSize)
 
static Expected< std::unique_ptr< InProcessMemoryMapper > > Create()
 
unsigned int getPageSize() override
 
Manages mapping, content transfer and protections for JIT memory.
 
unique_function< void(Error)> OnReleasedFunction
 
virtual char * prepare(jitlink::LinkGraph &G, ExecutorAddr Addr, size_t ContentSize)=0
Provides working memory The LinkGraph parameter is included to allow implementations to allocate work...
 
virtual unsigned int getPageSize()=0
 
virtual void release(ArrayRef< ExecutorAddr > Reservations, OnReleasedFunction OnRelease)=0
Release address space acquired through reserve()
 
virtual void initialize(AllocInfo &AI, OnInitializedFunction OnInitialized)=0
Ensures executor memory is synchronized with working copy memory, sends functions to be called after ...
 
virtual void deinitialize(ArrayRef< ExecutorAddr > Allocations, OnDeinitializedFunction OnDeInitialized)=0
Runs previously specified deinitialization actions Executor addresses returned by initialize should b...
 
virtual void reserve(size_t NumBytes, OnReservedFunction OnReserved)=0
Reserves address space in executor process.
 
unique_function< void(Expected< ExecutorAddr >)> OnInitializedFunction
 
unique_function< void(Expected< ExecutorAddrRange >)> OnReservedFunction
 
unique_function< void(Error)> OnDeinitializedFunction
 
static Expected< std::unique_ptr< SharedMemoryMapper > > Create(ExecutorProcessControl &EPC, SymbolAddrs SAs)
 
SharedMemoryMapper(ExecutorProcessControl &EPC, SymbolAddrs SAs, size_t PageSize)
 
unsigned int getPageSize() override
 
unique_function is a type-erasing functor similar to std::function.
 
std::vector< AllocActionCallPair > AllocActions
A vector of allocation actions to be run for this allocation.
 
uint64_t ExecutorAddrDiff
 
SmartMutex< false > Mutex
Mutex - A standard, always enforced mutex.
 
This is an optimization pass for GlobalISel generic memory operations.
 
Summary of memprof metadata on allocations.
 
Represents a single allocation containing multiple segments and initialization and deinitialization a...
 
std::vector< SegInfo > Segments
 
shared::AllocActions Actions
 
ExecutorAddr Deinitialize