Closed Bug 1806499 Opened 3 years ago Closed 2 years ago

Cleanup WASM signal handler initialization

Categories

(Core :: JavaScript: WebAssembly, task, P1)

task

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: tcampbell, Assigned: jandem)

References

Details

Attachments

(1 file)

WASM signal handling on OSX uses a special handler thread which we'd like to lazily create. During various stencil work we accidentally started trigger this lazy initialization pretty eagerly from CompileOptions constructor.

To make this actually lazily on first WASM use, it probably makes more sense to check in link/instantiation code instead of parsing. Doing this also lets us remove these checks from CompileOptions and asm.js parsing.

Assignee: tcampbell → nobody

Jan, this is not high priority but you are probably the best person to untangle this in the future.

Assignee: nobody → jdemooij

After some of the Stencil changes, we now end up calling HasPlatformSupport from the
CompileOptions constructor when parsing any JS code (to check for asm.js availability).

This means we were installing the Wasm signal handlers for every process that executes
JS code. On Mac we need to create a separate thread for these signal handlers, so there is
some overhead that we want to avoid when we're not executing asm.js or Wasm code.

This patch moves the EnsureFullSignalHandlers call out of HasPlatformSupport.
We now call this when instantiating the asm.js or Wasm module.

This also simplifies the WASI build a little.

Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/66acd89da902 Move signal handler initialization out of HasPlatformSupport. r=rhunt
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: