Package org.lwjgl.llvm
Class LLVMExecutionEngine
- java.lang.Object
-
- org.lwjgl.llvm.LLVMExecutionEngine
-
public class LLVMExecutionEngine extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LLVMExecutionEngine.Functions
Contains the function pointers loaded fromLLVMCore.getLibrary()
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
LLVMAddGlobalMapping(long EE, long Global, long Addr)
static void
LLVMAddModule(long EE, long M)
static boolean
LLVMCreateExecutionEngineForModule(org.lwjgl.PointerBuffer OutEE, long M, org.lwjgl.PointerBuffer OutError)
static long
LLVMCreateGDBRegistrationListener()
static long
LLVMCreateGenericValueOfFloat(long Ty, double N)
static long
LLVMCreateGenericValueOfInt(long Ty, long N, boolean IsSigned)
static long
LLVMCreateGenericValueOfPointer(long P)
static long
LLVMCreateIntelJITEventListener()
static boolean
LLVMCreateInterpreterForModule(org.lwjgl.PointerBuffer OutInterp, long M, org.lwjgl.PointerBuffer OutError)
static boolean
LLVMCreateJITCompilerForModule(org.lwjgl.PointerBuffer OutJIT, long M, int OptLevel, org.lwjgl.PointerBuffer OutError)
static boolean
LLVMCreateMCJITCompilerForModule(org.lwjgl.PointerBuffer OutJIT, long M, LLVMMCJITCompilerOptions.Buffer Options, org.lwjgl.PointerBuffer OutError)
Create an MCJIT execution engine for a module, with the given options.static long
LLVMCreateOProfileJITEventListener()
static long
LLVMCreatePerfJITEventListener()
static long
LLVMCreateSimpleMCJITMemoryManager(long Opaque, LLVMMemoryManagerAllocateCodeSectionCallbackI AllocateCodeSection, LLVMMemoryManagerAllocateDataSectionCallbackI AllocateDataSection, LLVMMemoryManagerFinalizeMemoryCallbackI FinalizeMemory, LLVMMemoryManagerDestroyCallbackI Destroy)
Create a simple custom MCJIT memory manager.static void
LLVMDisposeExecutionEngine(long EE)
static void
LLVMDisposeGenericValue(long GenVal)
static void
LLVMDisposeMCJITMemoryManager(long MM)
static boolean
LLVMFindFunction(long EE, java.lang.CharSequence Name, org.lwjgl.PointerBuffer OutFn)
static boolean
LLVMFindFunction(long EE, java.nio.ByteBuffer Name, org.lwjgl.PointerBuffer OutFn)
static void
LLVMFreeMachineCodeForFunction(long EE, long F)
static int
LLVMGenericValueIntWidth(long GenValRef)
static double
LLVMGenericValueToFloat(long TyRef, long GenVal)
static long
LLVMGenericValueToInt(long GenVal, boolean IsSigned)
static long
LLVMGenericValueToPointer(long GenVal)
static long
LLVMGetExecutionEngineTargetData(long EE)
static long
LLVMGetExecutionEngineTargetMachine(long EE)
static long
LLVMGetFunctionAddress(long EE, java.lang.CharSequence Name)
static long
LLVMGetFunctionAddress(long EE, java.nio.ByteBuffer Name)
static long
LLVMGetGlobalValueAddress(long EE, java.lang.CharSequence Name)
static long
LLVMGetGlobalValueAddress(long EE, java.nio.ByteBuffer Name)
static long
LLVMGetPointerToGlobal(long EE, long Global)
static void
LLVMInitializeMCJITCompilerOptions(LLVMMCJITCompilerOptions.Buffer Options)
static void
LLVMLinkInInterpreter()
static void
LLVMLinkInMCJIT()
static long
LLVMRecompileAndRelinkFunction(long EE, long Fn)
static boolean
LLVMRemoveModule(long EE, long M, org.lwjgl.PointerBuffer OutMod, org.lwjgl.PointerBuffer OutError)
static long
LLVMRunFunction(long EE, long F, org.lwjgl.PointerBuffer Args)
static int
LLVMRunFunctionAsMain(long EE, long F, org.lwjgl.PointerBuffer ArgV, org.lwjgl.PointerBuffer EnvP)
static void
LLVMRunStaticConstructors(long EE)
static void
LLVMRunStaticDestructors(long EE)
static int
nLLVMCreateExecutionEngineForModule(long OutEE, long M, long OutError)
static int
nLLVMCreateInterpreterForModule(long OutInterp, long M, long OutError)
static int
nLLVMCreateJITCompilerForModule(long OutJIT, long M, int OptLevel, long OutError)
static int
nLLVMCreateMCJITCompilerForModule(long OutJIT, long M, long Options, long SizeOfOptions, long OutError)
Unsafe version of:CreateMCJITCompilerForModule
static long
nLLVMCreateSimpleMCJITMemoryManager(long Opaque, long AllocateCodeSection, long AllocateDataSection, long FinalizeMemory, long Destroy)
Unsafe version of:CreateSimpleMCJITMemoryManager
static int
nLLVMFindFunction(long EE, long Name, long OutFn)
static long
nLLVMGetFunctionAddress(long EE, long Name)
static long
nLLVMGetGlobalValueAddress(long EE, long Name)
static void
nLLVMInitializeMCJITCompilerOptions(long Options, long SizeOfOptions)
static int
nLLVMRemoveModule(long EE, long M, long OutMod, long OutError)
static long
nLLVMRunFunction(long EE, long F, int NumArgs, long Args)
static int
nLLVMRunFunctionAsMain(long EE, long F, int ArgC, long ArgV, long EnvP)
-
-
-
Method Detail
-
LLVMLinkInMCJIT
public static void LLVMLinkInMCJIT()
-
LLVMLinkInInterpreter
public static void LLVMLinkInInterpreter()
-
LLVMCreateGenericValueOfInt
public static long LLVMCreateGenericValueOfInt(long Ty, long N, boolean IsSigned)
-
LLVMCreateGenericValueOfPointer
public static long LLVMCreateGenericValueOfPointer(long P)
-
LLVMCreateGenericValueOfFloat
public static long LLVMCreateGenericValueOfFloat(long Ty, double N)
-
LLVMGenericValueIntWidth
public static int LLVMGenericValueIntWidth(long GenValRef)
-
LLVMGenericValueToInt
public static long LLVMGenericValueToInt(long GenVal, boolean IsSigned)
-
LLVMGenericValueToPointer
public static long LLVMGenericValueToPointer(long GenVal)
-
LLVMGenericValueToFloat
public static double LLVMGenericValueToFloat(long TyRef, long GenVal)
-
LLVMDisposeGenericValue
public static void LLVMDisposeGenericValue(long GenVal)
-
nLLVMCreateExecutionEngineForModule
public static int nLLVMCreateExecutionEngineForModule(long OutEE, long M, long OutError)
-
LLVMCreateExecutionEngineForModule
public static boolean LLVMCreateExecutionEngineForModule(org.lwjgl.PointerBuffer OutEE, long M, org.lwjgl.PointerBuffer OutError)
-
nLLVMCreateInterpreterForModule
public static int nLLVMCreateInterpreterForModule(long OutInterp, long M, long OutError)
-
LLVMCreateInterpreterForModule
public static boolean LLVMCreateInterpreterForModule(org.lwjgl.PointerBuffer OutInterp, long M, org.lwjgl.PointerBuffer OutError)
-
nLLVMCreateJITCompilerForModule
public static int nLLVMCreateJITCompilerForModule(long OutJIT, long M, int OptLevel, long OutError)
-
LLVMCreateJITCompilerForModule
public static boolean LLVMCreateJITCompilerForModule(org.lwjgl.PointerBuffer OutJIT, long M, int OptLevel, org.lwjgl.PointerBuffer OutError)
-
nLLVMInitializeMCJITCompilerOptions
public static void nLLVMInitializeMCJITCompilerOptions(long Options, long SizeOfOptions)
-
LLVMInitializeMCJITCompilerOptions
public static void LLVMInitializeMCJITCompilerOptions(LLVMMCJITCompilerOptions.Buffer Options)
-
nLLVMCreateMCJITCompilerForModule
public static int nLLVMCreateMCJITCompilerForModule(long OutJIT, long M, long Options, long SizeOfOptions, long OutError)
Unsafe version of:CreateMCJITCompilerForModule
-
LLVMCreateMCJITCompilerForModule
public static boolean LLVMCreateMCJITCompilerForModule(org.lwjgl.PointerBuffer OutJIT, long M, LLVMMCJITCompilerOptions.Buffer Options, org.lwjgl.PointerBuffer OutError)
Create an MCJIT execution engine for a module, with the given options. It is the responsibility of the caller to ensure that all fields inOptions
up to the givenSizeOfOptions
are initialized. It is correct to pass a smaller value ofSizeOfOptions
that omits some fields. The canonical way of using this is:LLVMMCJITCompilerOptions options; LLVMInitializeMCJITCompilerOptions(&options, sizeof(options)); ... fill in those options you care about LLVMCreateMCJITCompilerForModule(&jit, mod, &options, sizeof(options), &error);
Note that this is also correct, though possibly suboptimal:
LLVMCreateMCJITCompilerForModule(&jit, mod, 0, 0, &error);
-
LLVMDisposeExecutionEngine
public static void LLVMDisposeExecutionEngine(long EE)
-
LLVMRunStaticConstructors
public static void LLVMRunStaticConstructors(long EE)
-
LLVMRunStaticDestructors
public static void LLVMRunStaticDestructors(long EE)
-
nLLVMRunFunctionAsMain
public static int nLLVMRunFunctionAsMain(long EE, long F, int ArgC, long ArgV, long EnvP)
-
LLVMRunFunctionAsMain
public static int LLVMRunFunctionAsMain(long EE, long F, org.lwjgl.PointerBuffer ArgV, org.lwjgl.PointerBuffer EnvP)
-
nLLVMRunFunction
public static long nLLVMRunFunction(long EE, long F, int NumArgs, long Args)
-
LLVMRunFunction
public static long LLVMRunFunction(long EE, long F, org.lwjgl.PointerBuffer Args)
-
LLVMFreeMachineCodeForFunction
public static void LLVMFreeMachineCodeForFunction(long EE, long F)
-
LLVMAddModule
public static void LLVMAddModule(long EE, long M)
-
nLLVMRemoveModule
public static int nLLVMRemoveModule(long EE, long M, long OutMod, long OutError)
-
LLVMRemoveModule
public static boolean LLVMRemoveModule(long EE, long M, org.lwjgl.PointerBuffer OutMod, org.lwjgl.PointerBuffer OutError)
-
nLLVMFindFunction
public static int nLLVMFindFunction(long EE, long Name, long OutFn)
-
LLVMFindFunction
public static boolean LLVMFindFunction(long EE, java.nio.ByteBuffer Name, org.lwjgl.PointerBuffer OutFn)
-
LLVMFindFunction
public static boolean LLVMFindFunction(long EE, java.lang.CharSequence Name, org.lwjgl.PointerBuffer OutFn)
-
LLVMRecompileAndRelinkFunction
public static long LLVMRecompileAndRelinkFunction(long EE, long Fn)
-
LLVMGetExecutionEngineTargetData
public static long LLVMGetExecutionEngineTargetData(long EE)
-
LLVMGetExecutionEngineTargetMachine
public static long LLVMGetExecutionEngineTargetMachine(long EE)
-
LLVMAddGlobalMapping
public static void LLVMAddGlobalMapping(long EE, long Global, long Addr)
-
LLVMGetPointerToGlobal
public static long LLVMGetPointerToGlobal(long EE, long Global)
-
nLLVMGetGlobalValueAddress
public static long nLLVMGetGlobalValueAddress(long EE, long Name)
-
LLVMGetGlobalValueAddress
public static long LLVMGetGlobalValueAddress(long EE, java.nio.ByteBuffer Name)
-
LLVMGetGlobalValueAddress
public static long LLVMGetGlobalValueAddress(long EE, java.lang.CharSequence Name)
-
nLLVMGetFunctionAddress
public static long nLLVMGetFunctionAddress(long EE, long Name)
-
LLVMGetFunctionAddress
public static long LLVMGetFunctionAddress(long EE, java.nio.ByteBuffer Name)
-
LLVMGetFunctionAddress
public static long LLVMGetFunctionAddress(long EE, java.lang.CharSequence Name)
-
nLLVMCreateSimpleMCJITMemoryManager
public static long nLLVMCreateSimpleMCJITMemoryManager(long Opaque, long AllocateCodeSection, long AllocateDataSection, long FinalizeMemory, long Destroy)
Unsafe version of:CreateSimpleMCJITMemoryManager
-
LLVMCreateSimpleMCJITMemoryManager
public static long LLVMCreateSimpleMCJITMemoryManager(long Opaque, LLVMMemoryManagerAllocateCodeSectionCallbackI AllocateCodeSection, LLVMMemoryManagerAllocateDataSectionCallbackI AllocateDataSection, LLVMMemoryManagerFinalizeMemoryCallbackI FinalizeMemory, LLVMMemoryManagerDestroyCallbackI Destroy)
Create a simple custom MCJIT memory manager. This memory manager can intercept allocations in a module-oblivious way. This will returnNULL
if any of the passed functions areNULL
.- Parameters:
Opaque
- an opaque client object to pass back to the callbacksAllocateCodeSection
- allocate a block of memory for executable codeAllocateDataSection
- allocate a block of memory for dataFinalizeMemory
- set page permissions and flush cache. Return 0 on success, 1 on error.
-
LLVMDisposeMCJITMemoryManager
public static void LLVMDisposeMCJITMemoryManager(long MM)
-
LLVMCreateGDBRegistrationListener
public static long LLVMCreateGDBRegistrationListener()
-
LLVMCreateIntelJITEventListener
public static long LLVMCreateIntelJITEventListener()
-
LLVMCreateOProfileJITEventListener
public static long LLVMCreateOProfileJITEventListener()
-
LLVMCreatePerfJITEventListener
public static long LLVMCreatePerfJITEventListener()
-
-