winch: Drop FuncEnv trait#6443
Conversation
Subscribe to Label ActionDetailsThis 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.
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.
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.
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.
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
FuncEnvtrait.In #6358, we agreed on making
winch-codegendirectly depend onwasmtime-environ.Introducing a direct relatioship between
winch-codegenandwasmtime-environmeans that theFuncEnvtrait is no longer serving its original purpose, and we can drop the usage of the trait and use the types exposed fromwinch-codegendirectly instead.Even though this change drops the
FuncEnvtrait, it still keeps aFuncEnvstruct, which is used during code generation.