Closed Bug 1828648 Opened 2 years ago Closed 1 years ago

JS::WeakCache is not used externally and can be removed from the public headers

Categories

(Core :: JavaScript: GC, task, P5)

task

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

(Keywords: good-first-bug)

Attachments

(2 files)

No description provided.

This moves the file from js/public to js/src/gc and moved the template
specialization for GCHashMap into it from js/public/GCHashTable.h.

Assignee: nobody → jcoppeard
Status: NEW → ASSIGNED

Since this is no longer public it can move to the internal namespace.

Depends on D198686

Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2592881b3f6d Part 1: Make SweepingAPI.h an internal header r=jandem https://hg.mozilla.org/integration/autoland/rev/e6babd625779 Part 2: Move WeakCache into the js namespace r=jandem
Status: ASSIGNED → RESOLVED
Closed: 1 years ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch

I missed this patch going by until now, when I tried building my embedder codebase against ESR128. Unfortunately we relied on JS::WeakCache for a few things, like maintaining a mapping of C++ pointers to JSObjects that could be recreated if needed, but where we'd prefer to return the existing JSObject if one was still live in user code.

Would it be possible to revert this patch and expose JS::WeakCache in the API again? That would certainly be the easiest solution for me.

If that's not possible because further functionality depends on WeakCache being internal, I wonder if it'd be possible to write a replacement using only embedder-available APIs. I've got a draft of something that seems to work, but it only implements the traceWeak part. I'm not sure whether it's possible to implement the sweeping part without using internal APIs.

Regressions: 1907070
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: