LLVM API Documentation

JITEmitter.cpp File Reference

#include "JIT.h"
#include "JITDwarfEmitter.h"
#include "llvm/Constants.h"
#include "llvm/Module.h"
#include "llvm/DerivedTypes.h"
#include "llvm/CodeGen/JITCodeEmitter.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/GenericValue.h"
#include "llvm/ExecutionEngine/JITEventListener.h"
#include "llvm/ExecutionEngine/JITMemoryManager.h"
#include "llvm/CodeGen/MachineCodeInfo.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/ErrorHandling.h"
#include "llvm/Support/MutexGuard.h"
#include "llvm/Support/ValueHandle.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/System/Disassembler.h"
#include "llvm/System/Memory.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include <algorithm>
#include <iomanip>

Include dependency graph for JITEmitter.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "jit"

Functions

 STATISTIC (NumBytes,"Number of bytes of machine code compiled")
 STATISTIC (NumRelos,"Number of relocations applied")
 STATISTIC (NumRetries,"Number of retries with more memory")
static unsigned GetConstantPoolSizeInBytes (MachineConstantPool *MCP, const TargetData *TD)
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 Documentation

#define DEBUG_TYPE   "jit"

Definition at line 15 of file JITEmitter.cpp.


Function Documentation

static unsigned GetConstantPoolSizeInBytes ( MachineConstantPool *  MCP,
const TargetData *  TD 
) [static]

static unsigned GetJumpTableSizeInBytes ( MachineJumpTableInfo *  MJTI  )  [static]

void* getPointerToNamedFunction ( const char *  Name  ) 

static uintptr_t RoundUpToAlign ( uintptr_t  Size,
unsigned  Alignment 
) [static]

Definition at line 745 of file JITEmitter.cpp.

STATISTIC ( NumRetries  ,
"Number of retries with more memory"   
)

STATISTIC ( NumRelos  ,
"Number of relocations applied"   
)

STATISTIC ( NumBytes  ,
"Number of bytes of machine code compiled"   
)


Variable Documentation

ConstantPool - The constant pool for the current function.

Definition at line 446 of file JITEmitter.cpp.

Referenced by llvm::Thumb2RegisterInfo::emitLoadConstPool(), llvm::Thumb1RegisterInfo::emitLoadConstPool(), and llvm::ARMBaseRegisterInfo::emitLoadConstPool().

ConstantPoolBase - A pointer to the first entry in the constant pool.

Definition at line 450 of file JITEmitter.cpp.

ConstPoolAddresses - Addresses of individual constant pool entries.

Definition at line 454 of file JITEmitter.cpp.

const Function* CurFn

Definition at line 482 of file JITEmitter.cpp.

Definition at line 492 of file JITEmitter.cpp.

Information about emitted code, which is passed to the JITEventListeners. This is reset in startFunction and used in finishFunction.

Definition at line 487 of file JITEmitter.cpp.

std::map<void*, void*> ExternalFnToStubMap

ExternalFnToStubMap - This is the equivalent of FunctionToStubMap for external functions.

Definition at line 112 of file JITEmitter.cpp.

Definition at line 501 of file JITEmitter.cpp.

FunctionToStubMapTy FunctionToStubMap

FunctionToStubMap - Keep track of the stub created for a particular function so that we can reuse them if necessary.

Definition at line 70 of file JITEmitter.cpp.

GlobalToIndirectSymMapTy GlobalToIndirectSymMap

GlobalToIndirectSymMap - Keep track of the indirect symbol created for a particular GlobalVariable so that we can reuse them if necessary.

Definition at line 78 of file JITEmitter.cpp.

Definition at line 478 of file JITEmitter.cpp.

JumpTable - The jump tables for the current function.

Definition at line 458 of file JITEmitter.cpp.

JumpTableBase - A pointer to the first entry in the jump table.

Definition at line 462 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 472 of file JITEmitter.cpp.

LazyResolverFn - The target lazy resolver function that we actually rewrite instructions to use.

Definition at line 106 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 442 of file JITEmitter.cpp.

Definition at line 423 of file JITEmitter.cpp.

MMI - Machine module info for exception informations.

Definition at line 475 of file JITEmitter.cpp.

Definition at line 116 of file JITEmitter.cpp.

Definition at line 503 of file JITEmitter.cpp.

Relocations - These are the relocations that the function needs, as emitted.

Definition at line 437 of file JITEmitter.cpp.

JITResolver Resolver

Resolver - This contains info about the currently resolved functions.

Definition at line 465 of file JITEmitter.cpp.

std::map<void*, unsigned> revGOTMap

revGOTMap - map addresses to indexes in the GOT

Definition at line 115 of file JITEmitter.cpp.

uint8_t* SavedBufferBegin

Definition at line 427 of file JITEmitter.cpp.

uint8_t * SavedBufferEnd

Definition at line 427 of file JITEmitter.cpp.

uint8_t * SavedCurBufferPtr

Definition at line 427 of file JITEmitter.cpp.

uintptr_t SizeEstimate

Definition at line 433 of file JITEmitter.cpp.

JITResolverState state

Definition at line 108 of file JITEmitter.cpp.

DenseMap<void *, SmallPtrSet<const Function*, 1> > StubFnRefs

Definition at line 497 of file JITEmitter.cpp.

StubToFunctionMapTy StubToFunctionMap

StubToFunctionMap - Keep track of the function that each stub corresponds to.

Definition at line 74 of file JITEmitter.cpp.

JIT* TheJIT = 0 [static]

Definition at line 55 of file JITEmitter.cpp.

JITResolver* TheJITResolver [static]

Definition at line 118 of file JITEmitter.cpp.