LLVM: llvm::orc::ExecutorProcessControl Class Reference (original) (raw)

ExecutorProcessControl supports interaction with a JIT target process. More...

#include "[llvm/ExecutionEngine/Orc/ExecutorProcessControl.h](ExecutorProcessControl%5F8h%5Fsource.html)"

Classes
class IncomingWFRHandler
A handler or incoming WrapperFunctionResults – either return values from callWrapper* calls, or incoming JIT-dispatch requests. More...
struct JITDispatchInfo
Contains the address of the dispatch function and context that the ORC runtime can use to call functions in the JIT. More...
class RunAsTask
Constructs an IncomingWFRHandler from a function object by creating a new function object that dispatches the original using a TaskDispatcher, wrapping the original as a GenericNamedTask. More...
class RunInPlace
Constructs an IncomingWFRHandler from a function object that is callable as void(shared::WrapperFunctionResult). More...
Public Member Functions
ExecutorProcessControl (std::shared_ptr< SymbolStringPool > SSP, std::unique_ptr< TaskDispatcher > D)
virtual ~ExecutorProcessControl ()
ExecutionSession & getExecutionSession ()
Return the ExecutionSession associated with this instance.
SymbolStringPtr intern (StringRef SymName)
Intern a symbol name in the SymbolStringPool.
std::shared_ptr< SymbolStringPool > getSymbolStringPool () const
Return a shared pointer to the SymbolStringPool for this instance.
TaskDispatcher & getDispatcher ()
const Triple & getTargetTriple () const
Return the Triple for the target process.
unsigned getPageSize () const
Get the page size for the target process.
const JITDispatchInfo & getJITDispatchInfo () const
Get the JIT dispatch function and context address for the executor.
MemoryAccess & getMemoryAccess () const
Return a MemoryAccess object for the target process.
jitlink::JITLinkMemoryManager & getMemMgr () const
Return a JITLinkMemoryManager for the target process.
DylibManager & getDylibMgr () const
Return the DylibManager for the target process.
const StringMap< std::vector< char > > & getBootstrapMap () const
Returns the bootstrap map.
template<typename T, typename SPSTagT>
Error getBootstrapMapValue (StringRef Key, std::optional< T > &Val) const
Look up and SPS-deserialize a bootstrap map value.
const StringMap< ExecutorAddr > & getBootstrapSymbolsMap () const
Returns the bootstrap symbol map.
Error getBootstrapSymbols (ArrayRef< std::pair< ExecutorAddr &, StringRef > > Pairs) const
For each (ExecutorAddr&, StringRef) pair, looks up the string in the bootstrap symbols map and writes its address to the ExecutorAddr if found.
virtual Expected< int32_t > runAsMain (ExecutorAddr MainFnAddr, ArrayRef< std::string > Args)=0
Run function with a main-like signature.
virtual Expected< int32_t > runAsVoidFunction (ExecutorAddr VoidFnAddr)=0
Run function with a int (*)(void) signature.
virtual Expected< int32_t > runAsIntFunction (ExecutorAddr IntFnAddr, int Arg)=0
Run function with a int (*)(int) signature.
virtual void callWrapperAsync (ExecutorAddr WrapperFnAddr, IncomingWFRHandler OnComplete, ArrayRef< char > ArgBuffer)=0
Run a wrapper function in the executor.
template<typename RunPolicyT, typename FnT>
void callWrapperAsync (RunPolicyT &&Runner, ExecutorAddr WrapperFnAddr, FnT &&OnComplete, ArrayRef< char > ArgBuffer)
Run a wrapper function in the executor using the given Runner to dispatch OnComplete when the result is ready.
template<typename FnT>
void callWrapperAsync (ExecutorAddr WrapperFnAddr, FnT &&OnComplete, ArrayRef< char > ArgBuffer)
Run a wrapper function in the executor.
shared::WrapperFunctionResult callWrapper (ExecutorAddr WrapperFnAddr, ArrayRef< char > ArgBuffer)
Run a wrapper function in the executor.
template<typename SPSSignature, typename RunPolicyT, typename SendResultT, typename... ArgTs>
void callSPSWrapperAsync (RunPolicyT &&Runner, ExecutorAddr WrapperFnAddr, SendResultT &&SendResult, const ArgTs &...Args)
Run a wrapper function using SPS to serialize the arguments and deserialize the results.
template<typename SPSSignature, typename SendResultT, typename... ArgTs>
void callSPSWrapperAsync (ExecutorAddr WrapperFnAddr, SendResultT &&SendResult, const ArgTs &...Args)
Run a wrapper function using SPS to serialize the arguments and deserialize the results.
template<typename SPSSignature, typename... WrapperCallArgTs>
Error callSPSWrapper (ExecutorAddr WrapperFnAddr, WrapperCallArgTs &&...WrapperCallArgs)
Run a wrapper function using SPS to serialize the arguments and deserialize the results.
virtual Error disconnect ()=0
Disconnect from the target process.
Protected Attributes
std::shared_ptr< SymbolStringPool > SSP
std::unique_ptr< TaskDispatcher > D
ExecutionSession * ES = nullptr
Triple TargetTriple
unsigned PageSize = 0
JITDispatchInfo JDI
MemoryAccess * MemAccess = nullptr
jitlink::JITLinkMemoryManager * MemMgr = nullptr
DylibManager * DylibMgr = nullptr
StringMap< std::vector< char > > BootstrapMap
StringMap< ExecutorAddr > BootstrapSymbols
Friends
class ExecutionSession

ExecutorProcessControl supports interaction with a JIT target process.

Definition at line 38 of file ExecutorProcessControl.h.

~ExecutorProcessControl()

llvm::orc::ExecutorProcessControl::~ExecutorProcessControl ( ) virtualdefault

callSPSWrapper()

template<typename SPSSignature, typename... WrapperCallArgTs>

Error llvm::orc::ExecutorProcessControl::callSPSWrapper ( ExecutorAddr WrapperFnAddr, WrapperCallArgTs &&... WrapperCallArgs ) inline

callSPSWrapperAsync() [1/2]

template<typename SPSSignature, typename SendResultT, typename... ArgTs>

void llvm::orc::ExecutorProcessControl::callSPSWrapperAsync ( ExecutorAddr WrapperFnAddr, SendResultT && SendResult, const ArgTs &... Args ) inline

callSPSWrapperAsync() [2/2]

template<typename SPSSignature, typename RunPolicyT, typename SendResultT, typename... ArgTs>

void llvm::orc::ExecutorProcessControl::callSPSWrapperAsync ( RunPolicyT && Runner, ExecutorAddr WrapperFnAddr, SendResultT && SendResult, const ArgTs &... Args ) inline

callWrapper()

Run a wrapper function in the executor.

The wrapper function should be callable as:

FunctionAddr VTableAddr uintptr_t uintptr_t Data

{.cpp}

Definition at line 252 of file ExecutorProcessControl.h.

References callWrapperAsync().

Referenced by callSPSWrapper().

callWrapperAsync() [1/3]

template<typename FnT>

void llvm::orc::ExecutorProcessControl::callWrapperAsync ( ExecutorAddr WrapperFnAddr, FnT && OnComplete, ArrayRef< char > ArgBuffer ) inline

callWrapperAsync() [2/3]

callWrapperAsync() [3/3]

template<typename RunPolicyT, typename FnT>

void llvm::orc::ExecutorProcessControl::callWrapperAsync ( RunPolicyT && Runner, ExecutorAddr WrapperFnAddr, FnT && OnComplete, ArrayRef< char > ArgBuffer ) inline

Run a wrapper function in the executor using the given Runner to dispatch OnComplete when the result is ready.

Definition at line 231 of file ExecutorProcessControl.h.

References callWrapperAsync().

disconnect()

virtual Error llvm::orc::ExecutorProcessControl::disconnect ( ) pure virtual

getBootstrapMap()

const StringMap< std::vector< char > > & llvm::orc::ExecutorProcessControl::getBootstrapMap ( ) const inline

getBootstrapMapValue()

template<typename T, typename SPSTagT>

Error llvm::orc::ExecutorProcessControl::getBootstrapMapValue ( StringRef Key, std::optional< T > & Val ) const inline

getBootstrapSymbols()

getBootstrapSymbolsMap()

getDispatcher()

TaskDispatcher & llvm::orc::ExecutorProcessControl::getDispatcher ( ) inline

getDylibMgr()

DylibManager & llvm::orc::ExecutorProcessControl::getDylibMgr ( ) const inline

getExecutionSession()

ExecutionSession & llvm::orc::ExecutorProcessControl::getExecutionSession ( ) inline

getJITDispatchInfo()

getMemMgr()

getMemoryAccess()

MemoryAccess & llvm::orc::ExecutorProcessControl::getMemoryAccess ( ) const inline

getPageSize()

unsigned llvm::orc::ExecutorProcessControl::getPageSize ( ) const inline

getSymbolStringPool()

std::shared_ptr< SymbolStringPool > llvm::orc::ExecutorProcessControl::getSymbolStringPool ( ) const inline

getTargetTriple()

const Triple & llvm::orc::ExecutorProcessControl::getTargetTriple ( ) const inline

intern()

runAsIntFunction()

virtual Expected< int32_t > llvm::orc::ExecutorProcessControl::runAsIntFunction ( ExecutorAddr IntFnAddr, int Arg ) pure virtual

runAsMain()

runAsVoidFunction()

virtual Expected< int32_t > llvm::orc::ExecutorProcessControl::runAsVoidFunction ( ExecutorAddr VoidFnAddr) pure virtual

ExecutionSession

BootstrapMap

StringMap<std::vector<char> > llvm::orc::ExecutorProcessControl::BootstrapMap protected

BootstrapSymbols

D

DylibMgr

DylibManager* llvm::orc::ExecutorProcessControl::DylibMgr = nullptr protected

ES

JDI

MemAccess

MemoryAccess* llvm::orc::ExecutorProcessControl::MemAccess = nullptr protected

MemMgr

PageSize

unsigned llvm::orc::ExecutorProcessControl::PageSize = 0 protected

SSP

TargetTriple

Triple llvm::orc::ExecutorProcessControl::TargetTriple protected

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