-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
MINIMAL_RUNTIME: Fix declaration of wasmExports when using embind #20146
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me this reads like a two byte loss everywhere. A new global variable ,g
needs to appear in global scope in each build that was able to be a reused local before.
The function call to initRuntime(wasmExports)
is always inlined by Closure, so passing an argument to that function did not take up code bytes.
The code size wins seem to happen in hello_webgl2_wasm.js and hello_webgl_wasm.js, but for some reason this PR does not contain the new .js files for those builds? Do you know why those were left out? (that should be autogenerated, right?)
I would prefer to keep the old code, unless there is really a code size win in some cases. But to me the code size win seems like it might be comparing against an old stale build in tree? (was there some slack allowed, so the old exemplars might be out of date?)
Maybe the accurate fix to #20145 would be to change #if LibraryManager.has('library_exports.js') to #if LibraryManager.has('library_exports.js') || EMBIND |
Ah yes, that looks like a good solution. We might want to extend that so I might add a new internal settings such as BTW, I wonder if we should do the same for |
Yeah, if there are more settings that need it, then that might make sense.
My understanding is that no reasonable application can run without But for very small pages, that might be a possibility, so I would definitely not object against having the same mechanism for that. |
Yeah, I don't think hello world needs wasmTable.. its only for apps that use some things like |
The conditions under which wasmExports was declared global vs locally were out of sync. Also, move the declaration of the global wasmExports alongside the other wasm globals. See: #20145
Interestingly I can't see why embind depends on wasmExports.. do you know why that might be? |
Closing this PR. I will open a new one to fix the EMBIND discrepency. |
The conditions under which wasmExports was declared global vs locally
were out of sync.
Also, move the declaration of the global wasmExports alongside the
other wasm globals.
See: #20145