summaryrefslogtreecommitdiff
path: root/src/passes/MultiMemoryLowering.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add memory: init, copy, fill support to Multi-Memory Lowering Pass (#5346)Ashley Nelson2022-12-151-0/+112
| | | This PR adds support for memory.init, memory.copy, and memory.fill instructions in the multi-memory lowering pass. Also includes optional bounds checks per the wasm spec guidelines.
* Refactor Multi-Memory Lowering pass to support additional instructions (#5352)Ashley Nelson2022-12-151-44/+64
| | | This PR breaks up the two main functions involved in each memory instruction (getPtr, makeBoundsCheck) into several smaller functions. This is a first step in adding support for bounds checks in the instructions memory: init, copy, and fill. Each of these instructions is a more unique case than the other memory instructions that have already been added to the Multi-Memory Lowering pass.
* Add Atomics support to Multi-Memory Lowering Pass (#5339)Ashley Nelson2022-12-121-0/+41
| | | | | This PR adds support for Atomic instructions in the multi-memory lowering pass. Also includes optional bounds checks per the wasm spec guidelines, (visitAtomicRMW, visitAtomicCmpxchg, visitAtomicWait, visitAtomicNotify). Note: The latter two instructions, memory.atomic.wait and memory.atomic.notify, have browser engine implementations that predate the still-in-progress threads spec. And whether or not atomic.notify should trap for out-of-bounds addresses remains an open issue. For now, this PR is using the same semantics as v8, which is to bounds check all Atomic instructions the same way and trap for out-of-bounds.
* Add SIMD support to Multi-Memory Lowering Pass (#5336)Ashley Nelson2022-12-121-6/+34
| | | This PR adds support for SIMD instructions in the multi-memory lowering pass. Also includes optional bounds checks per the wasm spec guidelines, (SIMDLoad, SIMDLoadSplat, SIMDLoadExtend, SIMDLoadZero, SIMDLoadStoreLane load | store).
* Adds bounds checks to Load/Store in Multi-Memories Lowering Pass (#5256)Ashley Nelson2022-12-091-70/+110
| | | Per the wasm spec guidelines for Load (rule 10) & Store (rule 12), this PR adds an option for bounds checking, producing a runtime error if the instruction exceeds the bounds of the particular memory within the combined memory.
* Handles memory.grow failure in MultiMemoryLowering Pass (#5241)Ashley Nelson2022-11-111-4/+9
| | | Per the wasm spec, memory.grow instructions should return -1 when there is a failure to allocate enough memory. This PR adds support for returning this error code.
* Multi-Memories Lowering Pass (#5107)Ashley Nelson2022-11-011-0/+421
Adds a multi-memories lowering pass that will create a single combined memory from the memories added to the module. This pass assumes that each memory is configured the same (type, shared). This pass also: - replaces existing memory.size instructions with a custom function that returns the size of each memory as if they existed independently - replaces existing memory.grow instructions with a custom function, using global offsets to track the page size of each memory so data doesn't overlap in the singled combined memory - adjusts the offsets of active data segments - adjusts the offsets of Loads/Stores