summaryrefslogtreecommitdiff
path: root/src/passes/StackCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Preserve Function HeapTypes (#3952)Thomas Lively2021-06-301-4/+2
| | | | | | | | | 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.
* [StackCheck] Handle colliding names (#3390)Alon Zakai2020-12-141-31/+30
| | | | | Add Names::getValidGlobalName calls to ensure we don't collide with an existing name. Fixes emscripten-core/emscripten#12834
* Let EnforceStackLimits have pointers to Globals (NFC) (#3397)Heejin Ahn2020-11-241-5/+6
| | | | These can be simply raw pointers, given that they are stored in modules using `unique_ptr`s.
* [wasm-builder] Construct module elements as unique_ptrs (#3391)Thomas Lively2020-11-191-26/+25
| | | | | | | | | 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.
* Remove old stack function from StackCheck (#3100)Alon Zakai2020-09-031-12/+1
|
* StackCheck: Check both under and overflow (#3091)Alon Zakai2020-09-021-24/+53
| | | | | | | | | | | | | | | | | | | See emscripten-core/emscripten#9039 (comment) The valid stack area is a region [A, B] in memory. Previously we just checked that new stack positions S were S >= A, which prevented us from growing too much (the stack grows down). But that only worked if the growth was small enough to not overflow and become a big unsigned value. This PR makes us check the other way too, which requires us to know where the stack starts out at. This still supports the old way of just passing in the growth limit. We can remove it after the roll. In principle this can all be done on the LLVM side too after emscripten-core/emscripten#12057 but I'm not sure of the details there, and this is easy to fix here and get testing up (which can help with later LLVM work). This helps emscripten-core/emscripten#11860 by allowing us to clean up some fastcomp-specific stuff in tests.
* Move stack-check into its own pass (#2994)Sam Clegg2020-07-271-0/+157
This new pass takes an optional stack-check-handler argument which is the name of the function to call on stack overflow. If no argument is passed then it just traps.