Closed Bug 1739679 Opened 3 years ago Closed 3 years ago

JSContext::parseTask is only used for error reporting.

Categories

(Core :: JavaScript Engine, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: nbp, Assigned: nbp)

References

Details

Attachments

(2 files)

Currently ParseTask helper thread base class is huge. Using for delazifying function would make things complex to understand as many fields would be unused in case of a delazyfication task.

However, error reporting is needed, as the bytecode has to be produced. To avoid inheriting from ParseTask for delazyfication tasks, we should instead move the error handling out of the ParseTask such that it can be used by both.

ParseTask are holding a few fields which are only used for error reporting, and
common to all parse task. To add a different kind of parse task which can be
built on a simpler base, this patch extract the error handling part and move it
into its own structure named CompileErrors.

Following this change, JSContext no longer has to refer to the parseTask, or
hold a parseTask pointer. Thus, the ParseTask pointer is replaced by
CompileErrors pointer which serves the same purpose while limiting ParseTask
accesses from out-side the HelperThread code.

Attachment #9249463 - Attachment description: Bug 1739679 - Add CompileErrors to collect off-thread errors. → Bug 1739679 - Add OffThreadFrontendErrors to collect off-thread errors.
Pushed by npierron@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/84fe8078b9de
Add OffThreadFrontendErrors to collect off-thread errors. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/c703f9f90077
clang-tidy: use range-loop in finishParseTaskCommon. r=tcampbell
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: