feat(libSceJsc): return from four destructors and didCreateFrontendAndBackend as firmware 13.42 does #15617

Merged
BunnyFl merged 2 commits from upstream-pr/15617 into main 2026-11-07 13:19:18 +00:00
BunnyFl commented 2026-11-03 22:05:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-03T22:05:02Z.


What

Five libSceJsc exports threw. In firmware 13.42 each body is a lone ret, and this change does the same:

Export NID Signature here
JSC::VM::ClientData::~ClientData() (D1) +tuS+migTvI void (void* self)
bmalloc::FreeList::~FreeList() (D2) 0qmAOS00O2g void (void* self)
Inspector::DebuggerBackendDispatcherHandler::~DebuggerBackendDispatcherHandler() (D2) 0QbSxsg9i1M void (void* self)
Inspector::TimelineBackendDispatcherHandler::~TimelineBackendDispatcherHandler() (D1) -hk9wmuusRU void (void* self)
Inspector::InspectorDebuggerAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) -md9AgyWZkw void (void* self, void*, void*)

The parameters come from the mangled names, and the declarations in core/libs/prx/libSceJsc/include/Api.hpp change with them.

In docs/dev/debt/libSceJsc.md, the "Known export names" entry goes from 150 to 145 throwing exports. A new "Empty bodies" entry says the console JavaScriptCore version is unverified and the bodies were read from disassembly, not measured on a console.

Source

Firmware 13.42 system_ex/common_ex/lib/libSceJsc.sprx (sha256 4d00f49cd9d53c5c7e75aebfb00f2df37b8d225f68559066d653f6f1cbde45ec), read from disassembly, not run on a console. Export addresses come from the module's dynamic symbol table. Each body:

909550: ret   ; JSC::VM::ClientData D1
a477e0: ret   ; bmalloc::FreeList D2
295db0: ret   ; Inspector::DebuggerBackendDispatcherHandler D2
295f10: ret   ; Inspector::TimelineBackendDispatcherHandler D1
35f8a0: ret   ; Inspector::InspectorDebuggerAgent::didCreateFrontendAndBackend

None of the five bodies above reads an argument or stores anything. A null or invalid pointer is never dereferenced, here or in firmware.

Tested

  • Windows 11, WinLibs GCC, Release, head 15618bf7d2: 67 of 67 pass. That is guest_jsc_string, the new guest_jsc_trivial_returns, public_headers and the 64 public_headers_compile_* batches.
  • New core/libs/tests/GuestJscTrivialReturns.cpp calls the five, passes null pointers to didCreateFrontendAndBackend as well, and checks that every buffer passed in is unchanged.
  • Negative control: I put NotImplemented_nid_no_patch(__func__) back in the five bodies, which is main's behaviour, and kept this branch's signatures and test. The new test then aborts with _ZN3JSC2VM10ClientDataD1Ev not implemented (1 of 1 failed).
  • tools/check_conventions.py --base upstream/main on the committed head: all checks pass.
  • tools/pr_overlap.py --branch: only #13135 shares lines. Its diff doesn't name these five functions.
  • Linux and macOS were not built or run. No title was run.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5145212802 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15617). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-03T22:05:02Z. --- ### What Five libSceJsc exports threw. In firmware 13.42 each body is a lone `ret`, and this change does the same: | Export | NID | Signature here | |---|---|---| | `JSC::VM::ClientData::~ClientData()` (`D1`) | `+tuS+migTvI` | `void (void* self)` | | `bmalloc::FreeList::~FreeList()` (`D2`) | `0qmAOS00O2g` | `void (void* self)` | | `Inspector::DebuggerBackendDispatcherHandler::~DebuggerBackendDispatcherHandler()` (`D2`) | `0QbSxsg9i1M` | `void (void* self)` | | `Inspector::TimelineBackendDispatcherHandler::~TimelineBackendDispatcherHandler()` (`D1`) | `-hk9wmuusRU` | `void (void* self)` | | `Inspector::InspectorDebuggerAgent::didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*)` | `-md9AgyWZkw` | `void (void* self, void*, void*)` | The parameters come from the mangled names, and the declarations in `core/libs/prx/libSceJsc/include/Api.hpp` change with them. In `docs/dev/debt/libSceJsc.md`, the "Known export names" entry goes from 150 to 145 throwing exports. A new "Empty bodies" entry says the console JavaScriptCore version is unverified and the bodies were read from disassembly, not measured on a console. ### Source Firmware 13.42 `system_ex/common_ex/lib/libSceJsc.sprx` (sha256 `4d00f49cd9d53c5c7e75aebfb00f2df37b8d225f68559066d653f6f1cbde45ec`), read from disassembly, not run on a console. Export addresses come from the module's dynamic symbol table. Each body: ``` 909550: ret ; JSC::VM::ClientData D1 a477e0: ret ; bmalloc::FreeList D2 295db0: ret ; Inspector::DebuggerBackendDispatcherHandler D2 295f10: ret ; Inspector::TimelineBackendDispatcherHandler D1 35f8a0: ret ; Inspector::InspectorDebuggerAgent::didCreateFrontendAndBackend ``` None of the five bodies above reads an argument or stores anything. A null or invalid pointer is never dereferenced, here or in firmware. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - Windows 11, WinLibs GCC, Release, head `15618bf7d2`: 67 of 67 pass. That is `guest_jsc_string`, the new `guest_jsc_trivial_returns`, `public_headers` and the 64 `public_headers_compile_*` batches. - New `core/libs/tests/GuestJscTrivialReturns.cpp` calls the five, passes null pointers to `didCreateFrontendAndBackend` as well, and checks that every buffer passed in is unchanged. - **Negative control:** I put `NotImplemented_nid_no_patch(__func__)` back in the five bodies, which is `main`'s behaviour, and kept this branch's signatures and test. The new test then aborts with `_ZN3JSC2VM10ClientDataD1Ev not implemented` (1 of 1 failed). - `tools/check_conventions.py --base upstream/main` on the committed head: all checks pass. - `tools/pr_overlap.py --branch`: only #13135 shares lines. Its diff doesn't name these five functions. - Linux and macOS were not built or run. No title was run. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!15617
No description provided.