Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to call JIT-compiled function without hard-coding function signature with mem::transmute #8

Open
keyneom opened this issue Mar 6, 2019 · 2 comments

Comments

@keyneom
Copy link

keyneom commented Mar 6, 2019

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?

@sunfishcode
Copy link
Member

No, that's not currently possible in SimpleJIT.

Wasmtime has such a mechanism here, though it depends on functions in Wasmtime's runtime.

@Cy6er7um
Copy link

You can use libffi to implement that, but the performance of this program will not be very impressive.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants