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

Add an instance API for invoking the WASI start functions. #1516

Closed
wants to merge 4 commits into from

Commits on Apr 15, 2020

  1. Add an instance API for invoking the WASI start functions.

    This adds support for the WASI reactor ABI proposed in
    WebAssembly/WASI#256, as well as the existing
    _start ABI for commands.
    
    This also implements the semantics that command instances should not
    persist after their _start function is called. As a safety measure,
    this includes a check that the instance refcount is 1, so that other
    references to the instance don't hold it live.
    
    Implementing that prompted a change to how the main Instance API works.
    Instead having instances eagerly compute a Vec of Externs, and bumping
    the refcount for each Extern, compute Externs on demand.
    
    This also means that the closure returned by `get0` and friends now
    holds an `InstanceHandle` to dynamically hold the instance live rather
    than being scoped to a lifetime.
    sunfishcode committed Apr 15, 2020
    Configuration menu
    Copy the full SHA
    31e83af View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    98ad826 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2020

  1. Make Module's exports and imports methods lazy too.

    Make `Module::exports` and `Module::imports` return iterators instead of
    slices, and compute them on demand rather than eagerly.
    
    Also, compute them from wasmtime_environ's data structures, rather than
    re-decoding the wasm bytes.
    
    To support this, change wasmtime_environ::Module hold a single imports
    array rather than having per-type arrays.
    sunfishcode committed Apr 16, 2020
    Configuration menu
    Copy the full SHA
    ad4e6c6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7b3e8a3 View commit details
    Browse the repository at this point in the history