Skip to content

Finish lazy stack trace support by implementing async* support and fixing line numbers #39525

@mkustermann

Description

@mkustermann

The cl/122644 adds the --lazy-async-stacks. After the CL lands we still have to do two follow up changes

  • Ensure we have correct line numbers for async frames
  • Implement support for async* functions
  • Investigate why the test fails on dartk-optcounter-linux-release-x64
  • Start rolling out the lazy stack trace support

The support for async* should be analogous to async:

  • Assign fixed context index to _AsyncStarStreamController :controller
  • Add pragma("vm:entry-point") annotations to used fields
  • In stack trace generation code, follow the metadata to find the listener

The metadata should be available via:

_AsyncStarStreamController<T>
    StreamController<T> controller
      _StreamController _varData (if `_state == _STATE_SUBSCRIBED`)
          _ControllerSubscription<T>/_BufferingStreamSubscription.<T>_onData
             _StreamIterator._onData (validate it's a _StreamIterator._onData tearoff, need to get "this" from tearoff context)
                 _StreamIterator._stateData (if is _Future)
                      _Future.... (the regular code to find awaiter from _Future)

/cc @mraleph

Metadata

Metadata

Assignees

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions