LLVM  4.0.0
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
llvm::orc::OrcI386 Class Reference

I386 support. More...

#include <OrcABISupport.h>

Collaboration diagram for llvm::orc::OrcI386:
[legend]

Public Types

typedef
GenericIndirectStubsInfo< 8 > 
IndirectStubsInfo
 
typedef JITTargetAddress(* JITReentryFn )(void *CallbackMgr, void *TrampolineId)
 

Static Public Member Functions

static void writeResolverCode (uint8_t *ResolveMem, JITReentryFn Reentry, void *CallbackMgr)
 Write the resolver code into the given memory. More...
 
static void writeTrampolines (uint8_t *TrampolineMem, void *ResolverAddr, unsigned NumTrampolines)
 Write the requsted number of trampolines into the given memory, which must be big enough to hold 1 pointer, plus NumTrampolines trampolines. More...
 
static Error emitIndirectStubsBlock (IndirectStubsInfo &StubsInfo, unsigned MinStubs, void *InitialPtrVal)
 Emit at least MinStubs worth of indirect call stubs, rounded out to the nearest page size. More...
 

Static Public Attributes

static const unsigned PointerSize = 4
 
static const unsigned TrampolineSize = 8
 
static const unsigned ResolverCodeSize = 0x4a
 

Detailed Description

I386 support.

I386 supports lazy JITing.

Definition at line 202 of file OrcABISupport.h.

Member Typedef Documentation

Definition at line 208 of file OrcABISupport.h.

typedef JITTargetAddress(* llvm::orc::OrcI386::JITReentryFn)(void *CallbackMgr, void *TrampolineId)

Definition at line 210 of file OrcABISupport.h.

Member Function Documentation

Error llvm::orc::OrcI386::emitIndirectStubsBlock ( IndirectStubsInfo StubsInfo,
unsigned  MinStubs,
void *  InitialPtrVal 
)
static

Emit at least MinStubs worth of indirect call stubs, rounded out to the nearest page size.

E.g. Asking for 4 stubs on i386, where stubs are 8-bytes, with 4k pages will return a block of 512 stubs (4096 / 8 = 512). Asking for 513 will return a block of 1024 (2-pages worth).

Definition at line 477 of file OrcABISupport.cpp.

References llvm::sys::Memory::allocateMappedMemory(), llvm::errorCodeToError(), llvm::sys::Process::getPageSize(), I, llvm::sys::Memory::MF_EXEC, llvm::sys::Memory::MF_READ, llvm::sys::Memory::MF_WRITE, PageSize, llvm::sys::Memory::protectMappedMemory(), Ptr, llvm::orc::GenericIndirectStubsInfo< StubSizeVal >::StubSize, and llvm::Error::success().

void llvm::orc::OrcI386::writeResolverCode ( uint8_t *  ResolveMem,
JITReentryFn  Reentry,
void *  CallbackMgr 
)
static

Write the resolver code into the given memory.

The user is be responsible for allocating the memory and setting permissions.

Definition at line 417 of file OrcABISupport.cpp.

void llvm::orc::OrcI386::writeTrampolines ( uint8_t *  TrampolineMem,
void *  ResolverAddr,
unsigned  NumTrampolines 
)
static

Write the requsted number of trampolines into the given memory, which must be big enough to hold 1 pointer, plus NumTrampolines trampolines.

Definition at line 464 of file OrcABISupport.cpp.

References I, and TrampolineSize.

Member Data Documentation

const unsigned llvm::orc::OrcI386::PointerSize = 4
static

Definition at line 204 of file OrcABISupport.h.

const unsigned llvm::orc::OrcI386::ResolverCodeSize = 0x4a
static

Definition at line 206 of file OrcABISupport.h.

const unsigned llvm::orc::OrcI386::TrampolineSize = 8
static

Definition at line 205 of file OrcABISupport.h.

Referenced by writeTrampolines().


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