Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Issue 13704010: Generator objects can suspend (Closed)

Created:
7 years, 8 months ago by wingo
Modified:
7 years, 8 months ago
Base URL:
git://github.com/v8/v8.git@master
Visibility:
Public.

Description

Generator objects can suspend * src/ast.h: * src/parser.cc: Differentiate between the different kinds of yields, in anticipation of boxing return values. Parse `return' into `yield' in a generator. * src/runtime.h: * src/runtime.cc (Runtime_SuspendJSGeneratorObject): New horrible runtime function: saves continuation, context, and operands into the generator object. * src/arm/full-codegen-arm.cc (VisitYield): * src/ia32/full-codegen-ia32.cc (VisitYield): * src/x64/full-codegen-x64.cc (VisitYield): Arrange to call SuspendJSGeneratorObject. If the call returns the hole, we suspend. Otherwise we resume. BUG=v8:2355 TEST=These codepaths are tested when the generator is first invoked, and so are covered by mjsunit/harmony/generators-objects.js. Committed: http://code.google.com/p/v8/source/detail?r=14353

Patch Set 1 #

Patch Set 2 : Use hole as suspend sentinel; keep more code in full-codegen.cc #

Patch Set 3 : Move VisitYield to platform-specific full-codegen #

Patch Set 4 : Tighten typing on generator object contexts #

Total comments: 12

Patch Set 5 : Address comments; Refactor VisitYield #

Total comments: 2

Patch Set 6 : Use sentinel values for continuations #

Unified diffs Side-by-side diffs Delta from patch set Stats (+277 lines, -43 lines) Patch
M src/arm/full-codegen-arm.cc View 1 2 3 4 5 1 chunk +54 lines, -0 lines 0 comments Download
M src/ast.h View 1 2 3 4 2 chunks +13 lines, -6 lines 0 comments Download
M src/full-codegen.cc View 1 2 1 chunk +0 lines, -24 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 4 5 1 chunk +54 lines, -0 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 2 chunks +10 lines, -2 lines 0 comments Download
M src/objects-inl.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/parser.cc View 1 2 3 4 3 chunks +27 lines, -9 lines 0 comments Download
M src/runtime.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime.cc View 1 2 3 4 3 chunks +57 lines, -1 line 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 3 4 5 1 chunk +54 lines, -0 lines 0 comments Download
M test/mjsunit/harmony/generators-parsing.js View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
wingo
This is an early patch that depends on https://codereview.chromium.org/13192004/ and https://codereview.chromium.org/13542002/. It is more or ...
7 years, 8 months ago (2013-04-05 15:27:09 UTC) #1
wingo
Updated patch prepares for boxing "yield" return values, but does not implement that yet, as ...
7 years, 8 months ago (2013-04-12 11:17:26 UTC) #2
wingo
Updated patch moves VisitYield to the platform-specific full-codegen.
7 years, 8 months ago (2013-04-15 12:17:34 UTC) #3
wingo
Updated CL moves VisitYield to platform-specific full-codegen.
7 years, 8 months ago (2013-04-15 12:20:11 UTC) #4
wingo
Updated patch initializes JSGeneratorObject::context when allocating, as was the intention. (We can avoid saving the ...
7 years, 8 months ago (2013-04-16 14:13:39 UTC) #5
Michael Starzinger
Looking good. We are getting there, awesome! A bunch of comments. https://codereview.chromium.org/13704010/diff/26001/src/ast.h File src/ast.h (right): ...
7 years, 8 months ago (2013-04-17 13:43:48 UTC) #6
Michael Starzinger
Clarified one of my comments. https://codereview.chromium.org/13704010/diff/26001/src/runtime.cc File src/runtime.cc (right): https://codereview.chromium.org/13704010/diff/26001/src/runtime.cc#newcode2350 src/runtime.cc:2350: On 2013/04/17 13:43:48, Michael ...
7 years, 8 months ago (2013-04-17 13:49:02 UTC) #7
wingo
Thanks for the review. Updated patch addresses comments. There are also a few additional things; ...
7 years, 8 months ago (2013-04-17 15:22:27 UTC) #8
Michael Starzinger
Just one more comment. https://codereview.chromium.org/13704010/diff/36001/src/objects.h File src/objects.h (right): https://codereview.chromium.org/13704010/diff/36001/src/objects.h#newcode6286 src/objects.h:6286: Can we add constants here ...
7 years, 8 months ago (2013-04-19 13:15:56 UTC) #9
wingo
Thanks for the review. Updated patch adds sentinel values and uses them. https://codereview.chromium.org/13704010/diff/36001/src/objects.h File src/objects.h ...
7 years, 8 months ago (2013-04-19 13:57:41 UTC) #10
Michael Starzinger
LGTM. I'll land this.
7 years, 8 months ago (2013-04-19 14:01:09 UTC) #11
Michael Starzinger
7 years, 8 months ago (2013-04-19 14:11:34 UTC) #12
Message was sent while issue was closed.
Committed patchset #6 manually as r14353 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698