Skip to content

Homogenize handling of i31 methods across tiers on 32-bits #46970

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

ioannad
Copy link
Contributor

@ioannad ioannad commented Jun 19, 2025

2edcd1e

Homogenize handling of i31 methods across tiers on 32-bits
https://bugs.webkit.org/show_bug.cgi?id=294725

Reviewed by Yusuke Suzuki.

Homogenise the processes of i31 ref methods in BBQJIT, to avoid discrepancies when performing OSR,
by following the approach used for 64 bit tiers, and in the OMG and LLInt tiers for 32 bit.
That is, only sign-extend when creating the i31 ref, and apply the 0x7fffffff mask in the unsigned case.

Also re-enable now-passing test gc/ref-i31-eq.js.

Co-authored-by: Angelos Oikonomopoulos <[email protected]>

* JSTests/wasm/gc/ref-i31-eq.js:
* Source/JavaScriptCore/wasm/WasmBBQJIT32_64.cpp:
(JSC::Wasm::BBQJITImpl::BBQJIT::addRefI31):
(JSC::Wasm::BBQJITImpl::BBQJIT::addI31GetS):
(JSC::Wasm::BBQJITImpl::BBQJIT::addI31GetU):

Canonical link: https://commits.webkit.org/296423@main

c8fee79

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🛠 🧪 jsc ✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 🧪 jsc-arm64 ✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp ✅ 🛠 jsc-armv7
✅ 🛠 tv-sim ❌ 🧪 jsc-armv7-tests
✅ 🛠 watch
✅ 🛠 watch-sim

@ioannad ioannad requested a review from a team as a code owner June 19, 2025 15:28
@ioannad
Copy link
Contributor Author

ioannad commented Jun 19, 2025

This PR supersedes PR #46961 after agreeing with @aoikonomopoulos on the changes here.

@aoikonomopoulos aoikonomopoulos added the merge-queue Applied to send a pull request to merge-queue label Jun 19, 2025
https://bugs.webkit.org/show_bug.cgi?id=294725

Reviewed by Yusuke Suzuki.

Homogenise the processes of i31 ref methods in BBQJIT, to avoid discrepancies when performing OSR,
by following the approach used for 64 bit tiers, and in the OMG and LLInt tiers for 32 bit.
That is, only sign-extend when creating the i31 ref, and apply the 0x7fffffff mask in the unsigned case.

Also re-enable now-passing test gc/ref-i31-eq.js.

Co-authored-by: Angelos Oikonomopoulos <[email protected]>

* JSTests/wasm/gc/ref-i31-eq.js:
* Source/JavaScriptCore/wasm/WasmBBQJIT32_64.cpp:
(JSC::Wasm::BBQJITImpl::BBQJIT::addRefI31):
(JSC::Wasm::BBQJITImpl::BBQJIT::addI31GetS):
(JSC::Wasm::BBQJITImpl::BBQJIT::addI31GetU):

Canonical link: https://commits.webkit.org/296423@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Homogenize-handling-of-i31-methods-across-tiers-on-32-bits branch from c8fee79 to 2edcd1e Compare June 19, 2025 18:41
@webkit-commit-queue
Copy link
Collaborator

Committed 296423@main (2edcd1e): https://commits.webkit.org/296423@main

Reviewed commits have been landed. Closing PR #46970 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 2edcd1e into WebKit:main Jun 19, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 19, 2025
@ioannad ioannad deleted the eng/Homogenize-handling-of-i31-methods-across-tiers-on-32-bits branch June 19, 2025 22:19
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.

5 participants