summaryrefslogtreecommitdiff
path: root/test/lld/main_module_table_3.wat
Commit message (Collapse)AuthorAgeFilesLines
* Avoid fp$ access in MAIN_MODULES (#2704)Alon Zakai2020-03-271-0/+11
Depends on emscripten-core/emscripten#10741 which ensures that table indexes are unique. With that guarantee, a main module can just add its function pointers into the table, and use them based on that index. The loader will then see them in the table and then give other modules the identical function pointer for a function, ensuring function pointer equality. This avoids calling fp$ functions during startup for the main module's own functions (which are slow). We do still call fp$s of things we import from outside, as we don't have anything to put in the table for them, we depend on the loader for that. I suspect this can also be done with SIDE_MODULES, but did not want to try too much at once.