OdinMonkey: Handle interrupts during compilation

RESOLVED WONTFIX

Status

()

Core
JavaScript Engine
RESOLVED WONTFIX
4 years ago
4 years ago

People

(Reporter: sstangl, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
After Bug 850070 and Bug 851421 are resolved, it would be worthwhile to fix browser responsiveness during AsmJS compilations, to avoid the browser locking up for seconds at a time.

Interrupt checking is complicated in parallel mode because the main thread is usually blocked on a condvar. The code that enables the interrupt flag must therefore be taught to signal the main thread. I vaguely recall that NSPR stubbornly requires the condvar mutex to be locked even for signalling -- if this is the case, we can have the main thread set an "I'm blocked" variable attached to the runtime, so the fast path can avoid locking code.

With that change, the worst pause from function compilation will be from codegen on the main thread, taking around 500ms in the worst case in our current codebases. This could be solved by performing codegen in helper threads, but with a maximum of one helper thread performing codegen at a time.

Comment 1

4 years ago
We can't do operation-callbacks during compilation because they could GC and we assume we don't GC during compilation (lots of raw PropertyName* being passed around).  The way to avoid blocking the browser is compilation in a Worker (based on FunctionBlob).

Comment 2

4 years ago
WONTFIX'ing after talking with Sean.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.