Open keyneom opened 5 years ago
No, that's not currently possible in SimpleJIT.
Wasmtime has such a mechanism here, though it depends on functions in Wasmtime's runtime.
You can use libffi
to implement that, but the performance of this program will not be very impressive.....
In the example provided, the function signature for the to-be compiled code-string must be known in advance in order to be able to call into the function properly.
https://github.com/CraneStation/simplejit-demo/blob/4b7b8099346d877fe559dd5b593b18344d62e30d/src/toy.rs#L47
Is it possible to make a call dynamically using an array of parameters instead of being required to
mem::transmute
to the correct function signature?