On 2014/02/11 11:46:59, yusukesuzuki wrote:
https://codereview.chromium.org/139653003/diff/1/src/ia32/full-codegen-ia32.cc
File src/ia32/full-codegen-ia32.cc (right):


https://codereview.chromium.org/139653003/diff/1/src/ia32/full-codegen-ia32.cc#newcode1972
src/ia32/full-codegen-ia32.cc:1972: __ bind(&resume);
On 2014/02/11 08:59:21, wingo wrote:
> Instead of storing the initial suspend offset in the generator object, could
we
> not insert code at the resume point of the initial yield that throws unless
the
> "next" value is undefined? That would save a word in each generator object.
>
> WDYT?

Yeah, saving a word in each generator object is important. However, an error
is
needed to be raised from Generator.prototype.next(), not from generator's
code.
So we need to raise an error in the Generator.prototype.next context.

So I've changed the code. Instead of storing initial suspend offset, when a
value is passed to an unborn generator, yield returns the hole value as a
marker. On the caller (Generator.prototype.next) side, the caller checks the result and if the result value is the hole value, the caller throws an error.

What do you think about this implementation?

Or is it preferable to unwind frame manually and raise error in YieldExpression
INITIAL phase?

https://codereview.chromium.org/139653003/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" 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