gimli
gimli copied to clipboard
Serialize Expressions
During migration to 0.20 -> 0.21, I found it impossible to rounds trip Expression
. There is Expression::raw()
but I could not find "into_raw" or write capabilities.
See requirement at https://github.com/bytecodealliance/wasmtime/blob/7d88384c0fe087cd80a3d8ae1bbc80950b2b7d91/cranelift/codegen/src/isa/unwind/systemv.rs#L25
See https://github.com/bytecodealliance/wasmtime/pull/1466#discussion_r416349933. Let me know if the changes I showed there are unsuitable.
They are. I just landed the similar patch today. Thanks.
They are unsuitable?
write capabilities are already present. This is currently internal, but I don't think there is a need for users to write individual expressions? As I mentioned above the linked comment, references within the expression need to be handled, so they need to be written at the same time as writing the DIE they reference. I don't see a way to make this serializable. Can you be more specific about what you think needs to be done to resolve this issue?
Sorry. The changes are suitable.
As I mentioned above the linked comment, references within the expression need to be handled, so they need to be written at the same time as writing the DIE they reference. I don't see a way to make this serializable.
I'm just pointing out that there is Expression::raw
but not operation to unwrap that back. It is probably not a big deal now since we are using the approach you described in the proposed patch.