Stream: cranelift

Topic: Is it possible to get the frame size?


view this post on Zulip Yorick Peterse (Oct 31 2022 at 18:10):

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?

view this post on Zulip Yorick Peterse (Oct 31 2022 at 18:22):

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.

A fast and secure runtime for WebAssembly. Contribute to bytecodealliance/wasmtime development by creating an account on GitHub.

view this post on Zulip Yorick Peterse (Oct 31 2022 at 18:22):

Though I'm not sure that this information is available/up to date when generating code for a function :thinking:


Last updated: Oct 23 2024 at 20:03 UTC