JS::WeakCache is not used externally and can be removed from the public headers
Categories
(Core :: JavaScript: GC, task, P5)
Tracking
()
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
References
Details
(Keywords: good-first-bug)
Attachments
(2 files)
Assignee | ||
Comment 1•1 years ago
|
||
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.
Updated•1 years ago
|
Assignee | ||
Comment 2•1 years ago
|
||
Since this is no longer public it can move to the internal namespace.
Depends on D198686
Comment 4•1 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2592881b3f6d
https://hg.mozilla.org/mozilla-central/rev/e6babd625779
Comment 5•1 year ago
|
||
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.
Description
•