Open stevehalliwell opened 8 months ago
This is because we run into the call value, and then the args on the stack. We set that value as the zero point for that new callstack. If we knew the return count ahead of time in the compiler, we could push the nulls required for returns ahead of the value itself. This becomes tough when we allow discarded returns and are fully dynamic.
Presently we put a call frame on and put on the value stack
So when we return we shuffle those returns down to the top of the stack for the caller. If we instead did
we wouldn't have to shuffle anything, returns would already be where they belong