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/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>

Include dependency graph for JITEmitter.cpp:

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 Documentation

#define DEBUG_TYPE   "jit"

Definition at line 15 of file JITEmitter.cpp.


Function Documentation

static void AddFunctionToSymbolTable ( const char *  FnName,
void *  FnStart,
intptr_t  FnSize 
) [static]

static unsigned GetConstantPoolSizeInBytes ( MachineConstantPool *  MCP  )  [static]

static unsigned GetJumpTableSizeInBytes ( MachineJumpTableInfo *  MJTI  )  [static]

void* getPointerToNamedFunction ( const char *  Name  ) 

static void RemoveFunctionFromSymbolTable ( void *  FnStart  )  [static]

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"   
)


Variable Documentation

ConstantPool - The constant pool for the current function.

Definition at line 479 of file JITEmitter.cpp.

Referenced by llvm::ARMRegisterInfo::emitLoadConstPool().

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

Definition at line 483 of file JITEmitter.cpp.

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.

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.

Definition at line 507 of file JITEmitter.cpp.

JumpTable - The jump tables for the current function.

Definition at line 487 of file JITEmitter.cpp.

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.

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.

std::map<void*, unsigned> revGOTMap

Definition at line 101 of file JITEmitter.cpp.

Definition at line 466 of file JITEmitter.cpp.

Definition at line 466 of file JITEmitter.cpp.

Definition at line 466 of file JITEmitter.cpp.

JITResolverState state

std::map<void*, Function*> StubToFunctionMap

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

Definition at line 63 of file JITEmitter.cpp.

JIT* TheJIT = 0 [static]

Definition at line 48 of file JITEmitter.cpp.

JITResolver* TheJITResolver [static]

Definition at line 104 of file JITEmitter.cpp.