-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Support 64-bit integers in acorn passes #24283
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
sbc100
left a comment
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.
Nice! Thanks for working on this!
I'll wait for @kripken to approve but lgtm.
kripken
left a comment
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!
|
|
||
| HeAp[x]; | ||
|
|
||
| // but not this |
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.
Please move this comment in the test so it is before the code, which should make it remain in the right place, I hope.
This streamlines the `SAFE_HEAP` transform in acorn-optimizer. I was going to send this as a separate cleanup PR as part of my other work on acorn-optimizer, but it happens to also be the easy fix for a regression mentioned in emscripten-core#24289 and caused by emscripten-core#24283 which added support for 64-bit integers to acorn-optimizer passes. I could fix that issue separately by tweaking `unSign`, but this way we don't need to bother - the values with correct sign are now automatically retrieved by accessing the correct `HEAP*` array. I've added a regression test for the linked issue as well, which fails before this PR and passes after.
This streamlines the `SAFE_HEAP` transform in acorn-optimizer. I was going to send this as a separate cleanup PR as part of my other work on acorn-optimizer, but it happens to also be the easy fix for a regression mentioned in emscripten-core#24289 and caused by emscripten-core#24283 which added support for 64-bit integers to acorn-optimizer passes. I could fix that issue separately by tweaking `unSign`, but this way we don't need to bother - the values with correct sign are now automatically retrieved by accessing the correct `HEAP*` array. I've added a regression test for the linked issue as well, which fails before this PR and passes after.
|
This has caused |
|
Yes, that's the failure it refers to in the PR description. |
This streamlines the `SAFE_HEAP` transform in acorn-optimizer. I was going to send this as a separate cleanup PR as part of my other work on acorn-optimizer, but it happens to also be the easy fix for a regression mentioned in #24289 and caused by #24283 which added support for 64-bit integers to acorn-optimizer passes. I could fix that issue separately by tweaking `unSign`, but this way we don't need to bother - the values with correct sign are now automatically retrieved by accessing the correct `HEAP*` array. I've added a regression test for the linked issue as well, which fails before this PR and passes after.
This PR fixes issues with big endian support introduced in the following PRs: - #24295 - The change did not consider the `littleEndianHeap` transform implications, - #24283 - The new LE_HEAP* functions were not added to link.py, causing runtime failure on BE system. The `littleEndianHeap` transform code is simplified and updated to detect the code introduced by `growableHeap` pass. A new test was added to verify the combined transformation generates working code.
I noticed that acorn-optimizer transforms for ASan, SAFE_HEAP and GROWABLE_HEAP didn't cover the 64-bit integer support enabled by
WASM_BIGINT(HEAP64andHEAPU64memory views).This PR adds demos of failing transforms in one commit, and actual support in the next one so that it's easier to see the diff between incorrectly generated code and the fixed one.
I've only tested on these snapshots for now, so waiting for CI to see if I missed any other tests that need to be updated.