On Mon, Aug 19, 2013 at 11:21 PM, Marcel Laverdet <[email protected]> wrote:
>> Even the current generator/yield implementations are essentially
>> accomplished via CPS transforms.
>
> This is untrue. Fibers uses a new stack and a long jump. Haven't looked at
> the implementation for generators in v8 but I'd be surprised if it was
> anything more exotic than a stack frame allocated on the heap and a context
> switch.

I don't think it does, in general.  Andy Wingo's original patches try
hard to allocate everything in closure context objects.  That is, in
many respects they're just like regular function closures.

Only when that isn't possible (when the generator throws exceptions -
maybe in other cases too) does it allocate memory for the continuation
on the heap.  When the time comes to resume the generator, it copies
it from the heap to the stack again.

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to