Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rework async function semantics #3033

Merged
merged 83 commits into from
Aug 15, 2019
Merged

rework async function semantics #3033

merged 83 commits into from
Aug 15, 2019

Commits on Jul 19, 2019

  1. Configuration menu
    Copy the full SHA
    54e716a View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2019

  1. Configuration menu
    Copy the full SHA
    72e9836 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    27a5f2c View commit details
    Browse the repository at this point in the history
  3. fix not jumping to entry

    andrewrk committed Jul 21, 2019
    Configuration menu
    Copy the full SHA
    6053ca4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    56c08eb View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    78e03c4 View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2019

  1. implement coroutine resume

    andrewrk committed Jul 22, 2019
    Configuration menu
    Copy the full SHA
    11bd50f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    59bf9ca View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    32d0ac1 View commit details
    Browse the repository at this point in the history
  4. disable segfault handler when panicking

    this prevents a segfault in stack trace printing to activate the
    segfault handler.
    andrewrk committed Jul 22, 2019
    Configuration menu
    Copy the full SHA
    5b69a9c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    650e07e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fcadeb5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    317d1ec View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2019

  1. Configuration menu
    Copy the full SHA
    7e9760d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    19ee495 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2019

  1. Configuration menu
    Copy the full SHA
    e220812 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2019

  1. Configuration menu
    Copy the full SHA
    ead2d32 View commit details
    Browse the repository at this point in the history
  2. implement @frame and @Frame

    andrewrk committed Jul 25, 2019
    Configuration menu
    Copy the full SHA
    70bced5 View commit details
    Browse the repository at this point in the history
  3. implement @frameSize

    andrewrk committed Jul 25, 2019
    Configuration menu
    Copy the full SHA
    538c0cd View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2019

  1. Configuration menu
    Copy the full SHA
    7b36868 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    018a89c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ee64a22 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2019

  1. improve support for anyframe and anyframe->T

     * add implicit cast from `*@frame(func)` to `anyframe->T` or `anyframe`.
     * add implicit cast from `anyframe->T` to `anyframe`.
     * `resume` works on `anyframe->T` and `anyframe` types.
    andrewrk committed Jul 29, 2019
    Configuration menu
    Copy the full SHA
    dbdc4d6 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2019

  1. Configuration menu
    Copy the full SHA
    e7ae4e4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1dd0c3d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0f879d0 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2019

  1. Configuration menu
    Copy the full SHA
    056c4e2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f07f09a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b3b6a98 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5bd330e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0920bb0 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2019

  1. Configuration menu
    Copy the full SHA
    24d7817 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e444e73 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c879209 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    87710a1 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2019

  1. Configuration menu
    Copy the full SHA
    1292447 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fa30ebf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    042914d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    fbf21ef View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b7c94be View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2019

  1. Configuration menu
    Copy the full SHA
    f27e5d4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0d8c9fc View commit details
    Browse the repository at this point in the history
  3. delete IrInstructionMarkErrRetTracePtr

    this IR instruction is no longer needed
    andrewrk committed Aug 5, 2019
    Configuration menu
    Copy the full SHA
    a7763c0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    dfe8c5a View commit details
    Browse the repository at this point in the history
  5. async functions have error return traces where appropriate

    however the traces are not merged on `await` or async function calls
    yet.
    
    When an async function has an error set or error union as its return
    type, it has a `StackTrace` before the args in the frame, so that it is
    accessible from `anyframe->T` awaiters. However when it does not have an
    errorable return type, but it does call or await an errorable, it has a
    stack trace just before the locals. This way when doing an `@asyncCall`
    on an async function pointer, it can populate the args (which are after
    the `StackTrace`) because it knows the offset of the args based only on
    the return type.
    
    This sort of matches normal functions, where a stack trace pointer could
    be supplied by a parameter, or it could be supplied by the stack of the
    function, depending on whether the function itself is errorable.
    andrewrk committed Aug 5, 2019
    Configuration menu
    Copy the full SHA
    20f63e5 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2019

  1. improve async function semantics

     * add safety panic for resuming a function which is returning, pending
       an await
     * remove IrInstructionResultPtr
     * add IrInstructionReturnBegin. This does the early return in async
       functions; does nothing in normal functions.
     * `await` gets a result location
     * `analyze_fn_async` will call `analyze_fn_body` if necessary.
     * async function frames have a result pointer field for themselves
       to access and one for the awaiter to supply before the atomic rmw.
       when returning, async functions copy the result to the awaiter result
       pointer, if it is non-null.
     * async function frames have a stack trace pointer which is supplied by
       the awaiter before the atomicrmw. Later in the frame is a stack trace
       struct and addresses, which is used for its own calls and awaits.
     * when awaiting an async function, if an early return occurred, the
       awaiter tail resumes the frame.
     * when an async function returns, early return does a suspend
       (in IrInstructionReturnBegin) before copying
       the error return trace data, result, and running the defers.
       After the last defer runs, the frame will no longer be accessed.
     * proper acquire/release atomic ordering attributes in async functions.
    andrewrk committed Aug 6, 2019
    Configuration menu
    Copy the full SHA
    400500a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    17199b0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    966c9ea View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1afbb53 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2019

  1. implement cancel

    all behavior tests passing in this branch
    andrewrk committed Aug 7, 2019
    Configuration menu
    Copy the full SHA
    7e1fcb5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f587fa1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e11cafb View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2019

  1. Configuration menu
    Copy the full SHA
    34bfdf1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d813805 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8d4cb85 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8be95af View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    bfa1d12 View commit details
    Browse the repository at this point in the history
  6. fix segfault with var args

    andrewrk committed Aug 8, 2019
    Configuration menu
    Copy the full SHA
    cfe8442 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    93840f8 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    da56959 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    614cab5 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2019

  1. Configuration menu
    Copy the full SHA
    2e7f53f View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2019

  1. Configuration menu
    Copy the full SHA
    b9d1d45 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    22428a7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    77d098e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3f5c6d7 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2019

  1. Configuration menu
    Copy the full SHA
    af8c6cc View commit details
    Browse the repository at this point in the history
  2. all tests passing

    andrewrk committed Aug 11, 2019
    Configuration menu
    Copy the full SHA
    4d8d513 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2019

  1. Configuration menu
    Copy the full SHA
    62c5bc6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    911b1a0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    24d5ec0 View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2019

  1. Configuration menu
    Copy the full SHA
    8a92899 View commit details
    Browse the repository at this point in the history
  2. alignment of structs no longer depends on LLVM

    fixes async function tests in optimized builds
    andrewrk committed Aug 13, 2019
    Configuration menu
    Copy the full SHA
    12ff91c View commit details
    Browse the repository at this point in the history
  3. organize TODOs

    andrewrk committed Aug 13, 2019
    Configuration menu
    Copy the full SHA
    82d4ebe View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5092634 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    dd8c8c0 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2019

  1. Configuration menu
    Copy the full SHA
    5749dc4 View commit details
    Browse the repository at this point in the history
  2. rename behavior test files

    andrewrk committed Aug 14, 2019
    Configuration menu
    Copy the full SHA
    7799423 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f3f838c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    64c293f View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2019

  1. remove cancel

    andrewrk committed Aug 15, 2019
    Configuration menu
    Copy the full SHA
    13b5a4b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    55f5cee View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d367249 View commit details
    Browse the repository at this point in the history