-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add public Compiler::get_published_trampoline #243
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
Add public Compiler::get_published_trampoline #243
Conversation
|
@yurydelendik would it be possible to add a test for this that's run as part of |
| }) | ||
| } | ||
|
|
||
| /// Create and publish a trampoline for invoking a function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment to get_trampoline mentioning that the code it returns needs to be published (with publish_compiled_code) before it can be executed, and pointing to get_published_trampoline as a way to have this done automatically?
And, we should mention that calling get_published_trampoline many times will use memory inefficiently, because publishing between each trampoline creation means we'll use a whole page for each trampoline. When feasible, it's preferable to create all the trampolines (with get_trampoline) first, and then call publish_compiled_code once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, looking at this more, get_trampoline and publish_compiled_code are not public functions, so these comments wouldn't immediately make sense. I think this is a symptom of cranelift-jit not being entirely clear about what level of API it wants to be. Hopefully we'll sort all this out with the new APIs.
|
@tschneidereit This a step toward while I'm starting to see can be a much larger API refactoring, after which I expect it'll be easier to write tests. So my instinct is to move forward with this for now. |
Ok, that makes sense to me! |
…e#243) Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Make zkasm_runner public
Generate CLIF instruction Wasm tags as an ISLE file. Updates avanhatt#47
Typical invoke operation requires instant access to the generated trampoline code:
https://github.com/CraneStation/wasmtime/blob/master/wasmtime-jit/src/action.rs#L181-L187
This patch also exposes that for wasmtime users.