Dan Sugalski wrote:


Reusing these things should be considered OK, though they couldn't be reused without being reinitialized after any sort of stack manipulation on return, since COW will make pointers change.

Thinking some time about this (and looking at the last sub.t [1]), IMHO best will be a sequence:


newsub .Sub, .Continuation, _func, ret

This creates the 2 needed PMCs and sets their address.

Later on, possibly inside a loop:

invokecc

This (different to now) establishes the return context in P1 and calls the sub in P0.

[1] one sub is calling another (not tail), so it has to preserve at least P1. This un-COWs the already copied register stack, which is *suboptimal*.

leo

Reply via email to