Closed Bug 1345307 Opened 3 years ago Closed 3 years ago

Implement runtime-wide WeakCache

Categories

(Core :: JavaScript: GC, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: sfink, Assigned: sfink)

References

Details

Attachments

(1 file)

It turns out that the problem with my gray mark bit JS test stuff was that I had a WeakCache containing things from multiple zones, and they ended up in different zone (sweep) groups. It seemed to me like a runtime-wide WeakCache would be useful, though I'm not sure how much could be ported to it (as opposed to manual sweep calls for the runtime.)
I'm not altogether clear whether this should be runtime-wide or ZoneGroup-wide. For my purposes, either would work. I looked a bit at wrapping the JitcodeGlobalTable in this, and that would be runtime-wide. But it's also not a particularly compelling use case.
Attachment #8844705 - Flags: review?(jcoppeard)
Comment on attachment 8844705 [details] [diff] [review]
Implement runtime-wide WeakCache

Review of attachment 8844705 [details] [diff] [review]:
-----------------------------------------------------------------

This looks fine.

It would be great if we could somehow assert that the per-zone weak cache only contained pointers in that zone but I don't see an easy way of doing that.
Attachment #8844705 - Flags: review?(jcoppeard) → review+
Blocks: 1337209
Pushed by sfink@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9dd78a5e9eb0
Implement runtime-wide WeakCache, r=jonco
https://hg.mozilla.org/mozilla-central/rev/9dd78a5e9eb0
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.