feat(libSceNKWebKit): implement StringImpl::destroy and StringImpl::adopt #20291
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20291"
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-14T23:59:55Z.
What
WTF::StringImpl::destroywas a throwing placeholder. WebKit's inlinederefcalls it when a string's last reference goes away, so guest code built against WTF stopped the title there; the WTF value layouts debt entry recorded that ("a string whose last reference guest code drops terminates"). This implements it and the twoStringImpl::adoptoverloads, following the pinned PS5 11.x WebKit source.StringImpl::destroy(StringImpl*): frees an internal, owned or substring buffer (the substring's parent is released) and theStringImpl. It sharesFreeUnreferencedwithRelease, which had the same path inline. Atom and symbol strings and external buffers throw throughNotImplemented_nid_no_patch: there is no atom table, symbol registry or external free function here. A null or static string throws where the source asserts.StringImpl::adopt(StringBuffer<LChar>&&)/adopt(StringBuffer<UChar>&&): an empty buffer returns the shared empty string; otherwise the guestfastMallocbuffer becomes an owned string (flags 5 or 1) without copying, and the buffer's data is cleared while its length stays, asrelease()does. A nonempty buffer without data throws.StringBuffer<CharType>layout ({unsigned length; CharType* data}, 16 bytes) added toWtfStringAbi.hppwithstatic_asserts.Export.cppandInventoryExports.hpp; debt: a fragment,docs/dev/debt/changes/feat-nkwebkit-stringimpl-destroy-adopt.md, adds the entry, removes the 3 inventory rows and updates the two entries that calleddestroya stub.The progress count rises by 2, not 3:
destroystill callsNotImplemented_nid_no_patchfor atom and symbol strings, so it is counted as pending andimport_audit.pyreports it as partial instead of stub.Tested
Linux Mint 22.3:
nkwebkit_wtfstringimpllifetimetest: both adopt overloads (no copy, flags, buffer state), empty and null-data buffers,destroyof internal, owned and substring strings (the parent's reference count drops back), and the null, static, atom, symbol and external refusals.ctest -R nkwebkit: 87 tests passed,nkwebkit_wtfincluded.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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T05:16:55Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
95ece96fe5:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_wtfstringimpllifetime_testsbuilt cleanly.nkwebkit_wtfstringimpllifetime):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WtfExports.hpp,core/libs/prx/libSceNKWebKit/src/WtfString.cpp,core/libs/prx/libSceNKWebKit/src/WtfStringAbi.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T15:43:59Z.
Review: COMMENTED
Reviewed — no blocking findings
The changed lifetime and adoption paths are supported by the inspected code; no concrete blocking defect was verified.
What I ran
Reviewed head
2eeb0c0c0a8848bf138d8767eaf16e760b42ba42usingrepo_read.pyto inspect the prepared diff and targeted source ranges. No tests or build commands were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full text of
Export.cpp,InventoryExports.hpp, and the complete changed-file set were not read; these files were excluded from the review folder as too large. The exact export integration, build, and author-reported tests were not independently verified. Inspected files:WtfString.cpp(targeted ranges),WtfStringAbi.hpp(lines 1–100),WtfStringImplLifetime.cpp, and the prepared diff. No excluded file is claimed to be fully reviewed.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T05:57:19Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
3f9b74c8f3fca8408d23935bfa086674b1964409. No commands or tests were run;repo_read.pywas unavailable as an executable tool in this session. Read the prepared description, commits, diff, manifest, and the full text of every file listed as reviewed in the manifest.Export.cppandInventoryExports.hppwere excluded because they were too large; their relevant removals are visible in the diff.Results
Findings
Blocking
None.
Non-blocking
WtfStringAbi.hpp:83-85asserts the 8-bitStringBufferlayout only. The description says the layout is 16 bytes for both character types; adding equivalent UTF-16 assertions would make that stated ABI assumption explicit.Not verified
No test execution, console binary comparison, or runtime console behavior was verified.
Export.cppandInventoryExports.hppwere not read in full; only their changed hunks indiff.patchwere reviewed. The reported Linux Mint test results are author supplied, not run by this review.To get this to a good state
Nothing is required. Optionally add UTF-16
StringBufferlayout assertions.Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T03:50:58Z.
Review: COMMENTED
Architecture findings (1)
Advisory architecture findings (1)
a0196a52-ad68-4965-9eca-0a14941669b0Reviewing files that changed from the base of the PR and between
aecfbf79b1and1e5ca211cd.core/libs/prx/libSceNKWebKit/Export.cppcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppcore/libs/prx/libSceNKWebKit/include/WtfExports.hppcore/libs/prx/libSceNKWebKit/src/WtfString.cppcore/libs/prx/libSceNKWebKit/src/WtfStringAbi.hppcore/libs/prx/libSceNKWebKit/tests/WtfStringImplLifetime.cppdocs/dev/debt/changes/feat-nkwebkit-stringimpl-destroy-adopt.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T06:43:23Z.
Review: APPROVED
Reviewed — looks good
The implementation and its lifetime tests were reviewed at head
1e5ca211cd7042264d88e6457ed6948014ba0e9d; no concrete blocking defect was found in the inspected changes.What I ran
No commands or tests were run. I inspected the prepared diff and source at the pinned head using
repo_read.py.Results
Findings
Blocking
None found in the inspected code.
Non-blocking
None.
Not verified
The changed
Export.cppfull text was excluded as too large; its relevant diff hunk was reviewed. No build or tests were run, and console ABI behavior was not verified. The other changed files listed in the manifest were read:InventoryExports.hpp,WtfExports.hpp,WtfString.cpp,WtfStringAbi.hpp,WtfStringImplLifetime.cpp, andfeat-nkwebkit-stringimpl-destroy-adopt.md.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:03:11Z.
Review: COMMENTED
Compiled the changed string-lifetime code with
WtfStringImplLifetimeagainst the existing Linux PRXs. The fixture passed its adoption, shared-storage reference accounting, and rejection checks.AI-assisted: yes.
Pull request closed