Skip to content
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

wasm-emscripten-finalize: Add mainReadsParams metadata #2247

Merged
merged 2 commits into from
Jul 23, 2019
Merged

Conversation

kripken
Copy link
Member

@kripken kripken commented Jul 21, 2019

The new flag indicates whether main reads the argc/argv parameters. If it does not, we can avoid emitting code to generate those arguments in the JS, which is not trivial in small programs - it requires some string conversion code.

Nicely the existing test inputs were enough for testing this (see outputs).

This depends on an emscripten change to land first, as emscripten.py asserts on metadata fields it doesn't recognize.

Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!

kripken added a commit to emscripten-core/emscripten that referenced this pull request Jul 22, 2019
…#9045)

This change avoids the binaryen addition of the flags causing tests to break, as we assert on surprising flags in emscripten.py.

It sets the value of that param to a pessimistic 1 (assume main does read its params). This does nothing for now. After this lands, the binaryen PR [1] can land, and then a PR that adds the actual optimization and testing here.

[1] WebAssembly/binaryen#2247
@kripken kripken merged commit ff2b10b into master Jul 23, 2019
@kripken kripken deleted the mainReadsParams branch July 23, 2019 01:00
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
…emscripten-core#9045)

This change avoids the binaryen addition of the flags causing tests to break, as we assert on surprising flags in emscripten.py.

It sets the value of that param to a pessimistic 1 (assume main does read its params). This does nothing for now. After this lands, the binaryen PR [1] can land, and then a PR that adds the actual optimization and testing here.

[1] WebAssembly/binaryen#2247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants