Closed dherman closed 10 years ago
There are several asm.js demos, so clearly function pointers work, but the spec doesn't mention them. So how do they work? :)
Just like function pointers in emscripten in general - function pointers are indexes into a table of functions. There is a separate table for each function type though, mandated by asm.
For each function type? Wow, why is that? That might make embind trickier.
Can you point me to where this is in the spec?
Sent from my iPhone
On Mar 25, 2013, at 3:29 PM, Alon Zakai notifications@github.com wrote:
Just like function pointers in emscripten in general - function pointers are indexes into a table of functions. There is a separate table for each function type though, mandated by asm.
— Reply to this email directly or view it on GitHub.
Hm, I think I understand why it's necessary to segregate function tables now. Indeed, this will make embind tricky, but I'll reach out directly when it's time to bring embind to asm.js.
Sent from my iPhone
On Mar 25, 2013, at 3:44 PM, Chad Austin chad@imvu.com wrote:
For each function type? Wow, why is that? That might make embind trickier.
Can you point me to where this is in the spec?
Sent from my iPhone
On Mar 25, 2013, at 3:29 PM, Alon Zakai notifications@github.com wrote:
Just like function pointers in emscripten in general - function pointers are indexes into a table of functions. There is a separate table for each function type though, mandated by asm.
— Reply to this email directly or view it on GitHub.
This is in the spec now.
I've just looked at the asm.js spec at http://asmjs.org/spec/latest/#value-types , and there is no provision for function pointers as values. Why was this closed?
What was added was support for function tables:
http://asmjs.org/spec/latest/#function-table-types
Function tables and indices thereinto can provide function-pointer functionality.
Add support for function pointers.