WebKit icon indicating copy to clipboard operation
WebKit copied to clipboard

Update WasmOMGIRGenerator32_64.cpp

Open ioannad opened this issue 7 months ago โ€ข 4 comments

e53afc56d9a5507765f2d1a041dc1f6e64cd2a7e

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

Reviewed by NOBODY (OOPS!).

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):

https://github.com/WebKit/WebKit/commit/e53afc56d9a5507765f2d1a041dc1f6e64cd2a7e

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
โœ… ๐Ÿงช vision-wk2 โœ… ๐Ÿงช mac-intel-wk2 โ€ƒ ~~๐Ÿ›  playstation~~
โœ… ๐Ÿ›  tv โœ… ๐Ÿ›  mac-safer-cpp โœ… ๐Ÿ›  jsc-armv7
โœ… ๐Ÿ›  tv-sim โœ… ๐Ÿงช jsc-armv7-tests
โœ… ๐Ÿ›  watch
โœ… ๐Ÿ›  watch-sim

ioannad avatar Jun 12 '25 23:06 ioannad

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

aoikonomopoulos avatar Jun 13 '25 08:06 aoikonomopoulos

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.

ioannad avatar Jun 19 '25 22:06 ioannad

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

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

webkit-commit-queue avatar Jun 24 '25 18:06 webkit-commit-queue