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

Run Wasm code on a separate stack #2807

Merged
merged 13 commits into from
Mar 16, 2022
Merged

Run Wasm code on a separate stack #2807

merged 13 commits into from
Mar 16, 2022

Commits on Mar 14, 2022

  1. Configuration menu
    Copy the full SHA
    7467ec3 View commit details
    Browse the repository at this point in the history
  2. Fix stack probing in the singlepass compiler

    Stack probes must be done before the stack pointer is adjusted. This
    ensures that the stack pointer is still within the bounds of the stack
    when inspected by the signal handler.
    Amanieu committed Mar 14, 2022
    Configuration menu
    Copy the full SHA
    054e524 View commit details
    Browse the repository at this point in the history
  3. Run Wasm code on a separate stack

    This uses the [corosensei](https://crates.io/crates/corosensei) crate to
    run Wasm code on a separate stack from the main thread stack.
    
    In trap handlers for stack overflows and memory out of bounds accesses,
    we can now check whether we are executing on the Wasm stack and reset
    execution back to the main thread stack when returning from the trap
    handler.
    
    When Wasm code needs to perform an operation which may modify internal
    data structures (e.g. growing a memory) then execution must switch back
    to the main thread stack using on_host_stack. This is necessary to avoid
    leaving internal data structure in an inconsistent state when a stack
    overflow happens.
    
    In the future, this can also be used to suspend execution of a Wasm
    module (#1127) by modeling it as an async function call.
    
    Fixes #2757
    Fixes #2562
    Amanieu committed Mar 14, 2022
    Configuration menu
    Copy the full SHA
    ca6f83c View commit details
    Browse the repository at this point in the history
  4. Fix unused field lint

    Amanieu committed Mar 14, 2022
    Configuration menu
    Copy the full SHA
    83fd790 View commit details
    Browse the repository at this point in the history
  5. Fix stack probing typo

    Amanieu committed Mar 14, 2022
    Configuration menu
    Copy the full SHA
    2b86fe8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f9d1cfd View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    58bab0f View commit details
    Browse the repository at this point in the history
  8. Try to enable more tests

    Amanieu committed Mar 14, 2022
    Configuration menu
    Copy the full SHA
    af3d948 View commit details
    Browse the repository at this point in the history
  9. Remove the custom probestack trampoline in compiler-cranelift

    This is now handled by the generic trampoline code in the engine.
    Amanieu committed Mar 14, 2022
    Configuration menu
    Copy the full SHA
    657bbae View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a280914 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3d52bf2 View commit details
    Browse the repository at this point in the history
  12. Update corosensei to 0.1.2

    Amanieu committed Mar 14, 2022
    Configuration menu
    Copy the full SHA
    742c20a View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    c4e1c5f View commit details
    Browse the repository at this point in the history