WebAssembly / WebAssembly/tool-conventions
Add details on function pointers to BasicCABI
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 372
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Description
I found BasicCABI when looking for documentation on what conventions LLVM uses when compiling to Wasm. I noticed that it doesn't seem to include details on function pointers.
In my own guessing by looking at the details of a compiled result, I noticed that a Wasm binary has a single table of type=funcref, elements in the table with indexes to functions, and when a function is called with a function pointer argument, the index of the element in the table is used. One point I'd like to confirm is my assumption that funcrefs always have to be in the first table in the binary as there is no table index involved when invoking.
Would it be appropriate to add information on this to BasicCABI? I can try a PR if my understanding seems correct but it may be better for someone who implemented that in LLVM to do so.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with BasicCABI.md and review the function-pointer behavior described in the issue against the relevant compiled Wasm output and LLVM conventions. Confirm the table and funcref assumptions, then document the confirmed function-pointer convention in BasicCABI.md; no specific test is mentioned.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- compilers, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100