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
Wasm: Use builtin string constants from JS string builtins.
In addition to builtin functions, the JS string builtins proposal
provides a way to import (valid UTF-8) string literals from a
dedicated module.
Instead of using a custom data segment, we now import all the
strings we can from that builtin module.
For the rare cases where we need a string literal that is not a
valid UTF-16 string (and therefore cannot be encoded into valid
UTF-8), we use custom imports that we fill in from the JS side.
This alternate encoding is a lot more economical in terms of code
size. It shaves off 5% of the fastLink output, and 8.5% of the
fullLink output. Moreover, it means our string literals are
constant expression globals, which we can directly use in the
initialization of `typeData` constant structs.
0 commit comments