feat(libSceNKWebKit): implement WTF::String::simplifyWhiteSpace #16890
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16890"
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 AlexWhitehouse on 2026-11-07T20:42:08Z.
What
libSceNKWebKit
WTF::String::simplifyWhiteSpace(bool (*)(UChar)) const(_ZNK3WTF6String18simplifyWhiteSpaceEPFbDsE, NIDxuaSjMP7VYc) threwnot implemented. This PR ports it from the PS5 WebKit tree the other NKWebKit ports use, 80f77e94:WTFString.cpplines 162–166: a null String returns null; otherwise it forwards to the impl.StringImpl.cpplines 749–789:simplifyMatchedCharactersToSpace, for 8-bit or 16-bit strings.Behaviour, line for line with upstream:
changedToSpacerecords a matched character other than' ';StringImplis returned (one more reference). Otherwise a new impl of the same width is built through the existingTryCreateUninitialized, which gives the shared empty impl for an all-matching string, asStringImpl::adoptdoes.The predicate is called in upstream's order. It is a guest function, so it is called with the guest's System V ABI (
APS5_VABI) on every host.A null
this, or a non-empty string with no character storage or no predicate, throws, because upstream would dereference null. The new source starts with the notices of both files, byte for byte. The stub and its inventory row are removed, the NKWebKit count drops from 6368 to 6367, and a debt entry records that the console ABI and behaviour are unverified.Tested
nkwebkit_wtfwhitespace(core/libs/prx/libSceNKWebKit/tests/WtfWhitespace.cpp) covers:main, the test fails with_ZNK3WTF6String18simplifyWhiteSpaceEPFbDsE not implemented;nkwebkit_wtfwhitespace,nkwebkit_wtftextandnkwebkit_wtftext_allocationpass at a8d8e85152, so the System V predicate calls work under MinGW, with no compiler warnings in the changed files.python3 tools/check_conventions.py --base origin/main: all checks passed.python3 tools/pr_overlap.py: no open PR implementssimplifyWhiteSpace.Export.cppmerges cleanly, and the neighbouring header and debt lines conflict textually.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-07T22:15:43Z.
Review: COMMENTED
Read
a8d8e85152againstmain.SimplifyfollowssimplifyMatchedCharactersToSpace(StringImpl.cpp:749-789) step by step: the same predicate call order,changedToSpaceonly for non-space matches, the trailing-space trim, and reuse of the same impl when nothing changed.outccan't exceed the input length.TryCreateUninitialized(0)returns the retained 8-bit empty impl, which matchesadoptreturning*empty(), and the width is preserved otherwise. The sret,thisand predicate argument order match the Itanium const member, and the predicate is called asAPS5_VABI. I found no defect. The 6368 to 6367 count is right for currentmain; it collides only with #16901 and #16853 on that line.Not run here; this is from reading the code.
AI-assisted: yes.