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

Issue 2025073002: Promises: Make PromiseSet operation monomorphic (Closed)

Created:
4 years, 6 months ago by gsathya
Modified:
4 years, 6 months ago
Reviewers:
Dan Ehrenberg, adamk
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

Promises: Make PromiseSet operation monomorphic The PromiseSet operation is called with two types of promises 1) A newly created promise object with no properties 2) Promise object with callbacks and other properties PromiseSet is called with the first type of promise (with no properties) from multiple call sites. PromiseSet is called with the second type of promise object only from FulfillPromise. Furthermore, this call only sets the value and status of the promise, the rest of the values are reset to UNDEFINED (which isn't necessary). This patch inlines the calls to set the value and status of the promise in FulfillPromise, instead of calling out to PromiseSet. This patch also reduces the number of symbol lookups, as we only set the value and status of the promise, and don't change the callback or deferred symbols. This patch results in a performance improvement of 2.8% over 5 runs in the bluebird benchmark. BUG=v8:5046 Committed: https://crrev.com/df4f8a2b9ee9e474e674301718d19b63650a0ba5 Cr-Commit-Position: refs/heads/master@{#36688}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -1 line) Patch
M src/js/promise.js View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 15 (7 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2025073002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2025073002/1
4 years, 6 months ago (2016-05-31 19:23:35 UTC) #3
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-05-31 19:47:48 UTC) #5
gsathya
4 years, 6 months ago (2016-05-31 20:10:21 UTC) #7
Dan Ehrenberg
lgtm Seems good to me. If we face a lot of different maps flowing through ...
4 years, 6 months ago (2016-06-01 15:26:34 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2025073002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2025073002/1
4 years, 6 months ago (2016-06-02 16:17:16 UTC) #10
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 6 months ago (2016-06-02 16:42:20 UTC) #12
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/df4f8a2b9ee9e474e674301718d19b63650a0ba5 Cr-Commit-Position: refs/heads/master@{#36688}
4 years, 6 months ago (2016-06-02 16:43:59 UTC) #14
gsathya
4 years, 6 months ago (2016-06-06 21:18:03 UTC) #15
Message was sent while issue was closed.
A revert of this CL (patchset #1 id:1) has been created in
https://codereview.chromium.org/2047553002/ by gsathya@chromium.org.

The reason for reverting is: As a side effect of calling PromiseSet from 
FulfillPromise, clears the deferred symbol and the 
resolve/reject callback symbols. Although this 
isn't strictly necessary, not doing this seems to 
result in a leak as seen in --

https://bugs.chromium.org/p/chromium/issues/detail?id=617137#c10.

Powered by Google App Engine
This is Rietveld 408576698