18 #ifndef LLVM_EXECUTIONENGINE_ORC_ORCABISUPPORT_H
19 #define LLVM_EXECUTIONENGINE_ORC_ORCABISUPPORT_H
50 unsigned NumTrampolines) {
64 unsigned MinStubs,
void *InitialPtrVal) {
66 "host support class");
78 : NumStubs(NumStubs), StubsMem(std::move(StubsMem)) {}
80 : NumStubs(
Other.NumStubs), StubsMem(std::move(
Other.StubsMem)) {
84 NumStubs =
Other.NumStubs;
86 StubsMem = std::move(
Other.StubsMem);
96 return static_cast<char *
>(StubsMem.
base()) + Idx *
StubSize;
102 char *PtrsBase =
static_cast<char *
>(StubsMem.
base()) + NumStubs *
StubSize;
103 return reinterpret_cast<void **
>(PtrsBase) + Idx;
131 unsigned NumTrampolines);
140 unsigned MinStubs,
void *InitialPtrVal);
157 unsigned NumTrampolines);
166 unsigned MinStubs,
void *InitialPtrVal);
222 unsigned NumTrampolines);
231 unsigned MinStubs,
void *InitialPtrVal);
237 #endif // LLVM_EXECUTIONENGINE_ORC_ORCABISUPPORT_H
static const unsigned TrampolineSize
static const unsigned ResolverCodeSize
JITTargetAddress(* JITReentryFn)(void *CallbackMgr, void *TrampolineId)
void * getStub(unsigned Idx) const
static const unsigned PointerSize
X86_64 code that's common to all ABIs.
void * getStub(unsigned Idx) const
Get a pointer to the stub at the given index, which must be in the range 0 .
GenericIndirectStubsInfo(unsigned NumStubs, sys::OwningMemoryBlock StubsMem)
static void writeResolverCode(uint8_t *ResolveMem, JITReentryFn Reentry, void *CallbackMgr)
Write the resolver code into the given memory.
static const unsigned StubSize
static const unsigned ResolverCodeSize
Provide information about stub blocks generated by the makeIndirectStubsBlock function.
static Error emitIndirectStubsBlock(IndirectStubsInfo &StubsInfo, unsigned MinStubs, void *InitialPtrVal)
static void writeResolverCode(uint8_t *ResolveMem, JITReentryFn Reentry, void *CallbackMgr)
Write the resolver code into the given memory.
static void writeTrampolines(uint8_t *TrampolineMem, void *ResolverAddr, unsigned NumTrampolines)
JITTargetAddress(* JITReentryFn)(void *CallbackMgr, void *TrampolineId)
X86_64 support for SysV ABI (Linux, MacOSX).
static Error emitIndirectStubsBlock(IndirectStubsInfo &StubsInfo, unsigned MinStubs, void *InitialPtrVal)
Emit at least MinStubs worth of indirect call stubs, rounded out to the nearest page size...
static void writeResolverCode(uint8_t *ResolveMem, JITReentryFn Reentry, void *CallbackMgr)
Write the resolver code into the given memory.
static const unsigned ResolverCodeSize
static const unsigned PointerSize
JITTargetAddress(* JITReentryFn)(void *CallbackMgr, void *TrampolineId)
static const unsigned TrampolineSize
static const unsigned TrampolineSize
static const unsigned PointerSize
unsigned getNumStubs() const
GenericIndirectStubsInfo(GenericIndirectStubsInfo &&Other)
static Error emitIndirectStubsBlock(IndirectStubsInfo &StubsInfo, unsigned MinStubs, void *InitialPtrVal)
Emit at least MinStubs worth of indirect call stubs, rounded out to the nearest page size...
X86_64 support for Win32.
unsigned getNumStubs() const
Number of stubs in this block.
void ** getPtr(unsigned Idx) const
Get a pointer to the implementation-pointer at the given index, which must be in the range 0 ...
static const unsigned TrampolineSize
static const unsigned ResolverCodeSize
GenericIndirectStubsInfo & operator=(GenericIndirectStubsInfo &&Other)
uint64_t JITTargetAddress
Represents an address in the target process's address space.
JITTargetAddress(* JITReentryFn)(void *CallbackMgr, void *TrampolineId)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void ** getPtr(unsigned Idx) const
static void writeResolverCode(uint8_t *ResolveMem, JITReentryFn Reentry, void *CallbackMgr)
GenericIndirectStubsInfo()
static void writeTrampolines(uint8_t *TrampolineMem, void *ResolverAddr, unsigned NumTrampolines)
Write the requsted number of trampolines into the given memory, which must be big enough to hold 1 po...
GenericIndirectStubsInfo< 8 > IndirectStubsInfo
Owning version of MemoryBlock.
static void writeResolverCode(uint8_t *ResolveMem, JITReentryFn Reentry, void *CallbackMgr)
Write the resolver code into the given memory.
GenericIndirectStubsInfo< 8 > IndirectStubsInfo
static const unsigned StubSize
static void writeTrampolines(uint8_t *TrampolineMem, void *ResolverAddr, unsigned NumTrampolines)
Write the requsted number of trampolines into the given memory, which must be big enough to hold 1 po...
Provides a library for accessing information about this process and other processes on the operating ...
static void writeTrampolines(uint8_t *TrampolineMem, void *ResolverAddr, unsigned NumTrampolines)
Write the requsted number of trampolines into the given memory, which must be big enough to hold 1 po...
Lightweight error class with error context and mandatory checking.
GenericIndirectStubsInfo< 8 > IndirectStubsInfo
JITTargetAddress(* JITReentryFn)(void *CallbackMgr, void *TrampolineId)
static const unsigned PointerSize
static const unsigned ResolverCodeSize
static Error emitIndirectStubsBlock(IndirectStubsInfo &StubsInfo, unsigned MinStubs, void *InitialPtrVal)
Emit at least MinStubs worth of indirect call stubs, rounded out to the nearest page size...