Piers Cawley <[EMAIL PROTECTED]> wrote:
> Dan Sugalski <[EMAIL PROTECTED]> writes:

>>>And what control stack? The continuation chain is the control stack, surely?
>>
>> Nope. There's the exception handlers, at the very least.

> Just add a field to the continuation structure "NextExceptionHandler"
> which points to the continuation of the next exception handler in the
> chain.

What about C code that either installs exception handlers or throws
exceptions?

>> Possibly some lexical pad stuff. (Though of that I'm less sure)

> I've always wondered why lexical pads have their own stack. I'd hang it
> off the Sub object and, when the sub's invoked, shove the current pad
> into a control register, which then gets closed over by any
> continuations that get made. Invoking a continuation restores the pad
> register and away you go.

Interesting idea. Well, the control register is a pointer in the context
structure. We should be careful not to use up too many PMC registers.

But the current lexical pad structures are suboptimal (searching is
O(n)). OTOH we need some kind of linked lists of pads, which matches the
single item stacks approach.

leo

Reply via email to