Package org.lwjgl.llvm
Class LLVMExecutionEngine
java.lang.Object
org.lwjgl.llvm.LLVMExecutionEngine
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classContains the function pointers loaded fromLLVMCore.getLibrary(). -
Method Summary
Modifier and TypeMethodDescriptionstatic voidLLVMAddGlobalMapping(long EE, long Global, long Addr) static voidLLVMAddModule(long EE, long M) static booleanLLVMCreateExecutionEngineForModule(org.lwjgl.PointerBuffer OutEE, long M, org.lwjgl.PointerBuffer OutError) static longstatic longLLVMCreateGenericValueOfFloat(long Ty, double N) static longLLVMCreateGenericValueOfInt(long Ty, long N, boolean IsSigned) static longLLVMCreateGenericValueOfPointer(long P) static longstatic booleanLLVMCreateInterpreterForModule(org.lwjgl.PointerBuffer OutInterp, long M, org.lwjgl.PointerBuffer OutError) static booleanLLVMCreateJITCompilerForModule(org.lwjgl.PointerBuffer OutJIT, long M, int OptLevel, org.lwjgl.PointerBuffer OutError) static booleanLLVMCreateMCJITCompilerForModule(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 longstatic longstatic longLLVMCreateSimpleMCJITMemoryManager(long Opaque, LLVMMemoryManagerAllocateCodeSectionCallbackI AllocateCodeSection, LLVMMemoryManagerAllocateDataSectionCallbackI AllocateDataSection, LLVMMemoryManagerFinalizeMemoryCallbackI FinalizeMemory, LLVMMemoryManagerDestroyCallbackI Destroy) Create a simple custom MCJIT memory manager.static voidLLVMDisposeExecutionEngine(long EE) static voidLLVMDisposeGenericValue(long GenVal) static voidLLVMDisposeMCJITMemoryManager(long MM) static booleanLLVMExecutionEngineGetErrMsg(long EE, org.lwjgl.PointerBuffer OutError) Returns true on error, false on success.static booleanLLVMFindFunction(long EE, CharSequence Name, org.lwjgl.PointerBuffer OutFn) static booleanLLVMFindFunction(long EE, ByteBuffer Name, org.lwjgl.PointerBuffer OutFn) static voidLLVMFreeMachineCodeForFunction(long EE, long F) static intLLVMGenericValueIntWidth(long GenValRef) static doubleLLVMGenericValueToFloat(long TyRef, long GenVal) static longLLVMGenericValueToInt(long GenVal, boolean IsSigned) static longLLVMGenericValueToPointer(long GenVal) static longLLVMGetExecutionEngineTargetData(long EE) static longLLVMGetExecutionEngineTargetMachine(long EE) static longLLVMGetFunctionAddress(long EE, CharSequence Name) static longLLVMGetFunctionAddress(long EE, ByteBuffer Name) static longLLVMGetGlobalValueAddress(long EE, CharSequence Name) static longLLVMGetGlobalValueAddress(long EE, ByteBuffer Name) static longLLVMGetPointerToGlobal(long EE, long Global) static voidstatic voidstatic voidstatic longLLVMRecompileAndRelinkFunction(long EE, long Fn) static booleanLLVMRemoveModule(long EE, long M, org.lwjgl.PointerBuffer OutMod, org.lwjgl.PointerBuffer OutError) static longLLVMRunFunction(long EE, long F, org.lwjgl.PointerBuffer Args) static intLLVMRunFunctionAsMain(long EE, long F, org.lwjgl.PointerBuffer ArgV, org.lwjgl.PointerBuffer EnvP) static voidLLVMRunStaticConstructors(long EE) static voidLLVMRunStaticDestructors(long EE) static intnLLVMCreateExecutionEngineForModule(long OutEE, long M, long OutError) static intnLLVMCreateInterpreterForModule(long OutInterp, long M, long OutError) static intnLLVMCreateJITCompilerForModule(long OutJIT, long M, int OptLevel, long OutError) static intnLLVMCreateMCJITCompilerForModule(long OutJIT, long M, long Options, long SizeOfOptions, long OutError) Unsafe version of:CreateMCJITCompilerForModulestatic longnLLVMCreateSimpleMCJITMemoryManager(long Opaque, long AllocateCodeSection, long AllocateDataSection, long FinalizeMemory, long Destroy) Unsafe version of:CreateSimpleMCJITMemoryManagerstatic intnLLVMExecutionEngineGetErrMsg(long EE, long OutError) Unsafe version of:ExecutionEngineGetErrMsgstatic intnLLVMFindFunction(long EE, long Name, long OutFn) static longnLLVMGetFunctionAddress(long EE, long Name) static longnLLVMGetGlobalValueAddress(long EE, long Name) static voidnLLVMInitializeMCJITCompilerOptions(long Options, long SizeOfOptions) static intnLLVMRemoveModule(long EE, long M, long OutMod, long OutError) static longnLLVMRunFunction(long EE, long F, int NumArgs, long Args) static intnLLVMRunFunctionAsMain(long EE, long F, int ArgC, long ArgV, long EnvP)
-
Method Details
-
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
-
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 inOptionsup to the givenSizeOfOptionsare initialized. It is correct to pass a smaller value ofSizeOfOptionsthat 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
-
LLVMFindFunction
-
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
-
LLVMGetGlobalValueAddress
-
nLLVMGetFunctionAddress
public static long nLLVMGetFunctionAddress(long EE, long Name) -
LLVMGetFunctionAddress
-
LLVMGetFunctionAddress
-
nLLVMExecutionEngineGetErrMsg
public static int nLLVMExecutionEngineGetErrMsg(long EE, long OutError) Unsafe version of:ExecutionEngineGetErrMsg -
LLVMExecutionEngineGetErrMsg
public static boolean LLVMExecutionEngineGetErrMsg(long EE, org.lwjgl.PointerBuffer OutError) Returns true on error, false on success. If true is returned then the error message is copied toOutStrand cleared in theExecutionEngineinstance.- Since:
- 11
-
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 returnNULLif 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()
-