Opened on 05/06/2017 at 08:33:56 AM
Closed on 05/08/2017 at 12:38:13 PM
#5216 closed change (fixed)
[emscripten] Use a more reliable way of retrieving mangled function name
Reported by: | trev | Assignee: | trev |
---|---|---|---|
Priority: | P2 | Milestone: | |
Module: | Core | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | #4122, #5137 | Platform: | Unknown / Cross platform |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description
Background
For bindings generation, we are currently using a huge hack in order to turn a function pointer into a function name. We call the function in such a way that it will crash, then extract the name from the exception stack trace. This doesn't work with a function I want to expose in #5137 because it doesn't take any parameters and doesn't use stack.
What to change
Emscripten allows using libraries implemented in JavaScript, and the code of these libraries can run within the asm.js module. This means that it can access the function tables directly, without any hacks. While this approach still relies on some implementation details, it should be way more reliable.
A commit referencing this issue has landed:
Issue 5216 - [emscripten Use a more reliable way of retrieving mangled function name]