18 #ifndef LLVM_EXECUTIONENGINE_ORC_ORCABISUPPORT_H
19 #define LLVM_EXECUTIONENGINE_ORC_ORCABISUPPORT_H
53 unsigned NumTrampolines) {
68 unsigned MinStubs,
void *InitialPtrVal) {
70 "host support class");
82 : NumStubs(NumStubs), StubsMem(std::move(StubsMem)) {}
84 : NumStubs(
Other.NumStubs), StubsMem(std::move(
Other.StubsMem)) {
89 NumStubs =
Other.NumStubs;
91 StubsMem = std::move(
Other.StubsMem);
101 return static_cast<char *
>(StubsMem.
base()) + Idx *
StubSize;
107 char *PtrsBase =
static_cast<char *
>(StubsMem.
base()) + NumStubs *
StubSize;
108 return reinterpret_cast<void **
>(PtrsBase) + Idx;
112 unsigned NumStubs = 0;
136 unsigned NumTrampolines);
145 unsigned MinStubs,
void *InitialPtrVal);
162 unsigned NumTrampolines);
171 unsigned MinStubs,
void *InitialPtrVal);
229 unsigned NumTrampolines);
238 unsigned MinStubs,
void *InitialPtrVal);
244 #endif // LLVM_EXECUTIONENGINE_ORC_ORCABISUPPORT_H
static const unsigned TrampolineSize
static const unsigned ResolverCodeSize
void * getStub(unsigned Idx) const
JITTargetAddress(*)(void *CallbackMgr, void *TrampolineId) JITReentryFn
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)
GenericIndirectStubsInfo()=default
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.
JITTargetAddress(*)(void *CallbackMgr, void *TrampolineId) JITReentryFn
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)
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
uint64_t JITTargetAddress
Represents an address in the target process's address space.
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)
JITTargetAddress(*)(void *CallbackMgr, void *TrampolineId) JITReentryFn
JITTargetAddress(*)(void *CallbackMgr, void *TrampolineId) JITReentryFn
void ** getPtr(unsigned Idx) const
static void writeResolverCode(uint8_t *ResolveMem, JITReentryFn Reentry, void *CallbackMgr)
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...
JITTargetAddress(*)(void *CallbackMgr, void *TrampolineId) JITReentryFn
Owning version of MemoryBlock.
static void writeResolverCode(uint8_t *ResolveMem, JITReentryFn Reentry, void *CallbackMgr)
Write the resolver code into the given memory.
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...
llvm_unreachable("Unknown RegBank!")
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.
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...