Closed Bug 1637424 Opened 4 years ago Closed 4 years ago

Support generators in self-hosted code

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: avandolder, Assigned: jorendorff)

References

Details

Attachments

(6 files)

Generator functions currently can't be defined in self-hosted code, as they requires the Iterator prototype to be already defined, leading to the following error when attempting to run the JS console:

Assertion failure: shape, at /js/src/vm/SelfHosting.cpp:2763

The first hurdle is to stop giving prototypes to self-hosted functions that live in the self-hosted realm. That part is easy.

The second hurdle is to make JSFunction::generatorKind() work for lazy self-hosted functions.

Assignee: nobody → jorendorff

Work-in-progress patches. Still failing a few warp tests, but Adam, if you apply these locally, you should be able to get a little farther at least.

Severity: -- → N/A
Priority: -- → P1
Attachment #9148194 - Attachment description: Bug 1637424 - Part 1: Support self-hosted builtins possibly being generators in JSFunction::generatorKind(). r?mgaudet. → Bug 1637424 - Part 1: Support self-hosted builtins possibly being generators in JSFunction::generatorKind(). r?tcampbell.
Attachment #9148195 - Attachment description: Bug 1637424 - Part 2: Stop giving prototypes to uncloned self-hosted functions. r?mgaudet. → Bug 1637424 - Part 2: Prevent runaway recursion when compiling self-hosted generators. r?tcampbell.

Depends on D75220

Depends on: 1640188
No longer depends on: 1640188
Blocks: 1568906
No longer blocks: 1568906
Blocks: 1645439
Pushed by jorendorff@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c424830cdaf9
Part 1: Support self-hosted builtins possibly being generators in JSFunction::generatorKind(). r=tcampbell.
https://hg.mozilla.org/integration/autoland/rev/b0dd4d14f584
Part 1.1: Make some functions to access uncloned self-hosted values infallible. r=tcampbell.
https://hg.mozilla.org/integration/autoland/rev/d119bd2522d8
Part 2: Prevent runaway recursion when compiling self-hosted generators. r=tcampbell.
https://hg.mozilla.org/integration/autoland/rev/9f6e9f146c37
Part 3: Delete an unused argument. r=tcampbell.
https://hg.mozilla.org/integration/autoland/rev/da3acd236f47
Part 4: Select the correct [[Prototype]] for self-hosted functions, based on kind. r=tcampbell.
https://hg.mozilla.org/integration/autoland/rev/8acea7464a54
Part 5: Prevent runaway recursion setting up %IteratorPrototype%. r=tcampbell.
Blocks: 1647794
Blocks: 1647796
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: