LLVM API Documentation
#include "JIT.h"#include "JITDwarfEmitter.h"#include "llvm/Constants.h"#include "llvm/Module.h"#include "llvm/DerivedTypes.h"#include "llvm/CodeGen/MachineCodeEmitter.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineConstantPool.h"#include "llvm/CodeGen/MachineJumpTableInfo.h"#include "llvm/CodeGen/MachineModuleInfo.h"#include "llvm/CodeGen/MachineRelocation.h"#include "llvm/ExecutionEngine/JITMemoryManager.h"#include "llvm/ExecutionEngine/GenericValue.h"#include "llvm/Target/TargetData.h"#include "llvm/Target/TargetJITInfo.h"#include "llvm/Target/TargetMachine.h"#include "llvm/Target/TargetOptions.h"#include "llvm/Support/Debug.h"#include "llvm/Support/MutexGuard.h"#include "llvm/System/Disassembler.h"#include "llvm/System/Memory.h"#include "llvm/Target/TargetInstrInfo.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/Statistic.h"#include <algorithm>#include <iomanip>
Go to the source code of this file.
Classes | |
| struct | JitSymbolEntry |
| struct | JitSymbolTable |
Defines | |
| #define | DEBUG_TYPE "jit" |
Functions | |
| STATISTIC (NumBytes,"Number of bytes of machine code compiled") | |
| STATISTIC (NumRelos,"Number of relocations applied") | |
| static void | AddFunctionToSymbolTable (const char *FnName, void *FnStart, intptr_t FnSize) |
| static void | RemoveFunctionFromSymbolTable (void *FnStart) |
| static unsigned | GetConstantPoolSizeInBytes (MachineConstantPool *MCP) |
| static unsigned | GetJumpTableSizeInBytes (MachineJumpTableInfo *MJTI) |
| static uintptr_t | RoundUpToAlign (uintptr_t Size, unsigned Alignment) |
| void * | getPointerToNamedFunction (const char *Name) |
Variables | |
| static JIT * | TheJIT = 0 |
| #define DEBUG_TYPE "jit" |
Definition at line 15 of file JITEmitter.cpp.
| static void AddFunctionToSymbolTable | ( | const char * | FnName, | |
| void * | FnStart, | |||
| intptr_t | FnSize | |||
| ) | [static] |
Definition at line 371 of file JITEmitter.cpp.
References Entry, JitSymbolEntry::FnName, JitSymbolEntry::FnSize, JitSymbolEntry::FnStart, llvm::Intrinsic::memcpy, JitSymbolTable::NextPtr, JitSymbolTable::NumAllocated, JitSymbolTable::NumSymbols, and JitSymbolTable::Symbols.
| static unsigned GetConstantPoolSizeInBytes | ( | MachineConstantPool * | MCP | ) | [static] |
Definition at line 654 of file JITEmitter.cpp.
References llvm::MachineConstantPoolEntry::ConstVal, llvm::MachineConstantPool::getConstants(), llvm::ExecutionEngine::getTargetData(), llvm::Value::getType(), llvm::MachineConstantPoolValue::getType(), llvm::TargetData::getTypePaddedSize(), llvm::MachineConstantPoolEntry::isMachineConstantPoolEntry(), llvm::MachineConstantPoolEntry::MachineCPVal, llvm::MachineConstantPoolEntry::Offset, Ty, and llvm::MachineConstantPoolEntry::Val.
| static unsigned GetJumpTableSizeInBytes | ( | MachineJumpTableInfo * | MJTI | ) | [static] |
Definition at line 666 of file JITEmitter.cpp.
References llvm::MachineJumpTableInfo::getEntrySize(), llvm::MachineJumpTableInfo::getJumpTables(), and JT.
| void* getPointerToNamedFunction | ( | const char * | Name | ) |
Definition at line 1229 of file JITEmitter.cpp.
References llvm::ExecutionEngine::FindFunctionNamed(), llvm::JIT::getPointerToFunction(), and llvm::JIT::getPointerToNamedFunction().
| static void RemoveFunctionFromSymbolTable | ( | void * | FnStart | ) | [static] |
Definition at line 419 of file JITEmitter.cpp.
References JitSymbolEntry::FnName, JitSymbolEntry::FnStart, Index, JitSymbolTable::NumSymbols, and JitSymbolTable::Symbols.
Referenced by llvm::JIT::freeMachineCodeForFunction().
| static uintptr_t RoundUpToAlign | ( | uintptr_t | Size, | |
| unsigned | Alignment | |||
| ) | [static] |
Definition at line 679 of file JITEmitter.cpp.
| STATISTIC | ( | NumRelos | , | |
| "Number of relocations applied" | ||||
| ) |
| STATISTIC | ( | NumBytes | , | |
| "Number of bytes of machine code compiled" | ||||
| ) |
ConstantPool - The constant pool for the current function.
Definition at line 479 of file JITEmitter.cpp.
Referenced by llvm::ARMRegisterInfo::emitLoadConstPool().
| void* ConstantPoolBase |
ConstantPoolBase - A pointer to the first entry in the constant pool.
Definition at line 483 of file JITEmitter.cpp.
DE - The dwarf emitter for the jit.
Definition at line 497 of file JITEmitter.cpp.
Referenced by containsAddRecFromDifferentLoop(), llvm::MergeBlockIntoPredecessor(), RecursiveResolveTypesI(), and llvm::MemoryDependenceAnalysis::removeInstruction().
| std::map<void*, void*> ExternalFnToStubMap |
ExternalFnToStubMap - This is the equivalent of FunctionToStubMap for external functions.
Definition at line 98 of file JITEmitter.cpp.
| std::map<Function*, void*> FunctionToStubMap |
FunctionToStubMap - Keep track of the stub created for a particular function so that we can reuse them if necessary.
Definition at line 59 of file JITEmitter.cpp.
| std::map<GlobalValue*, void*> GlobalToIndirectSymMap |
GlobalToIndirectSymMap - Keep track of the indirect symbol created for a particular GlobalVariable so that we can reuse them if necessary.
Definition at line 67 of file JITEmitter.cpp.
| SmallPtrSet<const GlobalVariable*, 8> GVSet |
Definition at line 507 of file JITEmitter.cpp.
JumpTable - The jump tables for the current function.
Definition at line 487 of file JITEmitter.cpp.
| void* JumpTableBase |
JumpTableBase - A pointer to the first entry in the jump table.
Definition at line 491 of file JITEmitter.cpp.
| std::vector<uintptr_t> LabelLocations |
LabelLocations - This vector is a mapping from Label ID's to their address.
Definition at line 501 of file JITEmitter.cpp.
LazyResolverFn - The target lazy resolver function that we actually rewrite instructions to use.
Definition at line 92 of file JITEmitter.cpp.
| std::vector<uintptr_t> MBBLocations |
MBBLocations - This vector is a mapping from MBB ID's to their address. It is filled in by the StartMachineBasicBlock callback and queried by the getMachineBasicBlockAddress callback.
Definition at line 475 of file JITEmitter.cpp.
Referenced by llvm::MachOCodeEmitter::getMachineBasicBlockAddress(), and llvm::MachOCodeEmitter::StartMachineBasicBlock().
Definition at line 462 of file JITEmitter.cpp.
MMI - Machine module info for exception informations.
Definition at line 504 of file JITEmitter.cpp.
Definition at line 102 of file JITEmitter.cpp.
| std::vector<MachineRelocation> Relocations |
Relocations - These are the relocations that the function needs, as emitted.
Definition at line 470 of file JITEmitter.cpp.
Referenced by llvm::MachOCodeEmitter::addRelocation().
| JITResolver Resolver |
Resolver - This contains info about the currently resolved functions.
Definition at line 494 of file JITEmitter.cpp.
Definition at line 101 of file JITEmitter.cpp.
| unsigned char* SavedBufferBegin |
Definition at line 466 of file JITEmitter.cpp.
| unsigned char * SavedBufferEnd |
Definition at line 466 of file JITEmitter.cpp.
| unsigned char * SavedCurBufferPtr |
Definition at line 466 of file JITEmitter.cpp.
| JITResolverState state |
Definition at line 94 of file JITEmitter.cpp.
Referenced by llvm::ExecutionEngine::addGlobalMapping(), llvm::ExecutionEngine::clearAllGlobalMappings(), llvm::ExecutionEngine::clearGlobalMappingsFromModule(), llvm::ExecutionEngine::getGlobalValueAtAddress(), llvm::ExecutionEngine::getPointerToGlobal(), llvm::ExecutionEngine::getPointerToGlobalIfAvailable(), and llvm::ExecutionEngine::updateGlobalMapping().
| std::map<void*, Function*> StubToFunctionMap |
StubToFunctionMap - Keep track of the function that each stub corresponds to.
Definition at line 63 of file JITEmitter.cpp.
Definition at line 48 of file JITEmitter.cpp.
JITResolver* TheJITResolver [static] |
Definition at line 104 of file JITEmitter.cpp.