Closed Bug 1474348 Opened 6 years ago Closed 6 years ago

Fix two spec compliance bugs in the BlockOnPromise fast path

Categories

(Core :: JavaScript: Standard Library, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(2 files)

This fast path [1] needs to check that the onFulfilled function doesn't return an object and that the |blockedPromise| doesn't have the PROMISE_FLAG_DEFAULT_RESOLVING_FUNCTIONS (PROMISE_FLAG_DEFAULT_RESOLVE_FUNCTION / PROMISE_FLAG_DEFAULT_REJECT_FUNCTION) flag set.


[1] https://searchfox.org/mozilla-central/rev/28daa2806c89684b3dfa4f0b551db1d099dda7c2/js/src/builtin/Promise.cpp#3315-3316
Adds some additional accessor methods to the PromiseObject class and combines the PROMISE_FLAG_DEFAULT_RESOLVE_FUNCTION and PROMISE_FLAG_DEFAULT_REJECT_FUNCTION into a single PROMISE_FLAG_DEFAULT_RESOLVING_FUNCTIONS flag to avoid giving the impression that it is possible to have only one default resolving function.
Attachment #8990761 - Flags: review?(arai.unmht)
Fixes the two bugs by ensuring that |onFulfilled| doesn't return an object and the blocked promise doesn't have the PROMISE_FLAG_DEFAULT_RESOLVING_FUNCTIONS flag set.

Sorry for the convoluted test cases, it seems like both bugs require a rather complex set-up to get triggered.
Attachment #8990763 - Flags: review?(arai.unmht)
Comment on attachment 8990761 [details] [diff] [review]
bug1474348-part1-accessors-and-flags.patch

Review of attachment 8990761 [details] [diff] [review]:
-----------------------------------------------------------------

thanks!
Attachment #8990761 - Flags: review?(arai.unmht) → review+
Attachment #8990763 - Flags: review?(arai.unmht) → review+
Pushed by aiakab@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f80f0ce62873
Part 1: Add accessors for Promise fixed slots and combine default resolving functions flags. r=arai
https://hg.mozilla.org/integration/mozilla-inbound/rev/ff0152ae26bd
Part 2: Don't use BlockOnPromise fast path with non-default resolving functions. r=arai
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/f80f0ce62873
https://hg.mozilla.org/mozilla-central/rev/ff0152ae26bd
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: