Ben Morrow wrote:
Quoth [EMAIL PROTECTED]:

RESUMABLE: func_that_might_loop_through_cc()

 possibly accompanied with another markup of the function call that
 loops back.


That can't work, because *any* function might loop back, unless you want
to analyse the entire logic flow of the called function

Yes. In general that is true. The proposed markup would need that the HLL compiler spots all such places. I don't know if it's possible. Codepaths due to continuation invocation aren't arbitrary. The compiler should know affected subroutines and returns. This would work for lexically nested closure as in t/op/gc_13.imc.


2) Fetch all from lexicals/globals after a function call.

Can you not make that re-fetch conditional on being invoked from a full (as opposed to a return) continuation, so it will only happen if someone's messing about with continuations?

Unlikely, I think no.

... You can also avoid
rrefetching if the allocator happens not to have reused that register
elsewhere in the function, which is known at compile time.

The allocator uses the first free register. It e.g. starts alway at P16, if that's avaiable. Having a fetch_lex instead changes the register usage. The used temp register would be a volatile register then.


I agree (I think[1]) with you that the allocator should not try to keep
registers unique if that means spilling (this is pessimizing the common
case for the uncommon), but if possible it would be good for it to avoid
reusing registers if this *doesn't* require spilling.

This seems also hard to implement.

Ben

leo



Reply via email to