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

Issue 64223010: Harmony promises (Closed)

Created:
7 years, 1 month ago by rossberg
Modified:
7 years ago
CC:
v8-dev, Michael Starzinger, rafaelw
Visibility:
Public.

Description

Harmony promises Based on prototype at https://github.com/rossberg-chromium/js-promise which informed the latest spec draft version at https://github.com/domenic/promises-unwrapping/blob/master/README.md Activated by --harmony-promises. Feature complete with respect to the draft spec, plus the addition of .when and .deferred methods. Final naming and other possible deviations from the current draft will hopefully be resolved soon after the next TC39 meeting. This CL also generalises the Object.observe delivery loop into a simplistic microtask loop. Currently, all observer events are delivered before invoking any promise handler in a single fixpoint iteration. It's not clear yet what the final semantics is supposed to be (should there be a global event ordering?), but it will probably require a more thorough event loop abstraction inside V8 once we get there. R=dslomov@chromium.org, yhirano@chromium.org BUG= Committed: http://code.google.com/p/v8/source/detail?r=18113

Patch Set 1 #

Total comments: 9

Patch Set 2 : Addressed Michael's comments #

Total comments: 2

Patch Set 3 : TODO addressing Elliott's comment #

Total comments: 8

Patch Set 4 : Fix Promise.all semantics #

Patch Set 5 : Fix Promise.all([]) #

Total comments: 13

Patch Set 6 : Implement IsCallable predicate #

Patch Set 7 : Ignore multiple resolution #

Total comments: 2

Patch Set 8 : Proper default handlers #

Patch Set 9 : Added comment #

Patch Set 10 : "Renamed .when to .chain; Dmitry's comments" #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1174 lines, -87 lines) Patch
src/api.cc View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
src/bootstrapper.cc View 3 chunks +19 lines, -47 lines 0 comments Download
src/contexts.h View 4 chunks +2 lines, -2 lines 0 comments Download
src/execution.h View 1 chunk +2 lines, -0 lines 0 comments Download
src/execution.cc View 1 2 3 4 5 6 7 8 9 1 chunk +14 lines, -0 lines 0 comments Download
src/flag-definitions.h View 3 chunks +3 lines, -0 lines 0 comments Download
src/isolate.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
src/messages.js View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
src/object-observe.js View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -5 lines 0 comments Download
src/objects.h View 1 2 3 4 5 2 chunks +1 line, -3 lines 0 comments Download
src/objects.cc View 1 2 3 4 5 2 chunks +11 lines, -15 lines 0 comments Download
src/promise.js View 1 2 3 4 5 6 7 8 9 1 chunk +305 lines, -0 lines 0 comments Download
src/runtime.h View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -1 line 0 comments Download
src/runtime.cc View 1 2 3 4 5 6 7 8 9 3 chunks +26 lines, -4 lines 0 comments Download
src/v8.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -6 lines 0 comments Download
src/v8natives.js View 1 2 3 4 5 6 7 8 9 1 chunk +15 lines, -0 lines 0 comments Download
test/mjsunit/harmony/iteration-semantics.js View 1 chunk +2 lines, -1 line 0 comments Download
test/mjsunit/harmony/promises.js View 1 2 3 4 5 6 7 8 9 1 chunk +754 lines, -0 lines 0 comments Download
tools/gyp/v8.gyp View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
rafaelw
https://codereview.chromium.org/64223010/diff/1/src/execution.h File src/execution.h (right): https://codereview.chromium.org/64223010/diff/1/src/execution.h#newcode175 src/execution.h:175: static void RunMicrotasks(Isolate* isolate); ExecuteAllMicrotaskWork? https://codereview.chromium.org/64223010/diff/1/src/object-observe.js File src/object-observe.js (right): ...
7 years, 1 month ago (2013-11-14 21:08:46 UTC) #1
Michael Starzinger
Small drive-by. https://codereview.chromium.org/64223010/diff/1/src/runtime.cc File src/runtime.cc (right): https://codereview.chromium.org/64223010/diff/1/src/runtime.cc#newcode14621 src/runtime.cc:14621: RUNTIME_FUNCTION(MaybeObject*, Runtime_FailHard) { This is similar to ...
7 years, 1 month ago (2013-11-15 09:37:19 UTC) #2
rossberg
On 2013/11/14 21:08:46, rafaelw wrote: > nit: All of these work items are run within ...
7 years, 1 month ago (2013-11-15 09:58:46 UTC) #3
rossberg
https://codereview.chromium.org/64223010/diff/1/src/runtime.cc File src/runtime.cc (right): https://codereview.chromium.org/64223010/diff/1/src/runtime.cc#newcode14621 src/runtime.cc:14621: RUNTIME_FUNCTION(MaybeObject*, Runtime_FailHard) { On 2013/11/15 09:37:20, Michael Starzinger wrote: ...
7 years, 1 month ago (2013-11-15 10:00:57 UTC) #4
esprehn
https://codereview.chromium.org/64223010/diff/120001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/64223010/diff/120001/src/promise.js#newcode191 src/promise.js:191: try { deferred.reject(e) } catch(e) {} Swallowing exceptions like ...
7 years, 1 month ago (2013-11-15 11:23:19 UTC) #5
rossberg
https://codereview.chromium.org/64223010/diff/120001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/64223010/diff/120001/src/promise.js#newcode191 src/promise.js:191: try { deferred.reject(e) } catch(e) {} On 2013/11/15 11:23:19, ...
7 years, 1 month ago (2013-11-15 12:56:56 UTC) #6
yhirano
https://codereview.chromium.org/64223010/diff/210001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/64223010/diff/210001/src/promise.js#newcode248 src/promise.js:248: function PromiseAll(values) { This function returns a promise which ...
7 years, 1 month ago (2013-11-18 03:59:04 UTC) #7
yhirano
https://codereview.chromium.org/64223010/diff/210001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/64223010/diff/210001/src/promise.js#newcode287 src/promise.js:287: "when", PromiseWhen, On 2013/11/18 03:59:04, yhirano wrote: > There ...
7 years, 1 month ago (2013-11-18 04:01:31 UTC) #8
rossberg
https://codereview.chromium.org/64223010/diff/210001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/64223010/diff/210001/src/promise.js#newcode248 src/promise.js:248: function PromiseAll(values) { On 2013/11/18 03:59:04, yhirano wrote: > ...
7 years, 1 month ago (2013-11-18 10:56:04 UTC) #9
yhirano
https://codereview.chromium.org/64223010/diff/210001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/64223010/diff/210001/src/promise.js#newcode248 src/promise.js:248: function PromiseAll(values) { Sorry, my comment was wrong. I ...
7 years, 1 month ago (2013-11-18 11:03:45 UTC) #10
rossberg
https://codereview.chromium.org/64223010/diff/210001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/64223010/diff/210001/src/promise.js#newcode248 src/promise.js:248: function PromiseAll(values) { On 2013/11/18 11:03:46, yhirano wrote: > ...
7 years, 1 month ago (2013-11-18 11:51:09 UTC) #11
yhirano
https://codereview.chromium.org/64223010/diff/460001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/64223010/diff/460001/src/promise.js#newcode66 src/promise.js:66: resolver(function(x) { PromiseResolve(promise, x) }, Should throw a TypeError ...
7 years, 1 month ago (2013-11-19 03:14:06 UTC) #12
rossberg
https://codereview.chromium.org/64223010/diff/460001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/64223010/diff/460001/src/promise.js#newcode66 src/promise.js:66: resolver(function(x) { PromiseResolve(promise, x) }, On 2013/11/19 03:14:07, yhirano ...
7 years, 1 month ago (2013-11-19 12:28:42 UTC) #13
yhirano
https://codereview.chromium.org/64223010/diff/460001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/64223010/diff/460001/src/promise.js#newcode66 src/promise.js:66: resolver(function(x) { PromiseResolve(promise, x) }, On 2013/11/19 12:28:43, rossberg ...
7 years, 1 month ago (2013-11-20 07:05:36 UTC) #14
rossberg
https://codereview.chromium.org/64223010/diff/460001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/64223010/diff/460001/src/promise.js#newcode66 src/promise.js:66: resolver(function(x) { PromiseResolve(promise, x) }, On 2013/11/20 07:05:36, yhirano ...
7 years, 1 month ago (2013-11-22 11:03:06 UTC) #15
yhirano
lgtm
7 years ago (2013-11-25 01:31:14 UTC) #16
rossberg
https://codereview.chromium.org/64223010/diff/1/src/object-observe.js File src/object-observe.js (right): https://codereview.chromium.org/64223010/diff/1/src/object-observe.js#newcode387 src/object-observe.js:387: %SetMicrotasksPending(true); On 2013/11/14 21:08:46, rafaelw wrote: > nit: All ...
7 years ago (2013-11-26 13:23:52 UTC) #17
Dmitry Lomov (no reviews)
Very nice! I only have questions around implementation of PromiseAll https://codereview.chromium.org/64223010/diff/880001/src/promise.js File src/promise.js (right): https://codereview.chromium.org/64223010/diff/880001/src/promise.js#newcode256 ...
7 years ago (2013-11-27 12:39:48 UTC) #18
rossberg
[I repeatedly got errors from AppEngine uploading my latest patch, then it showed up twice, ...
7 years ago (2013-11-27 15:23:49 UTC) #19
Dmitry Lomov (no reviews)
LGTM On 2013/11/27 15:23:49, rossberg wrote: > On 2013/11/27 12:39:48, Dmitry Lomov (chromium) wrote: > ...
7 years ago (2013-11-27 17:03:13 UTC) #20
rossberg
On 2013/11/27 17:03:13, Dmitry Lomov (chromium) wrote: > https://codereview.chromium.org/64223010/diff/880001/src/promise.js#newcode260 > > > src/promise.js:260: if (--count ...
7 years ago (2013-11-27 17:13:11 UTC) #21
rossberg
7 years ago (2013-11-27 17:21:57 UTC) #22
Message was sent while issue was closed.
Committed patchset #10 manually as r18113 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698