Open Bug 1627111 Opened 4 years ago Updated 1 year ago

Support relazifying async/generator functions

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

REOPENED

People

(Reporter: tcampbell, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf-alert, Whiteboard: [overhead:14kb])

Attachments

(3 files)

Thanks to the BaseScript and BaselineInterpreter projects it should be feasible to support relazifying async and generator functions.

A few places need to replace JSFunction::nonLazyScript() calls with JSFunction::getOrCreateScript(). We already check for a JitScript before using the Baseline resume-entrypoints which simplifies things.

This allows the AsyncGeneratorResume logic to determine how to resume without
needing access to the full bytecode.

Add a few uses of JSFunction::getOrCreateScript to tolerate lazy generators
in the resume code. We then remove the relazification restrictions.

Depends on D69458

Here is a prototype of it. I need a big more targeted testing for correctness and validation of performance. One nice aspect of the new BaseScript design, is that mistakes here will only result in nullptr crashes by trying to access bytecode on a lazy script.

This prototype is still pretty broken in a few cases.

Attachment #9137884 - Attachment description: Bug 1627111 - Store the opcode that caused a generator to pause → Bug 1627111 - Store the opcode that caused a generator to pause. r?jandem!
Attachment #9137885 - Attachment description: Bug 1627111 - Allow relazifying generators → Bug 1627111 - Allow relazifying generators. r?jandem!

In later patches, this may GC and this may be moved.

Depends on D69458

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8d0cb8c6bb7c
Store the opcode that caused a generator to pause. r=jandem
https://hg.mozilla.org/integration/autoland/rev/5ff84c1e2f55
Make DebuggerFrame::setGeneratorInfo static. r=jandem
https://hg.mozilla.org/integration/autoland/rev/28e150b3df59
Allow relazifying generators. r=jandem
Regressions: 1689314
Regressions: 1689797
Regressions: 1689497
Status: RESOLVED → REOPENED
Flags: needinfo?(tcampbell)
Resolution: FIXED → ---
Target Milestone: 87 Branch → ---

== Change summary for alert #28570 (as of Mon, 01 Feb 2021 11:31:22 GMT) ==

Improvements:

Ratio Suite Test Platform Options Absolute values (old vs new)
1% Base Content JS windows10-64-shippable 2,511,200.00 -> 2,497,386.67
1% Base Content JS windows10-64-shippable-qr 2,511,197.33 -> 2,497,349.33
1% Base Content JS windows10-64-shippable-qr 2,511,200.00 -> 2,497,381.33
1% Base Content JS linux1804-64-shippable 2,506,725.33 -> 2,493,149.33
1% Base Content JS linux1804-64-shippable-qr 2,506,064.00 -> 2,493,257.33
0.45% Base Content JS macosx1014-64-shippable-qr 2,509,365.33 -> 2,498,001.33

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=28570

Flags: needinfo?(tcampbell)
Priority: P2 → P3
Whiteboard: [overhead:14kb]

== Change summary for alert #28601 (as of Wed, 03 Feb 2021 10:47:34 GMT) ==

Regressions:

Ratio Suite Test Platform Options Absolute values (old vs new)
1% Base Content JS macosx1014-64-shippable-qr 2,498,901.33 -> 2,512,853.33
1% Base Content JS linux1804-64-shippable 2,492,894.00 -> 2,506,218.67
1% Base Content JS windows10-64-shippable 2,497,268.00 -> 2,510,589.33
1% Base Content JS windows10-64-shippable-qr 2,497,264.67 -> 2,510,576.00
1% Base Content JS windows10-64-shippable-qr 2,497,262.67 -> 2,510,584.00
1% Base Content JS linux1804-64-shippable-qr 2,493,860.67 -> 2,506,906.67

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=28601

Severity: normal → S3

The patches I had here were not sound. It may be possible to fix still, but it is not a priority

Assignee: tcampbell → nobody
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: