LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
llvm::TargetJITInfo Class Referenceabstract

#include <TargetJITInfo.h>

Inheritance diagram for llvm::TargetJITInfo:
Inheritance graph
[legend]
Collaboration diagram for llvm::TargetJITInfo:
Collaboration graph
[legend]

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
 

Detailed Description

TargetJITInfo - Target specific information required by the Just-In-Time code generator.

Definition at line 32 of file TargetJITInfo.h.

Member Typedef Documentation

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.

Constructor & Destructor Documentation

virtual llvm::TargetJITInfo::~TargetJITInfo ( )
inlinevirtual

Definition at line 35 of file TargetJITInfo.h.

Member Function Documentation

virtual bool llvm::TargetJITInfo::allocateSeparateGVMemory ( ) const
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().

virtual char* llvm::TargetJITInfo::allocateThreadLocalMemory ( size_t  size)
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().

virtual void* llvm::TargetJITInfo::emitFunctionStub ( const Function F,
void *  Target,
JITCodeEmitter JCE 
)
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.

virtual void* llvm::TargetJITInfo::emitGlobalValueIndirectSym ( const GlobalValue GV,
void *  ptr,
JITCodeEmitter JCE 
)
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.

virtual LazyResolverFn llvm::TargetJITInfo::getLazyResolverFunction ( JITCompilerFn  )
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.

virtual uintptr_t llvm::TargetJITInfo::getPICJumpTableEntry ( uintptr_t  BB,
uintptr_t  JTBase 
)
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.

virtual StubLayout llvm::TargetJITInfo::getStubLayout ( )
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.

virtual bool llvm::TargetJITInfo::hasCustomConstantPool ( ) const
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.

virtual bool llvm::TargetJITInfo::hasCustomJumpTables ( ) const
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.

bool llvm::TargetJITInfo::needsGOT ( ) const
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.

virtual void llvm::TargetJITInfo::relocate ( void *  Function,
MachineRelocation MR,
unsigned  NumRelocs,
unsigned char *  GOTBase 
)
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.

virtual void llvm::TargetJITInfo::replaceMachineCodeForFunction ( void *  Old,
void *  New 
)
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().

Member Data Documentation

bool llvm::TargetJITInfo::useGOT
protected

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