mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 19:06:02 +03:00
jit bind D part and C++ stubs
This commit is contained in:
parent
b2a33a5688
commit
6734cd19f3
4 changed files with 270 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <cstddef> // size_t
|
||||
|
||||
struct Context;
|
||||
struct Slice;
|
||||
|
||||
#ifdef _WIN32
|
||||
#define EXTERNAL __declspec(dllimport) extern
|
||||
|
@ -27,6 +28,11 @@ struct Context;
|
|||
MAKE_JIT_API_CALL_IMPL(prefix, version)
|
||||
#define JIT_API_ENTRYPOINT \
|
||||
MAKE_JIT_API_CALL(rtCompileProcessImplSo, LDC_DYNAMIC_COMPILE_API_VERSION)
|
||||
#define JIT_REG_BIND_PAYLOAD \
|
||||
MAKE_JIT_API_CALL(registerBindPayloadImplSo, LDC_DYNAMIC_COMPILE_API_VERSION)
|
||||
#define JIT_UNREG_BIND_PAYLOAD \
|
||||
MAKE_JIT_API_CALL(unregisterBindPayloadImplSo, \
|
||||
LDC_DYNAMIC_COMPILE_API_VERSION)
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
@ -39,7 +45,19 @@ EXTERNAL void JIT_API_ENTRYPOINT(const void *modlist_head,
|
|||
const Context *context,
|
||||
std::size_t contextSize);
|
||||
|
||||
EXTERNAL void JIT_REG_BIND_PAYLOAD(void *handle, void *originalFunc,
|
||||
const Slice *desc, size_t descSize);
|
||||
|
||||
EXTERNAL void JIT_UNREG_BIND_PAYLOAD(void *handle);
|
||||
|
||||
void rtCompileProcessImpl(const Context *context, std::size_t contextSize) {
|
||||
JIT_API_ENTRYPOINT(dynamiccompile_modules_head, context, contextSize);
|
||||
}
|
||||
|
||||
void registerBindPayload(void *handle, void *originalFunc, const Slice *desc,
|
||||
size_t descSize) {
|
||||
JIT_REG_BIND_PAYLOAD(handle, originalFunc, desc, descSize);
|
||||
}
|
||||
|
||||
void unregisterBindPayload(void *handle) { JIT_UNREG_BIND_PAYLOAD(handle); }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue