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

Experimental: Improve wasmi_ir generated constructors #1188

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Robbepop
Copy link
Member

@Robbepop Robbepop commented Sep 19, 2024

This PR is experimental and I am not sure if merging this will improve wasmi_ir::Instruction constructors substantially enough to compensate for the disadvantages of the chosen approach.

This primarily changes some constructor parameters, e.g.:

  • values: impl Into<[Reg; 2]> becomes values: [impl Into<Reg>; 2]
  • len_targets: impl Into<u32> becomes len_targets: u32

This PR does not touch constructors for InstrSequence.

The major disadvantage (besides the complexity) is that we have to wrap some of the field types with (), e.g. Const16<i32> becomes (Const16<i32>). This does not change semantics of the type since both are equal but it allows to match all field types as tt (token-tree) in macro_rules macros.

A proc. macro based approach could yield better results without the aforementioned disadvantage.

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.64%. Comparing base (b48685f) to head (f58907a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1188      +/-   ##
==========================================
- Coverage   80.64%   80.64%   -0.01%     
==========================================
  Files         299      299              
  Lines       24511    24511              
==========================================
- Hits        19768    19767       -1     
- Misses       4743     4744       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant