Closed Bug 1733970 Opened 4 months ago Closed 3 months ago

Strengthen invariants around access to per-tier information


(Core :: Javascript: WebAssembly, enhancement, P3)




95 Branch
Tracking Status
firefox95 --- fixed


(Reporter: lth, Assigned: lth)



(1 file)

+++ This bug was initially created as a clone of Bug #1733908 +++

In bug 1733908, it was discovered that some of the invariants around access to Code::tier2_ were not obeyed in certain situations where it was actually but not obviously safe not to do so. We can and should clean this up properly.

It is an invariant of Code::tier2_ that it is never read without the
atomic Code::hasTier2_ being true.

This invariant is violated in a couple of harmless cases, where code
on the thread that has just written tier2_ (the committing background
thread) will read tier2_ again before the tier-2 code is committed by
hasTier2_ being written.

This patch removes those violations at essentially zero cost.

TODO: I added a protocol here for setTier2 to return a borrowed
pointer to the tier-2 code. But it's possible that the caller of
setTier2 should just extract that pointer from values it already has
in hand. Discuss.

Attachment #9244214 - Attachment description: WIP: Bug 1733970 - Strengthen invariant on Code::tier2_ → Bug 1733970 - Strengthen invariant on Code::tier2_. r?jseward
No longer depends on: 1733908
Pushed by
Strengthen invariant on Code::tier2_. r=jseward
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
You need to log in before you can comment on or make changes to this bug.