LLVM API Documentation
#include <ARMJITInfo.h>
Public Member Functions | |
ARMJITInfo () | |
virtual void | replaceMachineCodeForFunction (void *Old, void *New) |
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 *Fn, JITCodeEmitter &JCE) |
virtual LazyResolverFn | getLazyResolverFunction (JITCompilerFn) |
getLazyResolverFunction - Expose the lazy resolver to the JIT. More... | |
virtual void | relocate (void *Function, MachineRelocation *MR, unsigned NumRelocs, unsigned char *GOTBase) |
virtual bool | hasCustomConstantPool () const |
virtual bool | hasCustomJumpTables () const |
virtual bool | allocateSeparateGVMemory () const |
void | Initialize (const MachineFunction &MF, bool isPIC) |
intptr_t | getConstantPoolEntryAddr (unsigned CPI) const |
void | addConstantPoolEntryAddr (unsigned CPI, intptr_t Addr) |
intptr_t | getJumpTableBaseAddr (unsigned JTI) const |
void | addJumpTableBaseAddr (unsigned JTI, intptr_t Addr) |
intptr_t | getPCLabelAddr (unsigned Id) const |
void | addPCLabelAddr (unsigned Id, intptr_t Addr) |
addPCLabelAddr - Remember the address of the specified PC label. More... | |
intptr_t | getIndirectSymAddr (void *Addr) const |
void | addIndirectSymAddr (void *SymAddr, intptr_t IndSymAddr) |
![]() | |
virtual | ~TargetJITInfo () |
virtual uintptr_t | getPICJumpTableEntry (uintptr_t BB, uintptr_t JTBase) |
virtual char * | allocateThreadLocalMemory (size_t size) |
bool | needsGOT () const |
Additional Inherited Members | |
![]() | |
typedef void(* | LazyResolverFn )() |
typedef void *(* | JITCompilerFn )(void *) |
![]() | |
bool | useGOT |
Definition at line 28 of file ARMJITInfo.h.
|
inlineexplicit |
Definition at line 49 of file ARMJITInfo.h.
References llvm::TargetJITInfo::useGOT.
addConstantPoolEntryAddr - Map a Constant Pool Index to the address where its associated value is stored. When relocations are processed, this value will be used to resolve references to the constant.
Definition at line 124 of file ARMJITInfo.h.
References llvm::SmallVectorTemplateCommon< T, typename >::size().
|
inline |
addIndirectSymAddr - Add a mapping from address of an emitted symbol to its indirect symbol address.
Definition at line 171 of file ARMJITInfo.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::insert().
Referenced by emitGlobalValueIndirectSym().
addJumpTableBaseAddr - Map a jump table index to the address where the corresponding inline jump table is emitted. When relocations are processed, this value will be used to resolve references to the jump table.
Definition at line 141 of file ARMJITInfo.h.
References llvm::SmallVectorTemplateCommon< T, typename >::size().
addPCLabelAddr - Remember the address of the specified PC label.
Definition at line 155 of file ARMJITInfo.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::insert().
|
inlinevirtual |
allocateSeparateGVMemory - If true, globals should be placed in separately allocated heap memory rather than in the same code memory allocated by JITCodeEmitter.
Reimplemented from llvm::TargetJITInfo.
Definition at line 94 of file ARMJITInfo.h.
|
virtual |
emitFunctionStub - Use the specified JITCodeEmitter object to emit a small native function that simply calls the function at the specified address.
Reimplemented from llvm::TargetJITInfo.
Definition at line 159 of file ARMJITInfo.cpp.
References ARMCompilationCallback(), DEBUG, llvm::JITCodeEmitter::emitAlignment(), emitGlobalValueIndirectSym(), llvm::JITCodeEmitter::emitWordLE(), llvm::errs(), F(), llvm::JITCodeEmitter::getCurrentPCValue(), getIndirectSymAddr(), llvm::Value::getName(), llvm::sys::Memory::InvalidateInstructionCache(), llvm_unreachable, llvm::sys::Memory::setRangeExecutable(), and llvm::sys::Memory::setRangeWritable().
|
virtual |
emitGlobalValueIndirectSym - Use the specified JITCodeEmitter object to emit an indirect symbol which contains the address of the specified ptr.
Reimplemented from llvm::TargetJITInfo.
Definition at line 141 of file ARMJITInfo.cpp.
References addIndirectSymAddr(), llvm::JITCodeEmitter::allocIndirectGV(), and llvm::MachineCodeEmitter::emitWordLEInto().
Referenced by emitFunctionStub().
getConstantPoolEntryAddr - The ARM target puts all constant pool entries into constant islands. This returns the address of the constant pool entry of the specified index.
Definition at line 116 of file ARMJITInfo.h.
References llvm::SmallVectorTemplateCommon< T, typename >::size().
|
inline |
getIndirectSymAddr - Retrieve the address of the indirect symbol of the specified symbol located at address. Returns 0 if the indirect symbol has not been emitted.
Definition at line 162 of file ARMJITInfo.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), and I.
Referenced by emitFunctionStub().
getJumpTableBaseAddr - The ARM target inline all jump tables within text section of the function. This returns the address of the base of the jump table of the specified index.
Definition at line 132 of file ARMJITInfo.h.
References llvm::SmallVectorTemplateCommon< T, typename >::size().
|
virtual |
getLazyResolverFunction - Expose the lazy resolver to the JIT.
Reimplemented from llvm::TargetJITInfo.
Definition at line 136 of file ARMJITInfo.cpp.
References ARMCompilationCallback(), F(), and JITCompilerFunction.
getPCLabelAddr - Retrieve the address of the PC label of the specified id.
Definition at line 148 of file ARMJITInfo.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), and I.
|
virtual |
Returns the maximum size and alignment for a call stub on this target.
Reimplemented from llvm::TargetJITInfo.
Definition at line 152 of file ARMJITInfo.cpp.
|
inlinevirtual |
hasCustomConstantPool - Allows a target to specify that constant pool address resolution is handled by the target.
Reimplemented from llvm::TargetJITInfo.
Definition at line 85 of file ARMJITInfo.h.
|
inlinevirtual |
hasCustomJumpTables - Allows a target to specify that jumptables are emitted by the target.
Reimplemented from llvm::TargetJITInfo.
Definition at line 89 of file ARMJITInfo.h.
|
inline |
Initialize - Initialize internal stage for the function being JITted. Resize constant pool ids to CONSTPOOL_ENTRY addresses map; resize jump table ids to jump table bases map; remember if codegen relocation model is PIC.
Definition at line 106 of file ARMJITInfo.h.
References llvm::MachineFunction::getInfo(), llvm::ARMFunctionInfo::getNumJumpTables(), llvm::ARMFunctionInfo::getNumPICLabels(), and llvm::SmallVectorImpl< T >::resize().
|
virtual |
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 from llvm::TargetJITInfo.
Definition at line 267 of file ARMJITInfo.cpp.
References llvm::MachineRelocation::getMachineCodeOffset(), llvm::MachineRelocation::getRelocationType(), llvm::ARMII::RegRnShift, llvm::ARM::reloc_arm_absolute, llvm::ARM::reloc_arm_branch, llvm::ARM::reloc_arm_cp_entry, llvm::ARM::reloc_arm_jt_base, llvm::ARM::reloc_arm_machine_cp_entry, llvm::ARM::reloc_arm_movt, llvm::ARM::reloc_arm_movw, llvm::ARM::reloc_arm_pic_jt, llvm::ARM::reloc_arm_relative, llvm::ARM::reloc_arm_vfp_cp_entry, and llvm::ARMII::U_BitShift.
|
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.
Implements llvm::TargetJITInfo.
Definition at line 29 of file ARMJITInfo.cpp.
References llvm::report_fatal_error().