What about usage of segmented stacks? One of the implementations is a linked list of stack segments: what if we could use each one for storing one unsized local? What I want to propose is folowing schema: function stack begins with first segment, used for storing
Sized types, in the begining of first segment we place the
u32 offset which tells where start of next segment is; each segment stores offset of the next one counting from beginning of current. Offset value 0 indicates that there no next stack frame, possible exception is offset in start of first segment: it could indicate that there no use of segemented stacks at all.
Next thing I want to discuss is sizedness of values: in this category we have
Sized values and
Sized? values which also called unsized. So I propose folowing placement of each kind in segments: first segment is used for storing
Sized values, for each unsized value there are a separate stack frame.
The cost of extending stack frame is big: moving all following frames by certain offset (and possible
Another thing I want to ask is will it require tweaking calling convention?