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

Issue 13192004: arrange to create prototypes for generators (Closed)

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

Description

* src/generator.js: Add methods and intialization for generator meta-objects. * src/contexts.h: * src/bootstrapper.cc (InitializeExperimentalGlobal): Make generator meta-objects, and store maps for constructing generator functions and their prototypes. * src/factory.h: * src/factory.cc (MapForNewFunction): New helper. (NewFunctionFromSharedFunctionInfo): Use the new helper. * src/heap.cc (AllocateFunctionPrototype, AllocateInitialMap): For generators, allocate appropriate prototypes and maps. * src/code-stubs.h: * src/arm/code-stubs-arm.h: * src/arm/full-codegen-arm.h: * src/ia32/code-stubs-ia32.h: * src/ia32/full-codegen-ia32.h: * src/x64/code-stubs-x64.h: * src/x64/full-codegen-x64.h: Allow fast closure creation for generators, using the appropriate map. * test/mjsunit/harmony/builtins.js: Add a special case for GeneratorFunctionPrototype.prototype.__proto__. BUG= TEST=mjsunit/harmony/generators-runtime Committed: http://code.google.com/p/v8/source/detail?r=14236

Patch Set 1 : Rebased patchset #

Patch Set 2 : Remove unintended whitespace/indentation changes #

Patch Set 3 : Generators JS runtime to separate file, to avoid overhead when no --harmony-generators #

Total comments: 10

Patch Set 4 : Use "object" instead of "iterator" in variable names in test #

Patch Set 5 : Move meta-object creation to C++ in InitializeExperimentalGlobal #

Patch Set 6 : Lazy allocation of generator maps and prototypes #

Patch Set 7 : Allow fast closure creation for generators #

Total comments: 6

Patch Set 8 : Add Context::FunctionMapIndex; fix nits; more initialization in JS #

Patch Set 9 : Explicitly add constructor properties in generator.js #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+305 lines, -88 lines) Patch
M src/arm/code-stubs-arm.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -3 lines 0 comments Download
M src/arm/full-codegen-arm.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M src/bootstrapper.cc View 1 2 3 4 5 6 7 2 chunks +45 lines, -0 lines 0 comments Download
M src/code-stubs.h View 1 2 3 4 5 6 1 chunk +11 lines, -4 lines 0 comments Download
M src/contexts.h View 1 2 3 4 5 6 7 3 chunks +18 lines, -0 lines 0 comments Download
M src/factory.cc View 1 2 3 4 5 6 7 1 chunk +10 lines, -3 lines 0 comments Download
A + src/generator.js View 1 2 3 4 5 6 7 8 1 chunk +33 lines, -41 lines 1 comment Download
M src/heap.cc View 1 2 3 4 5 4 chunks +43 lines, -23 lines 0 comments Download
M src/ia32/code-stubs-ia32.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -3 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M src/v8natives.js View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/x64/code-stubs-x64.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -3 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M test/mjsunit/builtins.js View 1 2 3 4 5 6 7 1 chunk +3 lines, -1 line 0 comments Download
A test/mjsunit/harmony/generators-runtime.js View 1 2 3 4 5 6 7 1 chunk +126 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 22 (0 generated)
wingo
Based on https://codereview.chromium.org/13176002/ and https://codereview.chromium.org/13179002/. This changeset basically sets up the strange prototype structure described ...
7 years, 9 months ago (2013-03-28 17:41:31 UTC) #1
wingo
This issue needs some changes related to the new spec in http://wiki.ecmascript.org/lib/exe/fetch.php?cache=cache&media=harmony:es6_generator_object_model_3-29-13.png. The new spec ...
7 years, 8 months ago (2013-04-02 08:34:46 UTC) #2
wingo
This updated patchset should conform to the newer TC39 drafts. It also consistently passes tests, ...
7 years, 8 months ago (2013-04-02 12:30:54 UTC) #3
rossberg
First round of comments. I'm not sure I fully understand the way you initialize these ...
7 years, 8 months ago (2013-04-09 16:44:14 UTC) #4
wingo
Thanks for the review. > https://codereview.chromium.org/13192004/diff/18001/src/bootstrapper.cc#newcode1478 > src/bootstrapper.cc:1478: if (FLAG_harmony_generators) { > Why do these ...
7 years, 8 months ago (2013-04-10 08:13:44 UTC) #5
wingo
Updated renaming "generator iterators" to "generator object", also addressing nits. Open questions about bootstrap.cc, lazy ...
7 years, 8 months ago (2013-04-10 09:02:21 UTC) #6
rossberg
> https://codereview.chromium.org/13192004/diff/18001/src/bootstrapper.cc#newcode1478 > > src/bootstrapper.cc:1478: if (FLAG_harmony_generators) { > > Why do these have to ...
7 years, 8 months ago (2013-04-10 11:47:23 UTC) #7
rossberg
On 2013/04/10 11:47:23, rossberg wrote: > https://codereview.chromium.org/13192004/diff/18001/src/generators.js#newcode61 > > > src/generators.js:61: %FunctionSetPrototype(GeneratorFunctionPrototype, > > > ...
7 years, 8 months ago (2013-04-10 11:53:49 UTC) #8
wingo
Hi, a question about initialization of the rat's nest of meta-objects. Thanks :) https://codereview.chromium.org/13192004/diff/18001/src/bootstrapper.cc File ...
7 years, 8 months ago (2013-04-10 14:28:52 UTC) #9
wingo
https://codereview.chromium.org/13192004/diff/18001/src/bootstrapper.cc File src/bootstrapper.cc (right): https://codereview.chromium.org/13192004/diff/18001/src/bootstrapper.cc#newcode1478 src/bootstrapper.cc:1478: if (FLAG_harmony_generators) { On 2013/04/10 14:28:52, wingo wrote: > ...
7 years, 8 months ago (2013-04-10 14:44:28 UTC) #10
wingo
Patch updated to create meta-objects in C++ using InstallFunction et al. I'm not sure it's ...
7 years, 8 months ago (2013-04-10 16:11:43 UTC) #11
wingo
Andreas, you were totally right: lazy map initialization appears to work fine. PTAL at the ...
7 years, 8 months ago (2013-04-11 10:04:01 UTC) #12
rossberg
LGTM with nits https://codereview.chromium.org/13192004/diff/54001/src/arm/code-stubs-arm.cc File src/arm/code-stubs-arm.cc (right): https://codereview.chromium.org/13192004/diff/54001/src/arm/code-stubs-arm.cc#newcode184 src/arm/code-stubs-arm.cc:184: int map_index = is_generator_ Nit: it ...
7 years, 8 months ago (2013-04-11 13:05:19 UTC) #13
wingo
New patches fixes nits, adds Context::FunctionMapIndex, also moves some more initialization into generators.js. https://codereview.chromium.org/13192004/diff/54001/src/arm/code-stubs-arm.cc File ...
7 years, 8 months ago (2013-04-11 14:38:44 UTC) #14
rossberg
Looks good, I'll land it
7 years, 8 months ago (2013-04-11 14:47:17 UTC) #15
rossberg
On 2013/04/11 14:47:17, rossberg wrote: > Looks good, I'll land it Hm, I'm getting several ...
7 years, 8 months ago (2013-04-11 14:55:50 UTC) #16
wingo
On 2013/04/11 14:55:50, rossberg wrote: > On 2013/04/11 14:47:17, rossberg wrote: > > Looks good, ...
7 years, 8 months ago (2013-04-11 15:16:43 UTC) #17
wingo
On 2013/04/11 15:16:43, wingo wrote: > On 2013/04/11 14:55:50, rossberg wrote: > > On 2013/04/11 ...
7 years, 8 months ago (2013-04-11 15:48:22 UTC) #18
wingo
Updated patch explicitly adds constructor properties on meta-objects, adapting to recent change in bleeding_edge's NewFunctionWithPrototype.
7 years, 8 months ago (2013-04-11 16:02:22 UTC) #19
rossberg
On 2013/04/11 16:02:22, wingo wrote: > Updated patch explicitly adds constructor properties on meta-objects, adapting ...
7 years, 8 months ago (2013-04-11 16:12:17 UTC) #20
rossberg
Committed patchset #9 manually as r14236 (presubmit successful).
7 years, 8 months ago (2013-04-11 16:29:58 UTC) #21
Michael Starzinger
7 years, 8 months ago (2013-04-11 18:43:47 UTC) #22
Message was sent while issue was closed.
Late drive-by.

https://codereview.chromium.org/13192004/diff/64005/src/generator.js
File src/generator.js (right):

https://codereview.chromium.org/13192004/diff/64005/src/generator.js#newcode28
src/generator.js:28: // This file relies on the fact that the following
declarations have been made
Late drive-by comment: Can we make this file "use strict". Even though it will
take longer to switch all old builtins strict I would advocate for writing new
ones in strict mode.

Powered by Google App Engine
This is Rietveld 408576698