summaryrefslogtreecommitdiff
path: root/src/passes/GenerateDynCalls.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename indexType -> addressType. NFC (#7060)Sam Clegg2024-11-071-4/+5
| | | See https://github.com/WebAssembly/memory64/pull/92
* Fix generate-dyncalls and directize passed under table64 (#6604)Sam Clegg2024-05-181-12/+13
|
* When creating `dynCall` and `legalstub` function mark them as ↵Sam Clegg2024-04-121-0/+1
| | | | | | | | | hasExplicitName. NFC (#6496) This is temporary workaround for the current test failures on the emscripten waterfall. The real fix I believe will be to make `hasExplicitName` the default in these kinds of cases. See: #6466
* Properly error on multivalue returns in GenerateDynCalls (#5588)Alon Zakai2023-03-211-0/+10
| | | | Fixes #5586
* Change from storing Signature to HeapType on CallIndirect (#4352)Thomas Lively2021-11-221-1/+2
| | | | | | | | | | | | With nominal function types, this change makes it so that we preserve the identity of the function type used with call_indirect instructions rather than recreating a function heap type, which may or may not be the same as the originally parsed heap type, from the function signature during module writing. This will simplify the type system implementation by removing the need to store a "canonical" nominal heap type for each unique signature. We previously depended on those canonical types to avoid creating multiple duplicate function types during module writing, but now we aren't creating any new function types at all.
* Preserve Function HeapTypes (#3952)Thomas Lively2021-06-301-13/+18
| | | | | | | | | When using nominal types, func.ref of two functions with identical signatures but different HeapTypes will yield different types. To preserve these semantics, Functions need to track their HeapTypes, not just their Signatures. This PR replaces the Signature field in Function with a HeapType field and adds new utility methods to make it almost as simple to update and query the function HeapType as it was to update and query the Function Signature.
* Remove Type ordering (#3793)Thomas Lively2021-05-181-1/+2
| | | | | | | | | As found in #3682, the current implementation of type ordering is not correct, and although the immediate issue would be easy to fix, I don't think the current intended comparison algorithm is correct in the first place. Rather than try to switch to using a correct algorithm (which I am not sure I know how to implement, although I have an idea) this PR removes Type ordering entirely. In places that used Type ordering with std::set or std::map because they require deterministic iteration order, this PR uses InsertOrdered{Set,Map} instead.
* [RT] Support expressions in element segments (#3666)Abbas Mashayekh2021-03-241-3/+5
| | | | | | This PR adds support for `ref.null t` as a valid element segment item. The abbreviated format of `(elem ... func $f $g...)` is kept in both printing and binary emitting if all items are `ref.func`s. Public APIs aren't updated in this PR.
* [reference-types] Support passive elem segments (#3572)Abbas Mashayekh2021-03-051-3/+13
| | | | | | | | | | | Passive element segments do not belong to any table, so the link between Table and elem needs to be weaker; i.e. an elem may have a table in case of active segments, or simply be a collection of function references in case of passive/declarative segments. This PR takes Table::Segment out and turns it into a first class module element just like tables and functions. It also implements early support for parsing, printing, encoding and decoding passive/declarative elem segments.
* Create a table import if there is none in ↵Alon Zakai2021-02-181-3/+7
| | | | | | | | | | | | | | | | | GenerateDynCalls::generateDynCallThunk (#3580) This fixes LLVM=>emscripten autoroller breakage due to llvm/llvm-project@f48923e commit f48923e884611e6271a8da821a58aedd24d91cf7 (HEAD) Author: Andy Wingo <wingo@igalia.com> Date: Wed Feb 17 17:20:28 2021 +0100 [WebAssembly][lld] --importTable flag only imports table if needed Before, --importTable forced the creation of an indirect function table, whether it was needed or not. Now it only imports a table if needed. Differential Revision: https://reviews.llvm.org/D96872
* Use correct table name in GenerateDynCalls (#3560)Thomas Lively2021-02-101-3/+2
| | | | | | | GenerateDynCalls was hardcoding the table name to use in the call_indirects in the dyncall thunks. The hardcoded name was different from the default name for imported tables, so the call_indirects referred to a nonexistent table when dynamic linking was enabled. This PR instead uses the name of table 0 when creating call_indirects for the dyncall thunks.
* [reference-types] remove single table restriction in IR (#3517)Abbas Mashayekh2021-02-091-1/+4
| | | Adds support for modules with multiple tables. Adds a field for the table name to `CallIndirect` and updates the C/JS APIs accordingly.
* [wasm-builder] Construct module elements as unique_ptrs (#3391)Thomas Lively2020-11-191-3/+3
| | | | | | | | | When Functions, Globals, Events, and Exports are added to a module, if they are not already in std::unique_ptrs, they are wrapped in a new std::unique_ptr owned by the Module. This adds an extra layer of indirection when accessing those elements that can be avoided by allocating those elements as std::unique_ptrs. This PR updates wasm-builder to allocate module elements via std::make_unique rather than `new`. In the future, we should remove the raw pointer versions of Module::add* to encourage using std::unique_ptrs more broadly.
* Rename Emscripten EHSjLj functions in wasm backend (#3191)Heejin Ahn2020-10-101-1/+2
| | | | | | | | | | | Now that we are renaming invoke wrappers and `emscripten_longjmp_jmpbuf` in the wasm backend, this deletes all related renaming routines and relevant tests. Depends on #3192. Addresses: #3043 and #3081 Companions: https://reviews.llvm.org/D88697 emscripten-core/emscripten#12399
* Let GenerateDynCalls generate dynCalls for invokes (#3192)Heejin Ahn2020-10-021-5/+87
| | | | | | This moves dynCall generating functionaity for invokes from `EmscriptenGlueGenerator` to `GenerateDynCalls` pass. So now `GenerateDynCalls` pass will take care of all cases we need dynCalls: functions in tables and invokes.
* wasm-emscripten-finalize: Add flags to limit dynCall creation (#3070)Sam Clegg2020-08-261-1/+6
| | | | | | Two new flags here, one to completely removes dynCalls, and another to limit them to only signatures that contains i64. See #3043
* Move generateDynCallThunks into its own pass. NFC. (#3000)Sam Clegg2020-08-041-0/+52
The core logic is still living in EmscriptenGlueGenerator because its used also by fixInvokeFunctionNames. As a followup we can figure out how to make these more independent.