Leopold Toetsch writes: > Jeff Clites <[EMAIL PROTECTED]> wrote: > > On Jan 7, 2004, at 1:46 AM, Leopold Toetsch wrote: > >> That part is already answered: create a buffer_like structure. > >> *But* again register backing stacks are *not* in the interpreter > >> context. > > > I don't understand what you are getting at. They are not physically > > part of Parrot_Interp.ctx, but it holds pointers to them, right? > > No, they were in the context but aren't any more. > > > ... So, > > they need to be copied when the context is being duplicated. Is that > > your point, or are you trying to say that they are not _logically_ part > > of the context, or are not supposed to be? > > Exactly the latter: > That was AFAIK a design decision, when Dan did introduce CPS. At this > time register backing stacks went out of the continuation or whatelse > context - IIRC did Dan commit that to CVS himself.
In which case I feel obliged to contest that decision. The register backing stacks are as much a part of the current state as the program counter is. I'm writing a compiler that makes heavy use of continuations for the purpose of backtracking. If the register backing stacks aren't closed over, and I am thus required to keep the state consistent myself, it is impossible to use continuations for that purpose. Indeed, it becomes impossible to use continuations for anything but simulating a control stack, which is precisely what they are designed to get around. Luke > So register stacks are *not* included in any context swapping, being it > a Continuation or some other context switch. That's it. > > > JEff > > leo