-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Optimise code size of addFunction. NFC #24594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimise code size of addFunction. NFC #24594
Conversation
Huh. Looks like in core2 Closure mangles $wasmTypeCodes: {
'i': 0x7f, // i32
#if MEMORY64
'p': 0x7e, // i64
#else
'p': 0x7f, // i32
#endif
'j': 0x7e, // i64
'f': 0x7d, // f32
'd': 0x7c, // f64
'e': 0x6f, // externref
}, into wb = {qg: 127, p: 127, rg: 126, f: 125, d: 124, e: 111}, I thought quoting was supposed to prevent that... |
Ahh it's because of how jsify generates the variables. It generates them as unquoted when using object literal... |
2636680
to
cc9c938
Compare
Yes, sadly I think the round-tripping that happens when the JS library is processed will remove the quotes. You can either: |
I think there is more that could be done here - in particular,
setWasmTableEntry
is only used fromlibaddfunction
and likely could be merged into it to unify data structures and updates - but for now just tackled some low-hanging fruits.