Closed Bug 1701827 Opened 4 years ago Closed 4 years ago

Allow multiple JS::Stencil instantiations while source-compression is pending

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

When we try to use a JS::Stencil multiple times (such as for future Bug 1670403), we risk trying to trigger source compression while an existing compression is pending which trips our consistency checks.

A simple workaround might be to add an additional flag to ScriptSource to indicate the compression has already been attempted.

If a Stencil is re-used while a SourceCompressionTask was pending we would
previously risk creating a second task which would race. To avoid this, this
patch tracks that a SourceCompressionTask has already been issued and
creating another. Existing use-case in the browser do not reuse Stencil so
this is not a problem yet, but we intend to soon so this must be fixed.

If the original source-compression failed (such as because OOM), later
instantiations will not retry. Compression is optional and the single-user
case does not offer a good story here, so I think this is fine.

Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/eeeaa64f16e5 Avoid source-compression races when using JS::Stencil multiple times. r=jonco
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: