LLVM API Documentation
#include <TargetJITInfo.h>
Classes | |
struct | StubLayout |
Records the required size and alignment for a call stub in bytes. More... | |
Public Types | |
typedef void(* | LazyResolverFn )() |
typedef void *(* | JITCompilerFn )(void *) |
Public Member Functions | |
virtual | ~TargetJITInfo () |
virtual void | replaceMachineCodeForFunction (void *Old, void *New)=0 |
virtual void * | emitGlobalValueIndirectSym (const GlobalValue *GV, void *ptr, JITCodeEmitter &JCE) |
virtual StubLayout | getStubLayout () |
Returns the maximum size and alignment for a call stub on this target. More... | |
virtual void * | emitFunctionStub (const Function *F, void *Target, JITCodeEmitter &JCE) |
virtual uintptr_t | getPICJumpTableEntry (uintptr_t BB, uintptr_t JTBase) |
virtual LazyResolverFn | getLazyResolverFunction (JITCompilerFn) |
virtual void | relocate (void *Function, MachineRelocation *MR, unsigned NumRelocs, unsigned char *GOTBase) |
virtual char * | allocateThreadLocalMemory (size_t size) |
bool | needsGOT () const |
virtual bool | hasCustomConstantPool () const |
virtual bool | hasCustomJumpTables () const |
virtual bool | allocateSeparateGVMemory () const |
Protected Attributes | |
bool | useGOT |
TargetJITInfo - Target specific information required by the Just-In-Time code generator.
Definition at line 32 of file TargetJITInfo.h.
typedef void*(* llvm::TargetJITInfo::JITCompilerFn)(void *) |
JITCompilerFn - This typedef is used to represent the JIT function that lazily compiles the function corresponding to a stub. The JIT keeps track of the mapping between stubs and LLVM Functions, the target provides the ability to figure out the address of a stub that is called by the LazyResolverFn.
Definition at line 90 of file TargetJITInfo.h.
typedef void(* llvm::TargetJITInfo::LazyResolverFn)() |
LazyResolverFn - This typedef is used to represent the function that unresolved call points should invoke. This is a target specific function that knows how to walk the stack and find out which stub the call is coming from.
Definition at line 83 of file TargetJITInfo.h.
|
inlinevirtual |
Definition at line 35 of file TargetJITInfo.h.
|
inlinevirtual |
allocateSeparateGVMemory - If true, globals should be placed in separately allocated heap memory rather than in the same code memory allocated by JITCodeEmitter.
Reimplemented in llvm::ARMJITInfo.
Definition at line 131 of file TargetJITInfo.h.
Referenced by llvm::JIT::getMemoryForGV().
|
inlinevirtual |
allocateThreadLocalMemory - Each target has its own way of handling thread local variables. This method returns a value only meaningful to the target.
Reimplemented in llvm::X86JITInfo.
Definition at line 112 of file TargetJITInfo.h.
References llvm_unreachable.
Referenced by llvm::JIT::getMemoryForGV().
|
inlinevirtual |
emitFunctionStub - Use the specified JITCodeEmitter object to emit a small native function that simply calls the function at the specified address. The JITCodeEmitter must already have storage allocated for the stub. Return the address of the resultant function, which may have been aligned from the address the JCE was set up to emit at.
Reimplemented in llvm::ARMJITInfo, llvm::X86JITInfo, llvm::MipsJITInfo, llvm::SparcJITInfo, and llvm::PPCJITInfo.
Definition at line 68 of file TargetJITInfo.h.
References llvm_unreachable.
|
inlinevirtual |
emitGlobalValueIndirectSym - Use the specified JITCodeEmitter object to emit an indirect symbol which contains the address of the specified ptr.
Reimplemented in llvm::ARMJITInfo, and llvm::X86JITInfo.
Definition at line 47 of file TargetJITInfo.h.
References llvm_unreachable.
|
inlinevirtual |
getLazyResolverFunction - This method is used to initialize the JIT, giving the target the function that should be used to compile a function, and giving the JIT the target function used to do the lazy resolving.
Reimplemented in llvm::ARMJITInfo, llvm::X86JITInfo, llvm::MipsJITInfo, llvm::SparcJITInfo, and llvm::PPCJITInfo.
Definition at line 96 of file TargetJITInfo.h.
References llvm_unreachable.
|
inlinevirtual |
getPICJumpTableEntry - Returns the value of the jumptable entry for the specific basic block.
Reimplemented in llvm::X86JITInfo.
Definition at line 75 of file TargetJITInfo.h.
References llvm_unreachable.
|
inlinevirtual |
Returns the maximum size and alignment for a call stub on this target.
Reimplemented in llvm::ARMJITInfo, llvm::X86JITInfo, llvm::MipsJITInfo, llvm::SparcJITInfo, and llvm::PPCJITInfo.
Definition at line 59 of file TargetJITInfo.h.
References llvm_unreachable.
|
inlinevirtual |
hasCustomConstantPool - Allows a target to specify that constant pool address resolution is handled by the target.
Reimplemented in llvm::ARMJITInfo.
Definition at line 122 of file TargetJITInfo.h.
|
inlinevirtual |
hasCustomJumpTables - Allows a target to specify that jumptables are emitted by the target.
Reimplemented in llvm::ARMJITInfo.
Definition at line 126 of file TargetJITInfo.h.
|
inline |
needsGOT - Allows a target to specify that it would like the JIT to manage a GOT for it.
Definition at line 118 of file TargetJITInfo.h.
References useGOT.
|
inlinevirtual |
relocate - Before the JIT can run a block of code that has been emitted, it must rewrite the code to contain the actual addresses of any referenced global symbols.
Reimplemented in llvm::ARMJITInfo, llvm::X86JITInfo, llvm::MipsJITInfo, llvm::SparcJITInfo, and llvm::PPCJITInfo.
Definition at line 103 of file TargetJITInfo.h.
|
pure virtual |
replaceMachineCodeForFunction - Make it so that calling the function whose machine code is at OLD turns into a call to NEW, perhaps by overwriting OLD with a branch to NEW. This is used for self-modifying code.
Implemented in llvm::ARMJITInfo, llvm::PPCJITInfo, llvm::MipsJITInfo, llvm::X86JITInfo, and llvm::SparcJITInfo.
Referenced by llvm::JIT::recompileAndRelinkFunction().
|
protected |
Definition at line 133 of file TargetJITInfo.h.
Referenced by llvm::ARMJITInfo::ARMJITInfo(), needsGOT(), llvm::PPCJITInfo::PPCJITInfo(), and llvm::X86JITInfo::X86JITInfo().