feat(libSceNKWebKit): implement WTF symbol strings #14919
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14919"
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 w4rc0n on 2026-11-02T01:31:38Z.
What
WTF symbol strings were missing:
SymbolImpl::nextHashForSymbol,SymbolImpl::create,SymbolImpl::createNullSymbolandPrivateSymbolImpl::createwereNotImplementedstubs. #14917's destruction and #14918's atom paths also threw for symbols. JavaScriptCore makes a symbol for every JSSymbol(), so those paths stopped. All four now follow the pinned PS5 WebKit 11.xSymbolImpl.cpp:Layout:
SymbolImplis 40 bytes, followingSymbolImpl.h:StringImplheader;It is pinned with
static_assert.Creation: symbols share their text's buffer and hold a reference to its owner, as
createSubstringSharingImpldoes.Hash counter:
nextHashForSymbolreturns distinct nonzero values with the lows_flagCountbits clear, from a relaxedstd::atomiccounter shifted past the flags. It skips 0, becauseStringImpltreats a zero hash as not yet computed. It is written independently and doesn't reproduce the pinned sequence (a step of1 << s_flagCountwith the top bit set); the debt entry says so.Destruction: null, ordinary and private symbols release their owner through the existing substring path (
StringImpl.cpp:113-157), so "symbol" drops out of #14917's debt entry.Atomization: following
AtomStringImpl.cpp:340-408, atomizing a symbol never inserts the symbol itself. It copies short text, or makes an ordinary substring that shares the owner, so "symbol" drops out of #14918's debt entry.RegisteredSymbolImplandSymbolRegistry::symbolForKey/~SymbolRegistrystayNotImplemented, because they need the guestHashSet<RefPtr<StringImpl>>layout. Registered symbols and external buffers still throw where they reach destruction, and the debt records it.Adapted source. The symbol constructors and the shared-substring constructor are adapted from the pinned
SymbolImpl.cpp:45-54,SymbolImpl.h:90-118andStringImpl.h:991. They sit beside #14918's adapted code insrc/WtfAtoms.cpp, with those files' notices in the same form.nextHashForSymbolis independent (above).tools/pr_overlap.pyon this head, withmainat0eba5db30d: no other open PR changes these exports or adds the same files. For the PRs it couldn't compare because they no longer merge withmain, GitHub's file lists show none of them changing these exports either. #13992, #14172, #14607, #15214, #15241 and #15867 change nearby lines in the same files; whichever merges later keeps both sides. The only exports it shares are with #14917, #14918 and #14920, in the same stack.Tested
Debian 12, GCC 12.2, Linux 6.18, Release, at the head
911bcec53185ff3d6d24d11b08789048bfbaa8c2. It sits on #14918's head129fe3b329162644709464a22d3f1e129f9f1a8b, which sits on #14917's head95dfdd5f7ea918208115e660db29009d06db3174. No local changes.guest_nkwebkit_dates,guest_nkwebkit_numbers,nkwebkit_base,nkwebkit_config,nkwebkit_constants,nkwebkit_fastbitvector,nkwebkit_jsc,nkwebkit_palsessionid,nkwebkit_preferences,nkwebkit_resourceresponse,nkwebkit_webcoregeometry,nkwebkit_wtf,guest_nkwebkit_urlsandpublic_headerspass. The newnkwebkit_wtfcases cover:tools/progress.py: the four exports count as implemented (libSceNKWebKit 1332, against 1328 with #14918).tools/check_conventions.pypasses.feat/nkwebkit-external-stringsat its previous head9d1e021975e6ecbdaf395584d055bc9653d825d2, which contains this PR's commit. It is AnyPS5'sBuildworkflow, dispatched in the author's fork withselect=true: the branch merged intomainatb11c7bf84f5d2f636ff60166cc3371bd071e24d5, built onwindows-latestwith WinLibs GCC 15.2 (MinGW-w64, UCRT). All 1390 selected tests passed, none skipped, including the twelve NKWebKit tests,public_headersandpatched_libraries. The run started before the fork had a test graph for thismain, so it selected more tests than usual. A fork-internal pull request existed only to give the workflow a number. The rebase ontomainat0eba5db30d8a3d03789e52e5c1a9ff853e4e33e4after #15911 changed onlydocs/dev/debt/libSceNKWebKit.md, sogit range-diffshows the code and tests under test are the same as at that run.Not built or run: macOS. No title or homebrew was run.
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)Pull request closed