Closed Bug 1703287 Opened 5 years ago Closed 5 years ago

Document why the atomic instructions are gated on javascript.options.shared_memory

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: lth, Assigned: lth)

Details

Attachments

(1 file)

Since the atomic instructions are allowed on nonshared memories, the gating could be removed from the instruction decoders without risking opening up for "shared memory" behavior (high-resolution clocks etc). However, there's always the slight risk that executing memory fences on nonshared memories can be used to communicate in some fashion, and it is more consistent to disable these instructions altogether if the option disables shared memory. A little documentation goes a long way here.

Should also check that JS does something reasonable with atomics if the switch is disabled, maybe JS wants a comment too.

(In reply to Lars T Hansen [:lth] from comment #0)

Should also check that JS does something reasonable with atomics if the switch is disabled, maybe JS wants a comment too.

JS has the same behavior: disabling javascript.options.shared_memory makes the Atomics namespace undefined, hence atomic operations are not available at all if the option is disabled.

As is the case for JS, when j.o.shared_memory=false we remove the atomic operations
altogether for maximum safety; this just documents that it is not an accident.

Pushed by lhansen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/35b1d4bfe9d8 Document removal of wasm thread ops under j.o.shared_memory=false. r=rhunt DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 5 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: