-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
winch: Drop FuncEnv
trait
#6443
winch: Drop FuncEnv
trait
#6443
Conversation
Subscribe to Label Action
This issue or pull request has been labeled: "winch"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
5c5f0db
to
50b1048
Compare
M: MacroAssembler, | ||
A: ABI, | ||
P: PtrSize, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not all that familiar with the design of these generics, but I would naively expect that a choice of either MacroAssembler
or ABI
would imply PtrSize
. If that's the case would it perhaps be possible to have P
be an associated type of either prior trait?
Or would it, for example, make sense to put both ABI
and PtrSize
inside of the MacroAssembler
trait as an associated type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. Taking a closer look, I'm leaning towards having the PtrSize
as an associated type inside the ABI
trait, which already provides similar information (e.g. word_bytes
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon a second look, having both of these as associated types in the MacroAssembler
makes more sense I think, and it's going to result in quite a decent cut in boilerplate. I started working on the change, but I'm anticipating that it's going to be a decent amount of changes unrelated to this PR, so I think I prefer landing this and putting the refactor once this lands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also in my todo to standardize the signatures in the ABI
trait (e.g. there's no reason to have them borrow &self
), so I'm thinking I'll bundle those improvements in the refactoring too.
This commit is a small cleanup to drop the usage of the `FuncEnv` trait. In bytecodealliance#6358, we agreed on making `winch-codegen` directly depend on `wasmtime-environ`. Introducing a direct relatioship between `winch-codegen` and `wasmtime-environ` means that the `FuncEnv` trait is no longer serving its original purpose, and we can drop the usage of the trait and use the types exposed from `winch-codegen` directly instead. Even though this change drops the `FuncEnv` trait, it still keeps a `FuncEnv` struct, which is used during code generation.
50b1048
to
85de546
Compare
This commit is a follow up to bytecodealliance#6443, in which we discussed potentially having `PtrSize` and `ABI` as associated types to the `MacroAssembler` trait. I considered having `PtrSize` associated to the `ABI`, but given the amount of ABI details needed at the `MacroAssembler` level, I decided to go with the approach in this change. The chosen approach ended up cutting a decent amount of boilerplate from the `MacroAssembler` itself, but also from each of the touchpoints where the `MacroAssembler` is used. This change also standardizes the signatures of the `ABI` trait. Some of them borrowed `&self` and some didn't, but in practice, there's no need to have any of them borrow `&self`.
This commit is a follow up to bytecodealliance#6443, in which we discussed potentially having `PtrSize` and `ABI` as associated types to the `MacroAssembler` trait. I considered having `PtrSize` associated to the `ABI`, but given the amount of ABI details needed at the `MacroAssembler` level, I decided to go with the approach in this change. The chosen approach ended up cutting a decent amount of boilerplate from the `MacroAssembler` itself, but also from each of the touchpoints where the `MacroAssembler` is used. This change also standardizes the signatures of the `ABI` trait. Some of them borrowed `&self` and some didn't, but in practice, there's no need to have any of them borrow `&self`.
This commit is a follow up to bytecodealliance#6443, in which we discussed potentially having `PtrSize` and `ABI` as associated types to the `MacroAssembler` trait. I considered having `PtrSize` associated to the `ABI`, but given the amount of ABI details needed at the `MacroAssembler` level, I decided to go with the approach in this change. The chosen approach ended up cutting a decent amount of boilerplate from the `MacroAssembler` itself, but also from each of the touchpoints where the `MacroAssembler` is used. This change also standardizes the signatures of the `ABI` trait. Some of them borrowed `&self` and some didn't, but in practice, there's no need to have any of them borrow `&self`.
This commit is a follow up to bytecodealliance#6443, in which we discussed potentially having `PtrSize` and `ABI` as associated types to the `MacroAssembler` trait. I considered having `PtrSize` associated to the `ABI`, but given the amount of ABI details needed at the `MacroAssembler` level, I decided to go with the approach in this change. The chosen approach ended up cutting a decent amount of boilerplate from the `MacroAssembler` itself, but also from each of the touchpoints where the `MacroAssembler` is used. This change also standardizes the signatures of the `ABI` trait. Some of them borrowed `&self` and some didn't, but in practice, there's no need to have any of them borrow `&self`.
This commit is a follow up to #6443, in which we discussed potentially having `PtrSize` and `ABI` as associated types to the `MacroAssembler` trait. I considered having `PtrSize` associated to the `ABI`, but given the amount of ABI details needed at the `MacroAssembler` level, I decided to go with the approach in this change. The chosen approach ended up cutting a decent amount of boilerplate from the `MacroAssembler` itself, but also from each of the touchpoints where the `MacroAssembler` is used. This change also standardizes the signatures of the `ABI` trait. Some of them borrowed `&self` and some didn't, but in practice, there's no need to have any of them borrow `&self`.
This commit is a small cleanup to drop the usage of the
FuncEnv
trait.In #6358, we agreed on making
winch-codegen
directly depend onwasmtime-environ
.Introducing a direct relatioship between
winch-codegen
andwasmtime-environ
means that theFuncEnv
trait is no longer serving its original purpose, and we can drop the usage of the trait and use the types exposed fromwinch-codegen
directly instead.Even though this change drops the
FuncEnv
trait, it still keeps aFuncEnv
struct, which is used during code generation.