-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Define memory in wasm module in MINIMAL_RUNTIME mode. #12323
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
Conversation
d23aa01
to
fff9ac2
Compare
c143c22
to
cb70ed2
Compare
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.
Would it make sense to wait on this change for first deciding in general whether this direction is what we want?
@@ -195,3 +195,9 @@ var STRUCT_INFO = ''; | |||
|
|||
// If true, building against Emscripten's asm.js/wasm heap memory profiler. | |||
var MEMORYPROFILER = 0; | |||
|
|||
// By default we set this to 0 meaning the wasm file does not defined its own |
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.
// By default we set this to 0 meaning the wasm file does not defined its own | |
// By default we set this to 0 meaning the wasm file does not define its own |
I'm happy to wait, especially since this change requires another binaryn change for wasm2js as well. However I'm 99% this is what we want in the default case. The only question in mind right now is: do we need to continue to support the old way behind a flag? Since table and memory are both created on the JS side the dynamic linking case it likely we have to continue to support this method anyway so the cost might be be much. Also since its a code size win it seems like a must for MINIIMAL_RUNTIME (at least in the default case) |
Oh, good point, since we need the option for dynamic linking anyhow, there is indeed no extra code complexity burden here. |
I mean the code should be shared... but its still another config to test "static linking + memory supplied from the outside" |
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.
I think this is good, except for the setting - how about making it non-internal? I think that would be good for testing, for example, if someone hits a bug that only happens in standalone or minimal runtime mode (that flip this flag on by default) we can test in normal mode with the flag, to rule it out.
As we need to support these two modes anyhow, I don't see a significant downside to making it a user-facing setting.
I'm trying to do this incrementally but eventually for normal mode I think we will want a flag. For MINIMAL_RUNTIME and STANDALONE_WASM mode I'm not sure we want to support both ways as it complicates the code and neither of those modules support dynamic linking today. Once that large change lands to allow this regular mode to support memory on the wasm side then I think we will have a flag at that point. But that change I imagine will be a fair bit larger and more complex than this one.. and more controversial perhaps. This see this a small step towards that larger change, once that can land in relative isolation without exposing any new options or changing any existing behaviour. |
Anyway this is currently blocked on wasm2js so we need some binaryen changes first. |
6a6bc63
to
7fbcd1d
Compare
1023fa7
to
67e6925
Compare
These are call codesize wins!
67e6925
to
c651423
Compare
Abandoning in favor of going all the way and doing this by default with or without MINMAL_RUNTIME: #12790 |
See #12315