-
Notifications
You must be signed in to change notification settings - Fork 457
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
call_indirect #114
Comments
As discussed in the meeting today, @titzer is going to file a design repo PR and then we'll update ml-proto to match. |
FWIW, what's currently implemented was based on (my understanding of) As for symbolic indices, when I introduced them I didn't bother with tables The syntax for defining a function table appears to be (table
Not sure where you got that from. It's what the README says: |
Resolved in #136. |
Incorporate active/passive segments into instantiation. While doing so, drop the notion of segment types as well as initelem/initdata administrative instructions and express the latter in terms of table.init and memory.init instructions. Adjust interpreter accordingly.
This tests the `WebAssembly.Memory` constructor and the `grow` method. * Memory.buffer should be frozen and not extensible when shared * Don't check isFrozen during grow (constructor test is sufficient) * Don't check stray argument in shared memory detach test
More fixes and tests around element segments
It's unclear how to use call_indirect and it doesn't seem to align well with the design repo.
As far as I can tell, call_indirect has roughly this syntax in spec right now:
(call_indirect <table_number> <function_index> <args>)
, where:table_number
is an integer literal - symbols don't work for some non-obvious reasonfunction_index
is an expression that evaluates to an integerargs
is obviousThe
addressof
primitive expected for getting function indices does not appear to exist. My assumption is that the code generator is expected to hard-code an index as it exists in the tables defined by the module.The syntax for defining a function table appears to be
(table <table_number> <function> <function>)
where:table_number
is an integer literal - symbols fail to parse, as do bare words and quoted stringsfunction
is just a symbol or function index, like inexport
.Presumably this generates a function table with id
table_number
containing the provided functions in order, starting at 0 (1?)Various questions remain that I can't easily figure out from reading the source:
call_indirect
is a mismatch from the signature of the function the pointer is aimed at?I am probably wrong about some of this since I still haven't managed to write a functioning module that uses
call_indirect
, but I'll update once I do.The text was updated successfully, but these errors were encountered: