WebAssembly / wabt

The WebAssembly Binary Toolkit
Apache License 2.0
6.91k stars 702 forks source link

wasm2c: Add segue option to make exclusive use of the segment register #2458

Closed shravanrn closed 2 months ago

shravanrn commented 2 months ago

The 3rd of the 3 PRs needed for production Linux Segue support (i.e., use x86 segment registers to refer to the Wasm heap for single-memory Wasm modules). This PR adds an option for applications to tell wasm2c that it has exclusive use of the gs register for this purpose and need not save and restore it on each use --- something that is particularly expensive on pre-Ivybridge CPUs which requires syscalls to set segment registers.

shravanrn commented 2 months ago

@sbc100 Please have a look when you have the chance. This should be the last segue commit prior to us deploying in Firefox.