You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, memory (and soon tables) require explicit bounds checks to ensure safety. This incurs an additional read, and certainly additional branches.
One technique to reduce this would be to use mmap to ensure that out-of-bounds accesses cause a segmentation fault, and then handle the segmentation fault by trapping. Thus, the assumption is that the memory access will succeed, but that there's a guarantee that a segfault will be raised on out-of-bounds accesses.
The text was updated successfully, but these errors were encountered:
Implements #38 for memory (but not tables).
Also cleans up a lot of spaghetti code for division, which I rewrote when debugging.
This PR enables implicit memory bounds checks by using mmap instead of malloc for linear memory. The key idea is to rely on hardware protection, as described in the original WASM paper, instead of explicit checks (although these can be re-enabled via the --explicit-bounds-checks flag.
Doing so yields significant speedups -- we are on par with (and sometimes beat!) V8 in the benchmarks I've tried.
Currently, memory (and soon tables) require explicit bounds checks to ensure safety. This incurs an additional read, and certainly additional branches.
One technique to reduce this would be to use
mmap
to ensure that out-of-bounds accesses cause a segmentation fault, and then handle the segmentation fault by trapping. Thus, the assumption is that the memory access will succeed, but that there's a guarantee that a segfault will be raised on out-of-bounds accesses.The text was updated successfully, but these errors were encountered: