[Vm-dev] JIT stack discipline from caller's POV

Igor Stasenko siguctua at gmail.com
Thu Mar 21 14:19:20 UTC 2013


Hi, Eliot & all

i just want to summarize the SimpleStackBasedCogIt stack discipline,
please correct me if i wrong.

On call:

If number of arguments is 0 or 1 (just receiver or receiver + 1 arg),
caller uses registers to pass them:
EDX for receiver
ESI for arg1

If number of arguments is > 1
then caller pushes all arguments on stack.

After return:
- caller expecting result in EDX
- the stack is cleaned by callee (by popping args from stack), but
only for those which was pushed (so in case of <=1 arguments there's
nothing to pop)


Am i correct?

-- 
Best regards,
Igor Stasenko.


More information about the Vm-dev mailing list