17#ifndef LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_SPS_PROXYSPECS_H
18#define LLVM_EXECUTIONENGINE_ORC_RTBRIDGE_SPS_PROXYSPECS_H
28template <
typename ProxyT,
typename SPSSigT,
const char *DefaultName,
29 typename FnType =
typename ProxyT::FnType>
32template <
typename ProxyT,
typename SPSSigT,
const char *DefaultName,
33 typename RetT,
typename... ArgTs>
34class ProxySpec<ProxyT, SPSSigT, DefaultName, RetT(ArgTs...)> {
36 using CalleeRetT =
typename ProxyT::CalleeRetT;
37 using ErrorRetT =
typename ProxyT::ErrorRetT;
41 template <
typename T>
static void consumeResult(
T &V) {}
43 template <
typename T>
static void consumeResult(
Expected<T> &
E) {
48 static constexpr const char *
Name = DefaultName;
52 const ArgTs &...Args) {
53 if constexpr (std::is_void_v<CalleeRetT>) {
61 [OnComplete = std::move(OnComplete)](
Error SerErr,
62 CalleeRetT
Result)
mutable {
65 return OnComplete(std::move(SerErr));
69 return OnComplete(std::move(
Result));
122 "orc_rt_ci_sps_mem_write_uint16s";
130 "orc_rt_ci_sps_mem_write_uint32s";
138 "orc_rt_ci_sps_mem_write_uint64s";
146 "orc_rt_ci_sps_mem_write_pointers";
154 "orc_rt_ci_sps_mem_write_buffers";
189 "orc_rt_ci_sps_mem_read_pointers";
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
An ExecutionSession represents a running JIT program.
void callSPSWrapperAsync(ExecutorAddr WrapperFnAddr, SendResultT &&SendResult, const ArgTs &...Args)
Run a wrapper function using SPS to serialize the arguments and deserialize the results.
Represents an address in the executor process.
static constexpr const char * Name
static void dispatch(unique_function< void(ErrorRetT)> OnComplete, ExecutionSession &ES, ExecutorAddr CalleeAddr, const ArgTs &...Args)
SPS tag type for sequences.
unique_function is a type-erasing functor similar to std::function.
constexpr char MemWriteUInt8sCIName[]
shared::SPSSequence< uint8_t >(shared::SPSSequence< shared::SPSExecutorAddr >) MemReadUInt8sSPSSig
constexpr char MemReadStringsCIName[]
ProxySpec< rt::MemReadPointersProxy, MemReadPointersSPSSig, MemReadPointersCIName > MemReadPointersProxySpec
void(shared::SPSSequence< shared::SPSMemoryAccessBufferWrite >) MemWriteBuffersSPSSig
ProxySpec< rt::CallInt32VoidProxy, CallInt32VoidSPSSig, CallInt32VoidCIName > CallInt32VoidProxySpec
SPS proxy for rt::CallInt32VoidProxy: runs an int32_t() function in the executor.
constexpr char MemReadUInt8sCIName[]
ProxySpec< rt::CallVoidVoidProxy, CallVoidVoidSPSSig, CallVoidVoidCIName > CallVoidVoidProxySpec
SPS proxy for rt::CallVoidVoidProxy: runs a void() function in the executor.
constexpr char MemReadUInt16sCIName[]
void(shared::SPSSequence< shared::SPSMemoryAccessPointerWrite >) MemWritePointersSPSSig
shared::SPSSequence< shared::SPSString >( shared::SPSSequence< shared::SPSExecutorAddr >) MemReadStringsSPSSig
shared::SPSSequence< shared::SPSExecutorAddr >( shared::SPSSequence< shared::SPSExecutorAddr >) MemReadPointersSPSSig
void(shared::SPSExecutorAddr) CallVoidVoidSPSSig
ProxySpec< rt::MemReadStringsProxy, MemReadStringsSPSSig, MemReadStringsCIName > MemReadStringsProxySpec
int32_t(shared::SPSExecutorAddr, int32_t) CallInt32Int32SPSSig
ProxySpec< rt::MemWriteUInt32sProxy, MemWriteUInt32sSPSSig, MemWriteUInt32sCIName > MemWriteUInt32sProxySpec
ProxySpec< rt::MemWriteBuffersProxy, MemWriteBuffersSPSSig, MemWriteBuffersCIName > MemWriteBuffersProxySpec
constexpr char MemReadUInt64sCIName[]
void(shared::SPSSequence< shared::SPSMemoryAccessUInt32Write >) MemWriteUInt32sSPSSig
ProxySpec< rt::MemReadUInt64sProxy, MemReadUInt64sSPSSig, MemReadUInt64sCIName > MemReadUInt64sProxySpec
ProxySpec< rt::MemReadUInt32sProxy, MemReadUInt32sSPSSig, MemReadUInt32sCIName > MemReadUInt32sProxySpec
ProxySpec< rt::CallMainProxy, CallMainSPSSig, CallMainCIName > CallMainProxySpec
SPS proxy for rt::CallMainProxy: runs a main-like function (int(int argc, char *argv[])) in the execu...
constexpr char MemWriteUInt16sCIName[]
shared::SPSSequence< shared::SPSSequence< uint8_t > >( shared::SPSSequence< shared::SPSExecutorAddrRange >) MemReadBuffersSPSSig
constexpr char CallInt32VoidCIName[]
void(shared::SPSSequence< shared::SPSMemoryAccessUInt64Write >) MemWriteUInt64sSPSSig
ProxySpec< rt::MemWriteUInt8sProxy, MemWriteUInt8sSPSSig, MemWriteUInt8sCIName > MemWriteUInt8sProxySpec
constexpr char MemReadUInt32sCIName[]
shared::SPSSequence< uint64_t >(shared::SPSSequence< shared::SPSExecutorAddr >) MemReadUInt64sSPSSig
void(shared::SPSSequence< shared::SPSMemoryAccessUInt8Write >) MemWriteUInt8sSPSSig
constexpr char MemReadPointersCIName[]
constexpr char CallMainCIName[]
shared::SPSSequence< uint16_t >(shared::SPSSequence< shared::SPSExecutorAddr >) MemReadUInt16sSPSSig
constexpr char CallInt32Int32CIName[]
constexpr char MemWriteUInt64sCIName[]
constexpr char MemWriteBuffersCIName[]
constexpr char MemWritePointersCIName[]
ProxySpec< rt::MemReadUInt16sProxy, MemReadUInt16sSPSSig, MemReadUInt16sCIName > MemReadUInt16sProxySpec
constexpr char MemWriteUInt32sCIName[]
ProxySpec< rt::MemReadUInt8sProxy, MemReadUInt8sSPSSig, MemReadUInt8sCIName > MemReadUInt8sProxySpec
shared::SPSSequence< uint32_t >(shared::SPSSequence< shared::SPSExecutorAddr >) MemReadUInt32sSPSSig
void(shared::SPSSequence< shared::SPSMemoryAccessUInt16Write >) MemWriteUInt16sSPSSig
constexpr char CallVoidVoidCIName[]
ProxySpec< rt::MemWriteUInt64sProxy, MemWriteUInt64sSPSSig, MemWriteUInt64sCIName > MemWriteUInt64sProxySpec
int64_t(shared::SPSExecutorAddr, shared::SPSSequence< shared::SPSString >) CallMainSPSSig
constexpr char MemReadBuffersCIName[]
int32_t(shared::SPSExecutorAddr) CallInt32VoidSPSSig
ProxySpec< rt::MemWriteUInt16sProxy, MemWriteUInt16sSPSSig, MemWriteUInt16sCIName > MemWriteUInt16sProxySpec
ProxySpec< rt::MemReadBuffersProxy, MemReadBuffersSPSSig, MemReadBuffersCIName > MemReadBuffersProxySpec
ProxySpec< rt::CallInt32Int32Proxy, CallInt32Int32SPSSig, CallInt32Int32CIName > CallInt32Int32ProxySpec
SPS proxy for rt::CallInt32Int32Proxy: runs an int32_t(int32_t) function in the executor.
ProxySpec< rt::MemWritePointersProxy, MemWritePointersSPSSig, MemWritePointersCIName > MemWritePointersProxySpec
Proxy< void(ArrayRef< tpctypes::PointerWrite >)> MemWritePointersProxy
Proxy< std::vector< ExecutorAddr >(ArrayRef< ExecutorAddr >)> MemReadPointersProxy
Proxy< std::vector< uint32_t >(ArrayRef< ExecutorAddr >)> MemReadUInt32sProxy
Proxy< int32_t(ExecutorAddr, int32_t)> CallInt32Int32Proxy
Runtime-agnostic interface for running an int32_t(int32_t) function in the executor.
Proxy< std::vector< uint64_t >(ArrayRef< ExecutorAddr >)> MemReadUInt64sProxy
Proxy< std::vector< std::vector< uint8_t > >(ArrayRef< ExecutorAddrRange >)> MemReadBuffersProxy
Proxy< std::vector< std::string >(ArrayRef< ExecutorAddr >)> MemReadStringsProxy
Proxy< void(ArrayRef< tpctypes::UInt64Write >)> MemWriteUInt64sProxy
Proxy< void(ArrayRef< tpctypes::UInt8Write >)> MemWriteUInt8sProxy
Runtime-agnostic interfaces for the memory-access operations.
Proxy< void(ArrayRef< tpctypes::UInt16Write >)> MemWriteUInt16sProxy
Proxy< std::vector< uint16_t >(ArrayRef< ExecutorAddr >)> MemReadUInt16sProxy
Proxy< void(ArrayRef< tpctypes::UInt32Write >)> MemWriteUInt32sProxy
Proxy< void(ArrayRef< tpctypes::BufferWrite >)> MemWriteBuffersProxy
void consumeError(Error Err)
Consume a Error without doing anything.