develooper Front page | perl.perl6.internals | Postings from November 2004

Re: Continuations, basic blocks, loops and register allocation

Thread Previous | Thread Next
Leopold Toetsch
November 16, 2004 00:32
Re: Continuations, basic blocks, loops and register allocation
Message ID:
Matt Fowles <> wrote:

[ continuations should restore registers ]

> I am sorry, but I don't understand what you are trying to say here.
> Would you mind rewording it for me?

Imagine a simple loop:

    i = 0
    inc i
    if i < 10 goto lp

Looking at the loop counter a programmer or optimizer could easily
decide that using an I-Reg for it instead of a P-Reg is fine. Now comes
your proposed implementation for continuations: they copy the register
frame on creation and restore it on invocation. Besides of the big cost
of the memcpy's this simple loop above suddenly stops working, depending
on the implementation of foo() - which might be outside your control.

BTW in an early stage we had exactly this behavior of continuations.
This was abandoned. The subject was IIRC something like "Should
continuations close over registers". The answer was clearly "no".


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About