Closed Bug 1477063 Opened 6 years ago Closed 4 years ago

Debugger: Leave frame.live true for suspended generator frames

Categories

(Core :: JavaScript Engine, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: jorendorff, Assigned: jorendorff)

References

(Blocks 1 open bug)

Details

Attachments

(14 obsolete files)

All the state needed to recreate an actual stack frame is present in a suspended generator, so it should be possible to query a suspended generator frame like any other frame.

Wait, wait-- I'm getting a signal from ... THE FUTURE

It's me! I'm saying that... querying the suspended frame turns out to be embarrassingly easy, to the point of not even being interesting... while getting the bookkeeping right involves fixing an apparently endless long tail of assertions.

Hmm.

I'm going to try to get someone else to take this bug.
jimb refuses to take, claiming the resulting time-travel paradox would destroy the universe :-P
Attached patch Part 1: A few minor cleanups (obsolete) — Splinter Review
DebuggerFrame::RESERVED_SLOTS is inaccurate and fortunately unused.
Attachment #8998295 - Flags: review?(jimb)
Assignee: nobody → jorendorff
Status: NEW → ASSIGNED
For compartment correctness, the reference is via a Debugger.Object whose
referent is the actual GeneratorObject.
Attachment #8998297 - Flags: review?(jimb)
The slot won't be accessed again once the Frame is inactive, because all
operations on the Frame throw. So the sole effect of these changes is that
inactive Frame objects no longer keep the generator unnecessarily GC-alive.
Attachment #8998305 - Flags: review?(jimb)
There's also a little bit of code motion in this patch--not much. Still no
observable change in behavior.
Attachment #8998307 - Flags: review?(jimb)
This is an AbstractFramePtr lookalike that can also handle suspended
generators, answering many of the same questions the debugger might ask of any
on-stack frame.

In this patch the type is implemented but not used.

TODO: See if it could just be a Variant.
TODO: Implement js::GetThisValueForDebuggerMaybeOptimizedOutGenerator.
With this change, suspended Debugger.Frame objects are now `.live`.
Depends on: 1448880
DebuggerFrame::RESERVED_SLOTS is inaccurate and fortunately unused.

Depends on D6990
For compartment correctness, the reference is via a Debugger.Object whose
referent is the actual GeneratorObject.

Depends on D7012
The slot won't be accessed again once the Frame is inactive, because all
operations on the Frame throw. So the sole effect of these changes is that
inactive Frame objects no longer keep the generator unnecessarily GC-alive.

Depends on D7015
There's also a little bit of code motion in this patch--not much. Still no
observable change in behavior.

Depends on D7016
Attachment #8998295 - Attachment is obsolete: true
Attachment #8998295 - Flags: review?(jimb)
Attachment #8998297 - Attachment is obsolete: true
Attachment #8998297 - Flags: review?(jimb)
Attachment #8998305 - Attachment is obsolete: true
Attachment #8998305 - Flags: review?(jimb)
Attachment #8998307 - Attachment is obsolete: true
Attachment #8998307 - Flags: review?(jimb)
Attachment #8998308 - Attachment is obsolete: true
Attachment #8998308 - Flags: review?(jimb)
Blocks: 1494769
Priority: -- → P2
This is an AbstractFramePtr lookalike that can also handle suspended
generators, answering many of the same questions the debugger might ask of any
on-stack frame.

In this patch the type is implemented but not used.

TODO: Implement js::GetThisValueForDebuggerMaybeOptimizedOutGenerator.

Depends on D7019
With this change, suspended Debugger.Frame objects are now `.live`.

Depends on D10386
Attachment #8998309 - Attachment is obsolete: true
Attachment #8998310 - Attachment is obsolete: true
Blocks: 1512292
Attachment #9012397 - Attachment is obsolete: true
Attachment #9012402 - Attachment is obsolete: true
Attachment #9012403 - Attachment is obsolete: true
Attachment #9012405 - Attachment is obsolete: true
Attachment #9012406 - Attachment is obsolete: true
Attachment #9021557 - Attachment is obsolete: true
Attachment #9021559 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: