Closed Bug 1868962 Opened 2 years ago Closed 2 years ago

Update Temporal implementation to draft Nov 6, 2023

Categories

(Core :: JavaScript: Standard Library, task, P1)

task

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(24 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
No description provided.
Blocks: temporal

Adds PlainDateTimeWithCalendar to avoid PlainDateTimeObject allocations where
possible.

Depends on D195864

Prefer PlainObject instead of JSObject as a hint that the options object
aren't arbitrary objects.

Depends on D195869

Part 8 ensures that the initial value of days doesn't exceed ±200'000'000. This
allows to change days from double to int64_t, because overflowing an int64
value which starts at ±200'000'000 and can only incremented by one can't happen in
a reasonable amount of time.

Depends on D195871

Similar to part 2, we can avoid allocating ZonedDateTimeObject in a couple of places.

Depends on D195875

Use ZonedDateTime also for ToTemporalZonedDateTime to avoid unnecessary allocations.

Depends on D195876

Prefer the overloaded == operator to make the code a bit more readable.

Depends on D195878

Similar to parts 2 and 13, add a class to replace PlainDateObject when no
allocations are necessary.

Depends on D195879

Severity: -- → N/A
Priority: -- → P1
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/a6df27d326e9 Part 1: Avoid calendar operations when adding days-only duration to ZDT. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/54b2c01ed865 Part 2: Avoid extra allocations when calling GetInstantFor. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/2b1659f24e43 Part 3: Fast-path AddDaysToZonedDateTime in AddZonedDateTime. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/3c19db04360b Part 4: Avoid calendar operations when adding days-only duration to PlainDate. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/8bc5d28a55ec Part 5: Fast-path dateAdd() when adding only days. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/09119edb585e Part 6: Fast-path differences between identical objects. r=sfink https://hg.mozilla.org/integration/autoland/rev/cac76e7f171b Part 7: Prefer PlainObject for resolved options objects. r=sfink https://hg.mozilla.org/integration/autoland/rev/2a0942c538f1 Part 8: Fast-path dateUntil() when difference largest unit is days. r=sfink https://hg.mozilla.org/integration/autoland/rev/d1384db54f32 Part 9: Simplify NanosecondsToDays. r=sfink https://hg.mozilla.org/integration/autoland/rev/87c17ad2de55 Part 10: Look up getOffsetNanosecondsFor only once when resolving ambiguous datetime. r=sfink https://hg.mozilla.org/integration/autoland/rev/67d542cd14c2 Part 11: Precalculate PlainDateTime from ZonedDateTime in more places. r=dminor https://hg.mozilla.org/integration/autoland/rev/1261d998e9b0 Part 12: Fix absolute value bug in duration rounding no-op conditions. r=dminor https://hg.mozilla.org/integration/autoland/rev/5cb45a4b559e Part 13: Avoid ZonedDateTimeObject allocations where possible. r=dminor https://hg.mozilla.org/integration/autoland/rev/b7f5df35f348 Part 14: Avoid ZonedDateTimeObject allocations in ToTemporalZonedDateTime. r=dminor https://hg.mozilla.org/integration/autoland/rev/9545b271651d Part 15: Remove no longer used CreateTemporalTimeZoneUTC. r=dminor https://hg.mozilla.org/integration/autoland/rev/917cc39b3b39 Part 16: Use comparison operator to compare plain-date-time values. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/ff642fa3e86a Part 17: Add PlainDateWithCalendar. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/09aff6fb6f43 Part 18: Fixes for editorial issues. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/184063472826 Part 19: Set largestUnit property on resolvedOptions after early return. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/d8371c1bd48c Part 20: DRY out ISO 8601 PlainMonthDay reference year defaulting. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/eed6a07c17b8 Part 21: Look up time zone methods only once. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/6dce71a010ec Part 22: Look up calendar methods only once. r=sfink https://hg.mozilla.org/integration/autoland/rev/2ee6514b17f8 Part 23: Avoid extra Zoned→Plain conversion in AddDuration. r=dminor https://hg.mozilla.org/integration/autoland/rev/b5f1bc911ef4 Part 24: Enable now passing tests. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/4e756f339ef8 apply code formatting via Lando
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: