feat(libSceNKWebKit): implement 104 exports that delegate to a member's virtual function #23471
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23471"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by RiverWhy on 2026-11-19T04:00:35Z.
What
Implements 104
libSceNKWebKitexports that forward a call to a virtual function of one of the object's members. All 104 throwNotImplementedonmaintoday.In the
libSceNKWebKit.sprxwith SHA-2563af992253665387feeb5df90ff27dff683e3aa270cc4d92a0535b46ab18fa20d(the module the existing Constant-return exports debt entry reads as 11.00), each body isThat is upstream's
void MediaPlayer::pause() { m_private->pause(); }pattern. They are implemented insrc/DelegatingExports.cppas the same assembly tail jump with each export's offset and slot, the wayForwardExports.cpphandles plainjmpaliases. Every argument and return register passes through untouched, so no prototype is assumed. One difference from the module: a null object or null member jumps to a helper that throwsinvalid_argument, where the module would fault.MediaPlayerm_private)MediaPlayerm_client)HTMLInputElementm_inputType)Chromem_client)RenderLayerBackingFrameLoaderBackForwardControllerCanvasRenderingContextPageThe two
MediaPlayeroffsets matchplayerPrivate()(0x50) andclient()(0x18), whichmainalready implements inFieldGetters.cppfrom the same module. AnyPS5 does not construct any of these classes with a layout of its own.Left out: four
WK*C API exports (WKPageRun*ResultListenerCall,WKBundlePageOverlaySetAccessibilityClient) have the same body. They are left out because AnyPS5's own API objects (Object.hpp) don't use the module's layout, so the module's offset would read the wrong field.How the table was produced: I recomputed each NID from the declared name, found it in the module's symbol table and decoded offset and slot from the bytes. A second pass re-parsed all 104 from
objdumpoutput and matched every one.Debt: the fragment
docs/dev/debt/changes/feat-nkwebkit-delegating-virtual-calls.mdadds the Functional entry and removes the 97 inventory rows.Overlap: I fetched every open PR head and diffed it against
main. None removes any of these stubs.Tested
Linux Mint 22.3, GCC 13.3, Release:
nkwebkit_delegatingexportstest builds, for each of the 104 exports, an object with a fake member at the export's offset whose vtable has a recording function at the export's slot (every other slot aborts). It calls the export with five integer arguments and checks that the delegate got the member asthis, received all five arguments unchanged and passed its return value back. It also checks that a null member and a null object throw, and that noNotImplementedcall happened.MediaPlayeroffset from 0x50 to 0x48, makes the test fail.nkwebkit_*tests pass.tools/check_conventions.pypasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T04:12:33Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
525b232ae8:tools/check_conventions.pypassed.nkwebkit_delegatingexports_testsbuilt cleanly.nkwebkit_delegatingexports):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/src/DelegatingExports.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.thispointer (%rdi) and member delegate pointer (%rdi after load) jumping to NKWebKitNullDelegate_nid_no_patch to prevent segfaultsLooks Good To Me