feat(libSceNKWebKit): implement WTF::Logger string conversions #16041
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16041"
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 gslashm on 2026-11-05T12:48:49Z.
What
Implements two
libSceNKWebKitexports fromSource/WTF/wtf/Logger.cpp:38-48at80f77e94c6:WTF::Logger::LogSiteIdentifier::toString() constWTF::LogArgument<void const*>::toString(const void*)LogArgument<const void*>::toStringisstatic(Logger.h:382-384), so it takes only the pointer argument.LogSiteIdentifierisclassNameat 0,methodNameat 8 andobjectPtrat 16, size 24 (Logger.h:284-286), pinned insrc/WtfStringAbi.hpp. Both returnWTF::Stringby value;Stringis 8 bytes with a non-trivial destructor, so the result goes through the hidden return pointer, as the existingStringexports do.The two functions follow
makeStringover 8-bit adapters (StringConcatenate.h:472-496).LogArgument<const void*>::toStringreturns(<hex>).LogSiteIdentifier::toStringreturns<className>::<methodName>(<hex>)whenclassNameis non-null, even when it is empty, and<methodName>(<hex>)otherwise; both end with a space.hexis uppercase, has no0xprefix and no minimum digits, and 0 prints0(HexNumber.cpp:33-45).const char*arguments are copied as bytes (StringConcatenate.h:84-106,135-141), so every result is 8-bit and bytes above 0x7F are kept.Where upstream crashes, this throws and the debt file says so: a null
methodNamereachesstrlen(nullptr), a nullselfis dereferenced, a single name aboveString::MaxLength(INT32_MAX,StringImpl.h:151) hitsRELEASE_ASSERT(StringConcatenate.h:97-102), and a total above it reachesmakeString'sCRASH()(StringConcatenate.h:493-494). Here a nullselformethodNamethrowsstd::invalid_argumentand an oversized result throwsstd::length_error, the same exception the existingStringImpl::createexport uses. Not compared with a console module.tools/pr_overlap.pylists #13486 under the same exports. That PR is a relinker draft whose head is unchanged at0bde10d243and whose merge base87755c8519predates the 8703 stubs, so its diff re-adds them, all still throwing; it implements neither export. No open PR adds the same new files. The tool could not compare 44 PRs that conflict withmain;toolchain/nkwebkit_batch_check.pycompared their changed lines and none shares either export, and a scan of all 101 open NKWebKit heads found no otherLogSiteIdentifierorWtfLoggerreference. Line conflicts are the debt count line (docs/dev/debt/libSceNKWebKit.md:39), the lines the new debt entry occupies (:14-15, #16016), the neighbouring stubs (Export.cpp:36497-36508,InventoryExports.hpp:6121-6123, #13992), the deleted debt rows (:6044-6046, #13992) and the end ofsrc/WtfStringAbi.hpp, where #15866 addsSHA1and #15517 also edits the file. Whichever merges later keeps both sides.Tested
Windows 11 Pro, WinLibs GCC 15.2.0. No title and no console module.
nkwebkit_wtfloggerpins both signatures withstatic_assertand, for every result, checks a non-nullimpl, the 8-bit flag (hashAndFlags & 4), the exact length and the exact bytes:(0),(10),(ABC)and(FFFFFFFFFFFFFFFF);Cls::run(1F),run(1F),::run(0)andcaf\xE9::m(1)with the byte above 0x7F kept; a null method name and a nullselfthrow. The oversized path is not exercised, because it needs a string of about 2 GB. The test runs and prints both expected lines;ctest -R nkwebkit_wtfloggerpasses.cmake --build build --parallel -- -k 0exits 0.ctest -R nkwebkit: 14 of 14 pass.ctest -R public_headers: 65 of 65 pass.tools/progress.py: 1323 of 11248, two more thanmain(1321). Whole suite not 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)