Skip to content

Update WasmOMGIRGenerator32_64.cpp #46678

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 12, 2025

d934b72

Update WasmOMGIRGenerator32_64.cpp
https://bugs.webkit.org/show_bug.cgi?id=294413

Reviewed by Justin Michaud.

Update to match the 64 bit version.

The updates in detail:
- Switch JSWebAssemblyArray.h include to JSWebAssemblyArrayInlines.h
- Remove reduntant BitAnd 0x7fffffff from addRefI31.
- Remove ConstIntPtrValue in favour or ConstPtrValue.
- Add comments, rename variables, and typeset to match the 64 bit version.
- Apply SIMD tracking changes (related to struct RootBlock),
  although they have no effect in the 32 bit version.
- Use probeDebugSIMD instead of probeDebug, in addArguments,
  and prepareForTailCallImpl.
- Reorder some lines to match the 64 bit version,
  in emitRefTestOrCast and in prepareForTailCallImpl.
- Restore srcOffset from tmpSpill if clobbersTmp, in prepareForTailCallImpl.
- Use WasmRefType() instead of Int64 in addTableSet, addRefI31,
  and emitCatchTableImpl.
- Use callWasmOperation in emitRefTestOrCast.
- Trivially use the unimplemented VectorMulHigh, VectorMulLow.
- Add debugging info to match the 64 bit version.
- 'Allow self recursion with limit' changes in canInline.
- More changes from 'Do not use stored call-site-index for OMG'
- Count try blocks when IPInt is enabled, in addLoop.
- Switch signature() to m_signature in addElseToUnreachable.
- Use m_currentBlock instead of block in emitCatchTableImpl.
- Use makeUniqueWithoutFastMallocCheck in parseAndCompileOMG.

* Source/JavaScriptCore/wasm/WasmOMGIRGenerator32_64.cpp:
(JSC::Wasm::OMGIRGenerator::fixupPointerPlusOffset):
(JSC::Wasm::OMGIRGenerator::OMGIRGenerator):
(JSC::Wasm::OMGIRGenerator::insertEntrySwitch):
(JSC::Wasm::OMGIRGenerator::insertConstants):
(JSC::Wasm::OMGIRGenerator::addArguments):
(JSC::Wasm::OMGIRGenerator::addRefFunc):
(JSC::Wasm::OMGIRGenerator::load):
(JSC::Wasm::OMGIRGenerator::emitStoreOp):
(JSC::Wasm::OMGIRGenerator::addRefI31):
(JSC::Wasm::OMGIRGenerator::emitRefTestOrCast):
(JSC::Wasm::OMGIRGenerator::addSIMDExtmul):
(JSC::Wasm::OMGIRGenerator::addLoop):
(JSC::Wasm::OMGIRGenerator::addElseToUnreachable):
(JSC::Wasm::OMGIRGenerator::emitCatchImpl):
(JSC::Wasm::OMGIRGenerator::emitCatchTableImpl):
(JSC::Wasm::prepareForTailCallImpl):
(JSC::Wasm::OMGIRGenerator::canInline const):
(JSC::Wasm::OMGIRGenerator::emitInlineDirectCall):
(JSC::Wasm::OMGIRGenerator::addCall):
(JSC::Wasm::OMGIRGenerator::addCallRef):
(JSC::Wasm::parseAndCompileOMG):

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

e53afc5

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 12, 2025 23:02
@aoikonomopoulos
Copy link
Contributor

Thanks @ioannad, those all look straightforward to me and this significantly reduces the diff to the 64-bit version.

@sosukesuzuki sosukesuzuki added the WebAssembly For bugs in JavaScript WebAssembly label Jun 15, 2025
@ioannad ioannad changed the title Update WasmOMGIRGenerator32_64.cpp without GC changes Update WasmOMGIRGenerator32_64.cpp Jun 19, 2025
@ioannad ioannad force-pushed the eng/Update-WasmOMGIRGenerator32_64-cpp-without-GC-changes branch from 598de69 to e53afc5 Compare June 19, 2025 22:30
@ioannad
Copy link
Contributor Author

ioannad commented Jun 19, 2025

The ref-i31-eq.js failure turned out to be an issue in WasmBBQJIT32_64.cpp, which was fixed with PR #46970, so I updated this with PR all the changes, also including ones that I was suspecting were involved with the failure.
This PR now brings WasmOMGIRGenerator32_64.cpp up to date with the 64 bit version in WasmOMGIRGenerator.cpp.

Since @aoikonomopoulos already reviewed the previous version of the changes, here is what I added with the force push:

  • Switch JSWebAssemblyArray.h include to JSWebAssemblyArrayInlines.h
  • Remove reduntant BitAnd 0x7fffffff from addRefI31.
  • Restore srcOffset from tmpSpill if clobbersTmp, in prepareForTailCallImpl.

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

Reviewed by Justin Michaud.

Update to match the 64 bit version.

The updates in detail:
- Switch JSWebAssemblyArray.h include to JSWebAssemblyArrayInlines.h
- Remove reduntant BitAnd 0x7fffffff from addRefI31.
- Remove ConstIntPtrValue in favour or ConstPtrValue.
- Add comments, rename variables, and typeset to match the 64 bit version.
- Apply SIMD tracking changes (related to struct RootBlock),
  although they have no effect in the 32 bit version.
- Use probeDebugSIMD instead of probeDebug, in addArguments,
  and prepareForTailCallImpl.
- Reorder some lines to match the 64 bit version,
  in emitRefTestOrCast and in prepareForTailCallImpl.
- Restore srcOffset from tmpSpill if clobbersTmp, in prepareForTailCallImpl.
- Use WasmRefType() instead of Int64 in addTableSet, addRefI31,
  and emitCatchTableImpl.
- Use callWasmOperation in emitRefTestOrCast.
- Trivially use the unimplemented VectorMulHigh, VectorMulLow.
- Add debugging info to match the 64 bit version.
- 'Allow self recursion with limit' changes in canInline.
- More changes from 'Do not use stored call-site-index for OMG'
- Count try blocks when IPInt is enabled, in addLoop.
- Switch signature() to m_signature in addElseToUnreachable.
- Use m_currentBlock instead of block in emitCatchTableImpl.
- Use makeUniqueWithoutFastMallocCheck in parseAndCompileOMG.

* Source/JavaScriptCore/wasm/WasmOMGIRGenerator32_64.cpp:
(JSC::Wasm::OMGIRGenerator::fixupPointerPlusOffset):
(JSC::Wasm::OMGIRGenerator::OMGIRGenerator):
(JSC::Wasm::OMGIRGenerator::insertEntrySwitch):
(JSC::Wasm::OMGIRGenerator::insertConstants):
(JSC::Wasm::OMGIRGenerator::addArguments):
(JSC::Wasm::OMGIRGenerator::addRefFunc):
(JSC::Wasm::OMGIRGenerator::load):
(JSC::Wasm::OMGIRGenerator::emitStoreOp):
(JSC::Wasm::OMGIRGenerator::addRefI31):
(JSC::Wasm::OMGIRGenerator::emitRefTestOrCast):
(JSC::Wasm::OMGIRGenerator::addSIMDExtmul):
(JSC::Wasm::OMGIRGenerator::addLoop):
(JSC::Wasm::OMGIRGenerator::addElseToUnreachable):
(JSC::Wasm::OMGIRGenerator::emitCatchImpl):
(JSC::Wasm::OMGIRGenerator::emitCatchTableImpl):
(JSC::Wasm::prepareForTailCallImpl):
(JSC::Wasm::OMGIRGenerator::canInline const):
(JSC::Wasm::OMGIRGenerator::emitInlineDirectCall):
(JSC::Wasm::OMGIRGenerator::addCall):
(JSC::Wasm::OMGIRGenerator::addCallRef):
(JSC::Wasm::parseAndCompileOMG):

Canonical link: https://commits.webkit.org/296580@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Update-WasmOMGIRGenerator32_64-cpp-without-GC-changes branch from e53afc5 to d934b72 Compare June 24, 2025 18:55
@webkit-commit-queue
Copy link
Collaborator

Committed 296580@main (d934b72): https://commits.webkit.org/296580@main

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

@webkit-commit-queue webkit-commit-queue merged commit d934b72 into WebKit:main Jun 24, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebAssembly For bugs in JavaScript WebAssembly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants