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

Skip type checks on tables that don't need it #8172

Merged

Commits on Mar 18, 2024

  1. Enhance typed-funcrefs.wast test with more cases

    Have the same function with slightly different variations to compare
    codegen between the possible strategies.
    alexcrichton committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    3e91941 View commit details
    Browse the repository at this point in the history
  2. Skip type checks on tables that don't need it

    This commit implements an optimization to skip type checks in
    `call_indirect` for tables that don't require it. With the
    function-references proposal it's possible to have tables of a single
    type of function as opposed to today's default `funcref` which is a
    heterogenous set of functions. In this situation it's possible that a
    `call_indirect`'s type tag matches the type tag of a
    `table`-of-typed-`funcref`-values, meaning that it's impossible for the
    type check to fail.
    
    The type check of a function pointer in `call_indirect` is refactored
    here to take the table's type into account. Various things are shuffled
    around to ensure that the right traps still show up in the right places
    but the important part is that, when possible, the type check is omitted
    entirely.
    alexcrichton committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    deb50b6 View commit details
    Browse the repository at this point in the history
  3. Update crates/cranelift/src/func_environ.rs

    Co-authored-by: Jamey Sharp <jamey@minilop.net>
    alexcrichton and jameysharp authored Mar 18, 2024
    Configuration menu
    Copy the full SHA
    c6a80a1 View commit details
    Browse the repository at this point in the history