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

Issue 1394463003: [es6] refactor Promise resolution (Closed)

Created:
5 years, 2 months ago by caitp (gmail)
Modified:
5 years ago
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[es6] refactor Promise resolution Several changes are included here: 1. Each resolution callback references shared data indicating whether it has already been resolved or not, as described in 25.4.1.3 http://tc39.github.io/ecma262/#sec-createresolvingfunctions. Previously this was handled exclusively by the Promise's status, which does not work correctly with the current chaining behaviour. 2. During fulfillment, When a Promise is resolved with a thenable, the spec chains the promises together by invoking the thenable's `then` function with the original Promise's resolve and reject methods (per section 25.4.2.2, or http://tc39.github.io/ecma262/#sec-promiseresolvethenablejob, on the next tick, regardless of whether or not there are pending tasks. 3. Adds a spec compliance fix to ensure that the Promise constructor is only loaded once when `then()` is called, solving v8:4539 as well. This involves refactoring PromiseChain to accept a constructor argument. PromiseChain/PromiseDeferred will hopefully be removed soon, simplifying the process. BUG=v8:4162, v8:4539, v8:3237 LOG=N R=rossberg@chromium.org, littledan@chromium.org, adamk@chromium.org Committed: https://crrev.com/24ff30b740236619e911106573ee5cde0cd16dc2 Cr-Commit-Position: refs/heads/master@{#32046}

Patch Set 1 #

Patch Set 2 : Disable tests + add some new ones #

Patch Set 3 : cosmetic change #

Patch Set 4 : Disable failing cctest #

Patch Set 5 : rebased #

Patch Set 6 : Add a fix for v8:4539 #

Patch Set 7 : Fixed it #

Total comments: 4

Patch Set 8 : Do it without the new private symbol #

Patch Set 9 : Ensure that CreateResolvingFunctions is unobservable #

Total comments: 1

Patch Set 10 : Rebase (switched machines) #

Patch Set 11 : s/DISABLED/TODO(caitp).../ #

Patch Set 12 : add bug reference to the TODOs #

Total comments: 2

Patch Set 13 : TODO nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -25 lines) Patch
M src/js/promise.js View 1 2 3 4 5 6 7 8 11 chunks +74 lines, -15 lines 0 comments Download
M test/cctest/test-api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -4 lines 0 comments Download
M test/mjsunit/es6/promises.js View 1 2 3 4 5 6 7 8 9 10 11 11 chunks +63 lines, -6 lines 0 comments Download

Messages

Total messages: 35 (7 generated)
caitp (gmail)
This is just a quick WIP. Fixing this breaks the current behaviour of PromiseChain(), and ...
5 years, 2 months ago (2015-10-07 20:51:39 UTC) #1
stefan.penner
On 2015/10/07 at 20:51:39, caitpotter88 wrote: > This is just a quick WIP Implementation looks ...
5 years, 2 months ago (2015-10-07 21:09:54 UTC) #2
stefan.penner
On 2015/10/07 at 21:09:54, stefan.penner wrote: > On 2015/10/07 at 20:51:39, caitpotter88 wrote: > > ...
5 years, 2 months ago (2015-10-07 21:17:42 UTC) #3
rossberg
It looks like it would be possible to not interfere with chain and friends by ...
5 years, 2 months ago (2015-10-12 14:18:59 UTC) #4
caitp (gmail)
On 2015/10/12 14:18:59, rossberg wrote: > It looks like it would be possible to not ...
5 years, 2 months ago (2015-10-12 14:22:03 UTC) #5
caitp (gmail)
On 2015/10/12 14:22:03, caitp wrote: > On 2015/10/12 14:18:59, rossberg wrote: > > It looks ...
5 years, 2 months ago (2015-10-12 19:19:10 UTC) #6
Dan Ehrenberg
On 2015/10/12 at 19:19:10, caitpotter88 wrote: > On 2015/10/12 14:22:03, caitp wrote: > > On ...
5 years, 2 months ago (2015-10-13 08:07:45 UTC) #7
caitp (gmail)
On 2015/10/13 08:07:45, Dan Ehrenberg wrote: > On 2015/10/12 at 19:19:10, caitpotter88 wrote: > > ...
5 years, 2 months ago (2015-10-13 15:17:14 UTC) #8
caitp (gmail)
As suggested in the meeting, I've disabled the offending tests, and added some new tests ...
5 years, 2 months ago (2015-10-21 18:45:27 UTC) #9
caitp (gmail)
On 2015/10/21 18:45:27, caitp wrote: > As suggested in the meeting, I've disabled the offending ...
5 years, 2 months ago (2015-10-21 18:50:20 UTC) #10
caitp (gmail)
Added a fix for v8:4539, just making sure all test failures are handled and then ...
5 years, 1 month ago (2015-11-09 16:47:45 UTC) #12
caitp (gmail)
On 2015/11/09 16:47:45, caitp wrote: > Added a fix for v8:4539, just making sure all ...
5 years, 1 month ago (2015-11-09 17:12:18 UTC) #13
caitp (gmail)
On 2015/11/09 17:12:18, caitp wrote: > On 2015/11/09 16:47:45, caitp wrote: > > Added a ...
5 years, 1 month ago (2015-11-09 21:04:35 UTC) #14
caitp (gmail)
https://codereview.chromium.org/1394463003/diff/120001/src/js/promise.js File src/js/promise.js (right): https://codereview.chromium.org/1394463003/diff/120001/src/js/promise.js#newcode38 src/js/promise.js:38: function CreateResolvingFunctions(promise) { http://tc39.github.io/ecma262/#sec-createresolvingfunctions --- makes sure that this ...
5 years, 1 month ago (2015-11-09 21:10:24 UTC) #15
caitp (gmail)
On 2015/11/09 21:10:24, caitp wrote: > https://codereview.chromium.org/1394463003/diff/120001/src/js/promise.js > File src/js/promise.js (right): > > https://codereview.chromium.org/1394463003/diff/120001/src/js/promise.js#newcode38 > ...
5 years, 1 month ago (2015-11-09 21:35:26 UTC) #16
Dan Ehrenberg
Does this fix the issue with chain? https://codereview.chromium.org/1394463003/diff/160001/test/mjsunit/es6/promises.js File test/mjsunit/es6/promises.js (right): https://codereview.chromium.org/1394463003/diff/160001/test/mjsunit/es6/promises.js#newcode236 test/mjsunit/es6/promises.js:236: /* DISABLED ...
5 years, 1 month ago (2015-11-10 00:42:37 UTC) #17
caitp (gmail)
On 2015/11/10 00:42:37, Dan Ehrenberg wrote: > Does this fix the issue with chain? > ...
5 years, 1 month ago (2015-11-10 00:49:35 UTC) #18
Dan Ehrenberg
If PromiseChain is removed, I think it should be in a different CL. Maybe it ...
5 years, 1 month ago (2015-11-10 00:58:21 UTC) #19
rossberg
On 2015/11/10 00:58:21, Dan Ehrenberg wrote: > If PromiseChain is removed, I think it should ...
5 years, 1 month ago (2015-11-10 08:20:43 UTC) #20
rossberg
On 2015/11/10 08:20:43, rossberg wrote: > On 2015/11/10 00:58:21, Dan Ehrenberg wrote: > > If ...
5 years, 1 month ago (2015-11-10 08:30:10 UTC) #21
caitp (gmail)
On 2015/11/10 08:30:10, rossberg wrote: > On 2015/11/10 08:20:43, rossberg wrote: > > On 2015/11/10 ...
5 years, 1 month ago (2015-11-10 12:44:44 UTC) #23
Dan Ehrenberg
lgtm LGTM modulo remaining lack of TODO https://codereview.chromium.org/1394463003/diff/220001/test/cctest/test-api.cc File test/cctest/test-api.cc (right): https://codereview.chromium.org/1394463003/diff/220001/test/cctest/test-api.cc#newcode20311 test/cctest/test-api.cc:20311: // Chain ...
5 years, 1 month ago (2015-11-12 22:08:20 UTC) #27
caitp (gmail)
fixed the nit --- has the v8 4.8 branch already been settled? it's sort of ...
5 years, 1 month ago (2015-11-13 22:00:31 UTC) #28
rossberg
lgtm
5 years, 1 month ago (2015-11-17 13:33:53 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1394463003/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1394463003/240001
5 years, 1 month ago (2015-11-17 13:59:15 UTC) #32
commit-bot: I haz the power
Committed patchset #13 (id:240001)
5 years, 1 month ago (2015-11-17 14:23:50 UTC) #33
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/24ff30b740236619e911106573ee5cde0cd16dc2 Cr-Commit-Position: refs/heads/master@{#32046}
5 years, 1 month ago (2015-11-17 14:24:27 UTC) #34
Dan Ehrenberg
5 years ago (2015-11-25 23:54:23 UTC) #35
Message was sent while issue was closed.
On 2015/11/17 at 14:24:27, commit-bot wrote:
> Patchset 13 (id:??) landed as
https://crrev.com/24ff30b740236619e911106573ee5cde0cd16dc2
> Cr-Commit-Position: refs/heads/master@{#32046}

With this patch, do we need the coercion logic in PromiseThen? It looks like
this makes PromiseChain already do what PromiseThen should be doing.

Powered by Google App Engine
This is Rietveld 408576698