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

optimized small functions that can be directly called #3

Open
gerdstolpmann opened this issue May 31, 2021 · 0 comments
Open

optimized small functions that can be directly called #3

gerdstolpmann opened this issue May 31, 2021 · 0 comments

Comments

@gerdstolpmann
Copy link
Collaborator

As an extension of #2:

A second function definition is provided for small functions that can be directly called. This second definition passes one OCaml arg per Wasm arg:

function letrecX_direct(i32 envptr, i32 param1, i32 param2, ...) : i32

This shall only be done if:

  • there are no allocations
  • the number of args is small
  • the size of the function body is small
  • no incompatible features like APPLY and APPTERM

Also, note that fp is unavailable. So nothing can be stored on the stack. Because there are no allocations, all intermediate values can be put into local variables.

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

No branches or pull requests

1 participant