Page 1 of 1

PostPosted: Thu Jun 07, 2001 7:36 am
by guy
Change the stack frame management in the runtime so that functions can be called with a variable argument list.

Currently the stack frame is handled at compile time, so the argument pointer is wrong at the start of the called function, and the stack unwind breaks at the end of a called function.

This shouldn't need a compiler change, just the runtime:

1. Use a global to store the current stack frame pointer.
2. Stack the current stack frame on a call, and replace it with the new one.
3. Ignore the compiled in argument count on a return, use the stack frame at the point of call, and unstack the previous stack frame.

Bargain.


Guy