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 the wast component resolver #614

Merged

Commits on May 19, 2022

  1. Fix a failing test on main

    Currently `(start $f)` fails to compile because the loop that parses
    values expected a `(result ..)` to always be present, but it is not
    alwyas guaranteed to be present.
    alexcrichton committed May 19, 2022
    Configuration menu
    Copy the full SHA
    e1dc9cd View commit details
    Browse the repository at this point in the history
  2. Refactor the wast resolver

    The purpose of this commit is to cut down on the complexity of reading
    and understanding the resolver for components. These were some
    refactorings I noticed during review that I think help make it a bit
    more clear in each function what's happenign.
    
    * Add a new `Resolver` type to encapsulate the `Vec<ComponentResolver>`
      stack
    * Move freestanding functions to methods on `Resolver` and remove
      lifetime arguments on each function.
    * Rename the `ComponentResolver` type to `ComponentState` to avoid
      conflicting with `Resolver`.
    * Move `register*` functions to `ComponentState`
    alexcrichton committed May 19, 2022
    Configuration menu
    Copy the full SHA
    567ea26 View commit details
    Browse the repository at this point in the history
  3. Refactor alias injection in component resolution

    This refactors the injection of aliases to share the same code across
    components themselves, component types, and instance types. This way the
    drain of `aliases_to_insert` is only processed in one location to avoid
    having to worry about it from multiple locations.
    alexcrichton committed May 19, 2022
    Configuration menu
    Copy the full SHA
    0f37f2f View commit details
    Browse the repository at this point in the history