feat(libSceNKWebKit): implement Inspector script call stacks #16261
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16261"
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-06T01:40:54Z.
What
Implements 23
libSceNKWebKitexports fromSource/JavaScriptCore/inspector/ScriptCallFrame.cpp,ScriptCallStack.cppandAsyncStackTrace.cppat80f77e94c6.ScriptCallFrame: copy constructor (C1,C2), destructor (D1,D2), copy assignment andisNative.ScriptCallStack:create, constructors (C1,C2), destructors (D1,D2),at,firstNonNativeCallFrameandisEqual.AsyncStackTrace: destructors (D1,D2),isPending,isLocked,willDispatchAsyncCall,didDispatchAsyncCall,didCancelAsyncCall,truncateandremove.Six exports that
mainalready implements are dropped:ScriptCallFrame::functionName(ArgumentReturn.cpp),sourceURL,lineNumber,columnNumberandsourceID(FieldGetters.cpp), andScriptCallStack::size(FieldGetters.cpp).Offsets:
mainreads the line at+0x14, the column at+0x18and the source ID at+0x10. The pinnedScriptCallFrame.hhas threeStringmembers (8 bytes each) at 0, 8 and 16, thenJSC::SourceIDat 24,unsigned lineNumberat 28 andunsigned columnat 32;SourceIDisuint32_t(Source/JavaScriptCore/bytecode/SourceID.h:30), so the frame is 40 bytes, not 48.main's+0x10,+0x14and+0x18are the high halves of thescriptNameandpreRedirectURLpointers and the source ID, not the intended fields. This PR changesFieldGetters.cppto+0x18/+0x1c/+0x20and updatesnkwebkit_fieldgettersto write and read 24, 28 and 32;nkwebkit_inspectorcallstackalso checks the getters. The frame layout is pinned withstatic_assert(sizeof(ScriptCallFrame) == 40)insrc/InspectorCallStackAbi.hppand the same offsets are asserted by the test.Placement: the three files are hand-written ports in
core/libs/prx/libSceNKWebKit/src/, with the upstream Apple licence notices kept verbatim, as the other NKWebKit ports do. The guest layouts are pinned insrc/InspectorCallStackAbi.hppand the tests are intests/. There is no submodule and no new build target; this follows the review decision against a WebKit submodule. The stack and trace reference counts are relaxed atomics in the same 4 bytes at offset 0; the pinnedRefCountedis non-atomic, so the port is stricter but layout-compatible.Reachability:
ScriptCallStack::create()returns an empty stack, exactly as upstream.ScriptCallStack::create(Vector&&),appendand the other internal helpers are not inventory NIDs, and the inspector factory exports (createScriptCallStack*) are still stubs, so no title in our traces fills frames through these exports;AsyncStackTracehas no create export. The getters and destructors are layout-compatible with stacks the guest creates internally.buildInspectorObjectandbuildInspectorArrayremain stubs because they needJSONvalues (#13992). Null objects, invalid async states, an out-of-rangeatand a removal from a parent with no children throw where the console reads out of bounds or asserts.Tested
Windows 11 Pro, WinLibs GCC 15.2.0. Full build exit 0.
ctest -R nkwebkit: 63 of 63.ctest -R public_headers: 65 of 65.tools/check_conventions.py --base origin/main: no findings.tools/progress.py: libraries 2785 of 11258, 23 more thanmain's 2762 of 11258; debt 5974.git diff --checkclean. No title or console module.Based on
main65351c2931. #16383 adds noScriptCallFrame,ScriptCallStackorAsyncStackTraceexport; the debt count line is 5997 onmain, 5974 here and 5955 after both.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)core/with its upstream licence notice kept verbatim, as the other NKWebKit files do; no new submodule, per reviewImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T14:23:18Z.
Review: COMMENTED
Reviewed — comments
The prepared description reports successful Windows builds and tests, but I could not run checks here and several changed files were not read, so the evidence does not support a formal approval or a verified blocking finding.
What I ran
The change is pinned to head
7137c36b4b1a419ad1fb245a2d4e3344e9022112, based onmain. No commands or tests were run; the available reader interface exposed the prepared bundle and repository reads only.Results
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
The description reports a Windows 11 Pro build,
nkwebkitandpublic_headerstests, convention checks, and a cleangit diff --check; these were not run during this review. I readreview/description.md,review/commits.md,review/manifest.json, the prepared file listing,core/libs/prx/libSceNKWebKit/src/InspectorScriptCallFrame.cpp,core/libs/prx/libSceNKWebKit/src/InspectorScriptCallStack.cpp, and portions ofcore/libs/prx/libSceNKWebKit/src/InspectorAsyncStackTrace.cpp,core/libs/prx/libSceNKWebKit/src/InspectorCallStackAbi.hpp,core/libs/prx/libSceNKWebKit/tests/InspectorCallStack.cpp, andreview/diff.patch. The files marked excluded by the manifest werecore/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, anddocs/dev/debt/libSceNKWebKit.md; they were not read. I also did not read all included changed files or the complete test file, so behavior outside the inspected sections is not verified.To get this to a good state
Nothing is required. Optional: complete the review of the changed files that were not read and run the reported checks on this head.