Closed Bug 1925195 Opened 1 year ago Closed 1 year ago

Inline some Date.prototype methods

Categories

(Core :: JavaScript Engine: JIT, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: anba, Assigned: anba)

References

Details

Attachments

(4 files)

Inline the following Date.prototype methods which are also inlined in both V8 and JSC:

  • Date.prototype.getTime
  • Date.prototype.getFullYear
  • Date.prototype.getMonth
  • Date.prototype.getDate
  • Date.prototype.getDay
  • Date.prototype.getHours
  • Date.prototype.getMinutes
  • Date.prototype.getSeconds

JSC additionally inlines:

  • Date.prototype.getMilliseconds
  • Date.prototype.getTimezoneOffset
  • Date.prototype.getYear
  • Date.prototype.setTime
  • And all UTC getter methods.

But for now only inline the Date methods which are inlined in both V8 and JSC, so that users can expect similar performance numbers across engines.

Inline for getTime for parity with V8 and JSC. Also enables inlining valueOf
and ThisTimeValue for free, because they return the same result as getTime.

These functions return the cached local date-time values, so we just need
the DateFillLocalTimeSlots CacheIR op from part 2, followed by reading the
corresponding slot.

The local time components aren't stored in separate slots, but instead in a
single slot which stores the number of seconds since the start of the year.

Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/0ffb38da7876 Part 1: Inline Date.prototype.{getTime,valueOf}. r=jandem https://hg.mozilla.org/integration/autoland/rev/64ed1e7ffcbc Part 2: Add support to call DateObject::fillLocalTimeSlots from JIT code. r=jandem https://hg.mozilla.org/integration/autoland/rev/12d75626c542 Part 3: Inline Date.prototype.get{FullYear,Month,Date,Day}. r=jandem https://hg.mozilla.org/integration/autoland/rev/fb72a2390e63 Part 4: Inline Date.prototype.get{Hours,Minutes,Seconds}. r=jandem

Either this bug or bug 1925051 improved some test

Jetstream2
3.5%-~5% on date-format-tofte-SP-Average
37% on date-format-xparb-SP-Geometric

Sunspider
15% on date-format-xparb

Regressions: 1926235
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: