Stream: cranelift

Topic: Guidance on handling composite types in func parameters


view this post on Zulip Ivan Chinenov (Mar 26 2024 at 21:34):

If I'm remembering correctly, Cranelift doesn't have any builtin way to work with composites, so my question is, would that mean that the simplest way to deal with composites in function parameters is to pass by pointer?

view this post on Zulip Chris Fallin (Mar 26 2024 at 21:46):

Yes, exactly. You'll want to define an ABI or convention of some sort in your compiler, but the gist of it is: put the storage somewhere (perhaps on a shadow stack?) and pass a pointer to it.

view this post on Zulip Ivan Chinenov (Mar 26 2024 at 22:00):

What exactly do you mean by "shadow stack"?

view this post on Zulip Chris Fallin (Mar 26 2024 at 22:01):

A mechanism to allocate storage via a bump-decrement pointer, sometimes used for stack-local storage; you can also use Cranelift stackslots for this, either way


Last updated: Nov 22 2024 at 16:03 UTC