Closed Bug 1548075 Opened 5 years ago Closed 5 years ago

AbstractGeneratorObject "closing" state is unused

Categories

(Core :: JavaScript Engine, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: jimb, Assigned: jimb)

References

Details

(Whiteboard: [debugger-mvp])

Attachments

(1 file)

Nothing in SpiderMonkey distinguishes between an AbstractGeneratorObject in the "running" state versus the "closing" state; its presence is unnecessarily confusing. All code instead throws a JSWhyMagic::JS_GENERATOR_CLOSING value and checks JSContext::isClosingGenerator to manage generators that have been forcibly closed.

The generator 'closing' state, indicated by the value RESUME_INDEX_CLOSING in an
AbstractGeneratorObject's RESUME_INDEX_SLOT is never distinguished from the
'running' state, so RESUME_INDEX_CLOSING, and its associated setters and
predicates, can be removed.

RESUME_INDEX_RUNNING remains as a magic value appearing in the resume index
slot, and is now used as an upper bound on normal resume index values instead of
RESUME_INDEX_CLOSING.

Blocks: 1546727
Pushed by jblandy@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/32a3534e33fd
Remove 'closing' state from AbstractGeneratorObject. r=iain
Assignee: nobody → jimb
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Whiteboard: [debugger-mvp]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: