On Sun, Jun 12, 2005 at 09:41:05PM -0700, Bill Coffman wrote:
> Continuations can be taken from within any sub, and possibly even
> when appending to a list, if you're using lazy list eval.

Oh no ... it's even worse than you think.  Almost *any* opcode that
operates on a PMC can trigger a continuation.  And I only need two
words to prove it:

"Tied variables."

Ouch ouch ouch.

Sounds to me like register allocation is effectively dead, and all
that's left is register renumbering.

The only exception (ahem) I can think of is if we start supporting,
and compilers start emitting, continuation resets (i.e. protected
areas that guarantee that continuations won't propagate out; kind of
like the effect of C< eval BLOCK > on Perl's die).  But even then, it
might not be worth the effort just to get a little tiny bit of reuse
out of an effectively infinite register set.

> There are also some issue about changing variables through continuations, 
> like you can only change PMC integers, which point to some fixed location, 
> containing the int, i.e. you can only use references. These parts make less 
> sense to me, but the issue is basically, some registers are restored, and 
> some are kept safe? Well, that issue hasn't been quite resolved either.

I think that's been answered: We don't have to save & restore
anything, because it's all automatically saved by virtue of being in
memory as the state of a *virtual* machine.
-- 
Chip Salzenberg <[EMAIL PROTECTED]>

Reply via email to