Closed Bug 1907132 Opened 1 year ago Closed 1 year ago

EnqueuePromiseResolveThenableJob allocates an array object unnecessarily

Categories

(Core :: JavaScript Engine, task)

task

Tracking

()

RESOLVED FIXED
130 Branch
Tracking Status
firefox130 --- fixed

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(1 file)

This is pretty minor, but while reading this code I noticed that EnqueuePromiseResolveThenableJob creates an array object to hold arguments for PromiseResolveThenableJob. However there are enough slots in extended function object to store the arguments there already without allocating an extra object.

This does not apply to EnqueuePromiseResolveThenableBuiltinJob which I assume will get called a lot more often.

Currently EnqueuePromiseResolveThenableJob allocates an array for this but
there are enough slots in an extended function to store all the arguments
there.

Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6e9a93d104d2 Store arguments to PromiseResolveThenableJob in the extended function object r=spidermonkey-reviewers,arai,mgaudet

Backed out for causing spidermonkey bustages in Promise.cpp

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: /builds/worker/checkouts/gecko/js/src/builtin/Promise.cpp:134:58: error: comparison between 'enum ThenableJobSlots' and 'enum js::FunctionExtended::<unnamed>' [-Werror=enum-compare]
Flags: needinfo?(jcoppeard)
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0045cbfc8dbe Store arguments to PromiseResolveThenableJob in the extended function object r=spidermonkey-reviewers,arai,mgaudet
Flags: needinfo?(jcoppeard)
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: