Closed Bug 1560300 Opened 4 months ago Closed 3 months ago

Promise.all(iterable) and Promise.race(iterable) should Get Promise.resolve before iterating over iterable

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: jorendorff, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The spec recently changed. I guess this is a performance hack to the spec.

Test262 changed in this commit.

These tests now fail on a new test262 import:

  • test262/built-ins/Promise/all/invoke-resolve-get-error-close.js
  • test262/built-ins/Promise/all/invoke-resolve-get-once-multiple-calls.js
  • test262/built-ins/Promise/race/invoke-resolve-get-once-no-calls.js
  • test262/built-ins/Promise/race/invoke-resolve-get-error-close.js
  • test262/built-ins/Promise/race/invoke-resolve-get-once-multiple-calls.js
Blocks: test262
Priority: -- → P2

This optimisation added to the specification doesn't improve performance for us,
because we're already optimising the lookups in Promise.all & co. So we only
need to perform the initial check for PromiseLookup::isDefaultPromiseState
outside of the main loop in CommonPerformPromiseAllRace and that's more or
less all what needs to be changed.

Duplicate of this bug: 1549175
Assignee: nobody → andrebargull
Status: NEW → ASSIGNED

Pushed by cbrindusan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4e6589458455
Retrieve "resolve" property only once in PromiseAll, PromiseRace, and PromiseAllSettled. r=arai

Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.