I'm looking into ways of dynamically growing stack memory. Does Cranelift provide a way of obtaining a frame's stack size at runtime (i.e.g as some static value stored somewhere), or does one have to implement this manually using get_stack_pointer()
and comparing that to some known value?
Hm, seems https://docs.rs/cranelift-codegen/latest/cranelift_codegen/ir/function/struct.FunctionStencil.html#method.fixed_stack_size
might be the trick as used at https://github.com/bytecodealliance/wasmtime/blob/c392e461a3458a011f79dca7ec22773b873006cd/cranelift/interpreter/src/interpreter.rs#L325.
Though I'm not sure that this information is available/up to date when generating code for a function :thinking:
Last updated: Nov 22 2024 at 17:03 UTC