RR #3:Flat type computation for interface types for RR#12981
RR #3:Flat type computation for interface types for RR#12981arjunr2 wants to merge 3 commits intobytecodealliance:mainfrom
Conversation
alexcrichton
left a comment
There was a problem hiding this comment.
I think that the code here will end up duplicating some functionality elsewhere already in Wasmtime, especially around handling per-type flat ABIs. An example is that crates/environ/src/fact/signature.rs contains a lot of flattening already for function signatures, although not of the exact same shape and form of here. Notably as well TypeInformation already has various helpers and such to push in more flat information. Would it be possible to reuse/refactor the existing implementations instead of adding another?
|
I think |
|
@alexcrichton I've merged this computation with the one used for |
alexcrichton
left a comment
There was a problem hiding this comment.
Sorry for the delay here, but would it be possible to use the preexisting functionality instead? I'm not entirely sure what the new functions here do that the previous functions didn't, and from a subjective code-organization point of view I feel it's better to having things split up by type rather than lumped into a single function with a large match.
One part that I don't quite fully see here is how this is going to be used which is ok but also makes it a bit difficult to see. For example would it be possible to add a helper to TypeInformation that takes in an &InterfaceType and dispatches internally to calculate the right info? Or would that not make sense in this particular situation? Put another way, what's the high-level need of the record/replay that necessitates a new implementation on the side that replaces the previous implementation?
|
The current My first thought was that we could just store these additional flat type information in the Thus what I've done now is refactored the internal parts of TypeInformation to pull out the core flat type computation into separate methods that can be used at build time and runtime through a |
This provides methods to compute the exact core wasm ABI encoding of param/result interface types for precise recording/replaying.