-
Notifications
You must be signed in to change notification settings - Fork 24
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
Implement support for indirect calls via dynexec/procref #32
Comments
It might also be good to wait for 0xPolygonMiden/miden-vm#1091 - but, of course, not necessary. |
Agreed, I think it is beneficial to wait for those changes, though we can at least lay the groundwork for indirect calls without supporting them in codegen. If it turns out that we reach a point where we have |
@bitwalker While translating the basic wallet Wasm component example PR I found a case where table is used as a parameter for module instantiation and I want to make sure we capture these semantics in the IR. The gist of it is that the table is defined (but not initialized) and used in module A in A table argument (other module's export) to a module instantiation for the module's import is concatenated on module allocation to the module's defined(local) tables. I believe we can capture these semantics in the IR by storing tables in IR |
Now that 0xPolygonMiden/miden-vm#1078 is merged (which introduces
dynexec
), the groundwork for supporting indirect calls in Miden Assembly is there. Before we can make use of it though, we need the proposedprocref
instruction, which would push the hash of a specified function name on the stack. This is done prior todynexec
, which requires that hash in order to execute the indirect call. We needprocref
because we don't know the hash of the function until after compilation, whichprocref
solves by relying on the Miden assembler to expand it intopush.HASH
as it knows the hashes of all the functions.Once that is implemented, we can make use of it to implement indirect calls in the IR:
Tasks
call_indirect
op translation #133The text was updated successfully, but these errors were encountered: