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

Issue 2334323006: Fix async/await memory leak (Closed)

Created:
4 years, 3 months ago by Dan Ehrenberg
Modified:
4 years, 3 months ago
Reviewers:
caitp, adamk
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Fix async/await memory leak This patch closes a memory leak in async/await where the desugaring was creating a situation analagous to that described in v8:5002. Intermediate Promises were being kept alive, so a long-running loop would cause linear memory usage on the heap. This patch returns undefined to the 'then' callback passed into PerformPromiseThen in order to avoid this hazard. Test expectations are fixed to remove expecting extraneous events which occurred on Promises that are now not given unnecessarily complex resolution paths before being thrown away. BUG=v8:5390 Committed: https://crrev.com/a0ba18e9634c5e2d439033ab61a77cff54f9af35 Cr-Commit-Position: refs/heads/master@{#39479}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Also do for catch, and fix another test #

Total comments: 6

Patch Set 3 : Rebase on master, and changes for review #

Total comments: 4

Patch Set 4 : Changes based on review #

Patch Set 5 : fix typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+91 lines, -27 lines) Patch
M src/js/harmony-async-await.js View 1 2 1 chunk +16 lines, -4 lines 0 comments Download
M src/parsing/parser.cc View 1 2 3 4 2 chunks +33 lines, -9 lines 0 comments Download
A test/mjsunit/harmony/async-await-loop.js View 1 1 chunk +34 lines, -0 lines 0 comments Download
M test/mjsunit/harmony/debug-async-function-async-task-event.js View 1 1 chunk +8 lines, -14 lines 0 comments Download

Messages

Total messages: 31 (15 generated)
Dan Ehrenberg
4 years, 3 months ago (2016-09-15 20:15:08 UTC) #4
caitp
https://codereview.chromium.org/2334323006/diff/1/src/js/harmony-async-await.js File src/js/harmony-async-await.js (right): https://codereview.chromium.org/2334323006/diff/1/src/js/harmony-async-await.js#newcode72 src/js/harmony-async-await.js:72: // The resulting Promise is a throwaway, so it ...
4 years, 3 months ago (2016-09-15 20:18:40 UTC) #5
Dan Ehrenberg
https://codereview.chromium.org/2334323006/diff/1/src/js/harmony-async-await.js File src/js/harmony-async-await.js (right): https://codereview.chromium.org/2334323006/diff/1/src/js/harmony-async-await.js#newcode72 src/js/harmony-async-await.js:72: // The resulting Promise is a throwaway, so it ...
4 years, 3 months ago (2016-09-15 20:24:21 UTC) #8
caitp
https://codereview.chromium.org/2334323006/diff/1/src/js/harmony-async-await.js File src/js/harmony-async-await.js (right): https://codereview.chromium.org/2334323006/diff/1/src/js/harmony-async-await.js#newcode72 src/js/harmony-async-await.js:72: // The resulting Promise is a throwaway, so it ...
4 years, 3 months ago (2016-09-15 20:32:23 UTC) #9
Dan Ehrenberg
https://codereview.chromium.org/2334323006/diff/1/src/js/harmony-async-await.js File src/js/harmony-async-await.js (right): https://codereview.chromium.org/2334323006/diff/1/src/js/harmony-async-await.js#newcode72 src/js/harmony-async-await.js:72: // The resulting Promise is a throwaway, so it ...
4 years, 3 months ago (2016-09-15 20:37:59 UTC) #10
adamk
https://codereview.chromium.org/2334323006/diff/20001/src/js/harmony-async-await.js File src/js/harmony-async-await.js (right): https://codereview.chromium.org/2334323006/diff/20001/src/js/harmony-async-await.js#newcode70 src/js/harmony-async-await.js:70: var onFulfilled = (sentValue) => { Nit: no need ...
4 years, 3 months ago (2016-09-15 22:43:20 UTC) #11
Dan Ehrenberg
Rebased without a dependency https://codereview.chromium.org/2334323006/diff/20001/src/js/harmony-async-await.js File src/js/harmony-async-await.js (right): https://codereview.chromium.org/2334323006/diff/20001/src/js/harmony-async-await.js#newcode70 src/js/harmony-async-await.js:70: var onFulfilled = (sentValue) => ...
4 years, 3 months ago (2016-09-16 00:36:01 UTC) #13
adamk
https://codereview.chromium.org/2334323006/diff/40001/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/2334323006/diff/40001/src/parsing/parser.cc#newcode4388 src/parsing/parser.cc:4388: // a break location, and the .promise needs to ...
4 years, 3 months ago (2016-09-16 17:24:47 UTC) #18
Dan Ehrenberg
https://codereview.chromium.org/2334323006/diff/40001/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/2334323006/diff/40001/src/parsing/parser.cc#newcode4388 src/parsing/parser.cc:4388: // a break location, and the .promise needs to ...
4 years, 3 months ago (2016-09-16 17:42:14 UTC) #19
adamk
lgtm
4 years, 3 months ago (2016-09-16 18:02:11 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2334323006/60001
4 years, 3 months ago (2016-09-16 18:14:08 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux64_avx2_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel_ng/builds/8844) v8_mac_rel_ng on master.tryserver.v8 (JOB_FAILED, ...
4 years, 3 months ago (2016-09-16 18:16:34 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2334323006/80001
4 years, 3 months ago (2016-09-16 18:20:53 UTC) #27
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 3 months ago (2016-09-16 18:45:17 UTC) #28
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/a0ba18e9634c5e2d439033ab61a77cff54f9af35 Cr-Commit-Position: refs/heads/master@{#39479}
4 years, 3 months ago (2016-09-16 18:46:23 UTC) #30
Michael Hablich
4 years, 3 months ago (2016-09-19 07:38:20 UTC) #31
Message was sent while issue was closed.
A revert of this CL (patchset #5 id:80001) has been created in
https://codereview.chromium.org/2354473002/ by hablich@chromium.org.

The reason for reverting is: newly introduced test async-await-loop times out:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20....

Powered by Google App Engine
This is Rietveld 408576698