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

Refactor #1524

Merged
merged 24 commits into from
Apr 20, 2020
Merged

Refactor #1524

merged 24 commits into from
Apr 20, 2020

Commits on Apr 20, 2020

  1. Compute instance exports on demand.

    Instead having instances eagerly compute a Vec of Externs, and bumping
    the refcount for each Extern, compute Externs on demand.
    
    This also enables `Instance::get_export` to avoid doing a linear search.
    
    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 20, 2020
    Configuration menu
    Copy the full SHA
    6ff9c4c View commit details
    Browse the repository at this point in the history
  2. Compute module imports and exports on demand too.

    And compute Extern::ty on demand too.
    sunfishcode committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    725355d View commit details
    Browse the repository at this point in the history
  3. Rename wasmtime_environ::Export to EntityIndex.

    This helps differentiate it from other Export types in the tree, and
    describes what it is.
    sunfishcode committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    e058c04 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    05f7534 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d1f2996 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    677ab4e View commit details
    Browse the repository at this point in the history
  7. Fix a typo in a comment.

    sunfishcode committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    8d5c016 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d9a813c View commit details
    Browse the repository at this point in the history
  9. Make Instance::exports return the export names.

    This significantly simplifies the public API, as it's relatively common
    to need the names, and this avoids the need to do a zip with
    `Module::exports`.
    
    This also changes `ImportType` and `ExportType` to have public members
    instead of private members and accessors, as I find that simplifies the
    usage particularly in cases where there are temporary instances.
    sunfishcode committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    73c82b7 View commit details
    Browse the repository at this point in the history
  10. Remove Instance::module.

    This doesn't quite remove `Instance`'s `module` member, it gets a step
    closer.
    sunfishcode committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    a7bf93e View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    9cf5fb7 View commit details
    Browse the repository at this point in the history
  12. Don't consume self in the Func::get* methods.

    Instead, just create a closure containing the instance handle and the
    export for them to call.
    sunfishcode committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    842bd95 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    1148814 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    e32dcf5 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    5ddf2b3 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    366e8c4 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    1811256 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    ad9414d View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    b2b5e8d View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    e4b07c5 View commit details
    Browse the repository at this point in the history
  21. Make wasmtime::Export's fields private.

    This makes them more consistent with ExportType.
    sunfishcode committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    b53c7c1 View commit details
    Browse the repository at this point in the history
  22. Fix compilation error.

    sunfishcode committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    8050fea View commit details
    Browse the repository at this point in the history
  23. Make a lifetime parameter explicit, and use better lifetime names.

    Instead of 'me, use 'instance and 'module to make it clear what the
    lifetime is.
    sunfishcode committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    8d96fff View commit details
    Browse the repository at this point in the history
  24. More lifetime cleanups.

    sunfishcode committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    2ce07d0 View commit details
    Browse the repository at this point in the history