feat(libSceNKWebKit): implement WTF StackBounds, TimingScope::scopeDidEnd and PrintStream::end #19380
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19380"
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 B-Howell on 2026-11-13T07:21:46Z.
What
Implements three WTF exports that threw through
NotImplemented_nid_no_patch, following WebKit at the pinned PS5-WebKit-11.x@80f77e9:WTF::StackBounds::currentThreadStackBoundsInternal(ycxHHEa11OI): the OS(UNIX) branch of StackBounds.cpp. It runspthread_attr_init, thenpthread_attr_get_np(pthread_self()),pthread_attr_getstackandpthread_attr_destroy, and returns{bound + size, bound}. The calls go through libkernel's ownpthread_*_nid_postfixexports; NKWebKit already links libkernel. libkernel exportspthread_attr_get_npand notpthread_getattr_np, and both branches return the same thing. The Linux-only main-thread rlimit fix-up does not apply to PlayStation. The return type is a 16-byte{m_origin, m_bound}, as in StackBounds.h L152-153. It is trivially copyable, so it comes back in RAX:RDX;static_asserts pin the layout. Where WebKit ignores a failed attribute call, this throws.WTF::TimingScope::scopeDidEnd(vNFWwy493LY): TimingScope.cpp. Totals are process-wide, keyed by the name pointer and held under a lock. Everym_logIterationIntervalcalls it logs the sameWTFLogAlwaysline. It reuses the existingMonotonicTime::nowandWTFLogAlways. The layout is{MonotonicTime m_startTime; const char* m_name; unsigned m_logIterationInterval;}at offsets 0, 8 and 16, size 24, pinned withstatic_assert. A null scope, a null name or a zero interval throws; WebKit would dereference null there or divide by zero.WTF::PrintStream::end(FyOMUdXa5Tc): its body is empty. It goes with the other empty bodies insrc/NoOpExports.cpp. Its siblingPrintStream::beginis already implemented.The technical-debt inventory drops the three rows. The StackBounds, TimingScope and
endnotes are recorded.tools/progress.pylibraries done goes from 15615 to 15618 (+3).Tested
WSL2 Ubuntu, Release, Ninja. The new checks are in
tests/Wtf.cppandtests/NoOps.cpp:std::thread: origin > bound, and a local's address lies between them. The bound equals libkernel'spthread_attr_getstackaddress, and origin equals that address plus the stack size.<name>: 2 callsline. A second name pointer counts separately, interval 1 logs on every call, and interval 0 throws. stdout and stderr are both captured, becauseWTFLogAlwayswrites through the guest stdout on Windows.PrintStream::end: is called in the NoOps test, which requires the not-implemented counter to stay unchanged.Red control: the same tests with main's stubs restored,
ctest -R '^nkwebkit_(wtf|noops)$':nkwebkit_noops ... Subprocess aborted,what(): _ZN3WTF11PrintStream3endEv not implementednkwebkit_wtf ... Subprocess aborted,what(): _ZN3WTF11StackBounds32currentThreadStackBoundsInternalEv not implementednkwebkit_wtf ... Subprocess aborted,what(): _ZN3WTF11TimingScope11scopeDidEndEv not implementedGreen:
100% tests passed, 0 tests failed out of 2(nkwebkit_noopsandnkwebkit_wtf), 3 of 3 runs.ctest -R '^public_headers':100% tests passed, 0 tests failed out of 65. Nothing was checked against a console.Overlap: 106 open PRs touch NKWebKit, Jsc or WTF paths. None adds or removes these three symbols. #14946, #14947 and #14948 have
PrintStream3endEvonly in context lines next to theirprintfandprintfVariableFormatstubs, so this PR leaves those two alone. RemovingendfromExport.cppmay cause a textual conflict in that hunk.458ed2d9dbb, an ordinary merge ofmainat82160bba912after #18538, conventions passed; doc-only conflict on the count line; count is main's stated 5949 minus this change's 3 removed stubs (5946). Main's code changes since the last merge are over 1,000 lines from this PR's hunks, so the earlier test results stand.a54945fbc6f: the WebKit notices from TimingScope.cpp and StackBounds.cpp (80f77e94c6) added verbatim tosrc/WtfTime.cppandsrc/WtfSystem.cpp(comment only), then an ordinary merge ofmainatc612c4c9e89after #19322, #17764 and #19460; doc-only union merge of the count line; count is main's stated 5939 minus this change's 3 removed stubs (5936). Main removed stubs about 20 lines from ours, so rebuilt: Windows 11, WinLibs GCC 15.2.0 r7 UCRT, Release:nkwebkit_noopsandnkwebkit_wtf3/3; conventions passed.ca540352e0e: merged main after #19603; count line removed. Ordinary merge ofmainat9b22c40f49a, conventions passed. The debt diff against main is now only this PR's entry and its 3 removed table rows. No code conflict and main changed none of this PR's other files, so not rebuilt.66653f0063brewrites eachDerived fromline asDerived from <path>@<40-character revision>, one line per source file (maintainer ruling, #19819 comment). No code changed, so no rebuild;tools/check_conventions.py --base origin/mainpasses andgit diff --checkis clean.e99e87a07c:986447e551moved this PR's debt edits intodocs/dev/debt/changes/claude-nkwebkit-wtf-stackbounds-timingscope.md(debt files match main);e99e87a07cthen merged main and kept bothtests/Wtf.cppgroups, the same resolution as a local merge on3ae84d01bd3wherenkwebkit_wtf_testsbuilt on WSL2 Ubuntu andctest -R ^nkwebkit_wtf$passed 1/1.debt_fold.py --checkandcheck_conventions.py --base origin/mainpass.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)