The default bug view has changed. See this FAQ.

OdinMonkey: move code generation into parallel compilation jobs

RESOLVED DUPLICATE of bug 1181612

Status

()

Core
JavaScript Engine: JIT
RESOLVED DUPLICATE of bug 1181612
3 years ago
a year ago

People

(Reporter: luke, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
Right now, the final codegen step of compilation happens on the main thread.  This mostly falls out from having a single MacroAssembler so that all asm.js code in in a single linear slab.  Thus the main challenge to parallelizing codegen is to give each AsmJSParallelTask its own MacroAssembler and replace any current cross-function labels (viz., the ones used for function calls and exit trampolines) with entries in AsmJSStaticLinkData.  From my measurements, this would win more than 1 second on Epic Citadel uncached startup (whose compilation is about 5s).
(Reporter)

Comment 1

3 years ago
It looks like it would be easiest to wait until bug 760642 lands before trying to do this.  Otherwise, this patch will end up just getting in its way.  (Specifically, bug 760642 changes how calls are patched so that we use the single-instruction encoding in the common case and the 3-byte instruction only when the distance between the call and target is bigger than 32MB and this all requires having all the IonAssemblerBuffers together at once at link time which is counter to what I was thinking in comment 0.)
Depends on: 760642
(Reporter)

Comment 2

3 years ago
s/3-byte instruction/3-instruction call/
(Reporter)

Comment 3

3 years ago
Actually, codegen is a pretty significant part of main thread compilation these days, 2.1s (out of 8s) on Unity DT2 and .47s out of 1.9s on WMW.  Given that we're only saturating ~2 cores atm, this would mean a roughly 25% wall clock reduction.
(Reporter)

Comment 4

2 years ago
Bug 1157624 would mostly subsume this in a much simpler way that took codegen off the main parsing thread but still kept it sequential (on its own thread).  Assuming parsing is the bottleneck (it is), this would achieve the desired effect.
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1157624
(Reporter)

Updated

2 years ago
Duplicate of bug: 1181612
No longer depends on: 760642
You need to log in before you can comment on or make changes to this bug.