Closed Bug 1920955 Opened 2 years ago Closed 2 years ago

Temporal: Remove calendars and time zones

Categories

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

task

Tracking

()

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(63 external files)

As a first step remove the Calendar and TimeZone properties from the
Temporal object. Actual code removal happens in later patches.

The previous two parts removed all references to TimeZoneObject, so we can
now remove that class and all of Temporal.TimeZone.

Merge TimeZoneObjectMaybeBuiltin with its only subclass BuiltinTimeZoneObject.

Remove the time zone method lookups and also directly call the built-in
function.

Part 14 will remove the TimeZoneRecord class.

Temporal.TimeZone and user-defined time zone objects no longer exist, so we
can remove their support from TimeZoneValue.

Replace TimeZoneRecord with TimeZoneValue everywhere and then remove
TimeZoneRecord.

Remove object allocations which only needed to happen to ensure object identity
when calling user-defined time zones. Now that Temporal.TimeZone and user-defined
time zone objects are no longer a thing, we can replace these objects with simple
stack allocated values.

Simplifies the code now that we no longer have to worry about possibly
calling an id accessor property when comparing time zones.

Similar to part 8, but this time for calendars instead of time zones.

This optimisation doesn't apply anymore when Temporal.Calendar is removed.

This removes Temporal.Calendar with all its methods. The next patches will
perform additional clean-ups.

Similar to part 12. Removes the method lookups and calls to user-defined
functions. Removing CalendarRecord will happen in a later patch in this
stack.

Temporal.Calendar and user-defined calendar objects no longer exist, so we
can remove their support from CalendarValue.

Remove CallCalendarMethod and update call calendar operations to use
PlainDate instead of passing the various Temporal.Plain* objects.

Similar to part 16.

Simplifies the code now that we no longer have to worry about possibly
calling an id accessor property when comparing calendars.

Pass the calendar identifier as std::string_view to avoid allocating a JSString.

And sync step comments.

Including updates to CalendarDateFromFields and CalendarDateUntil.

The removal of calendar objects and SnapshotOwnProperties allows to change
ToTemporalDateTime to always return PlainDateTimeWithCalendar, because
object identity is no longer observable. This simplifies the implementation
and avoids object allocations.

Also adds PlainMonthDayWithCalendar to avoid eagerly allocating
PlainMonthDayObject objects.

Still part of the "Remove calendars and time zones" commit.

Use CalendarValue instead of CalendarRecord and replace options with
TemporalOverflow.

Replace Wrapped<PlainDateObject*> with PlainDateWithCalendar because object
identity is no longer observable.

This exact approach no longer applies, we should revisit this later. Remove this
code for now, so it doesn't interfere with other clean-ups.

All callers have already been updated in previous patches, so all that's left
to do is removing the CalendarDateFromFields definition. Also remove some no
longer needed forward declarations.

Callers were already updated, so this is a plain removal.

The CalendarFieldNames vector is now only used in "TemporalFields.cpp", so
move it into that file.

All field names are now spec-internal names, which allows to replace the vector
with an enumset. This is faster and we no longer have to worry about keep the
sort order when appending new entries.

The object allocations in PrepareTemporalFields and PreparePartialTemporalFields
are no longer necessary, because user-defined calendars can no longer add custom
field names. This allows to use stack-allocated TemporalFields everywhere.

Later spec proposal changes will refactor PrepareTemporalFields again, but let's
remove the JSObject allocations first. (This patch also adds a couple of fixme
notes which will get resolved in later spec proposal changes.)

Still not done with the "Normative: Remove calendars and time zones" spec PR. The
constructors also no longer call ToCalendarValue or ToTemporalTimeZone.

Clean-up "Duration.h" header file.

Using PlainDateTime avoids rooting PlainDateTimeWithCalendar.

This avoids using JSString::ensureLinearString() in multiple places, so the
methods can all be changed to be infallible.

Severity: -- → N/A
Priority: -- → P2
Attachment #9427058 - Attachment description: Bug 1920955 - Part 1: Ensure date-time separators are balanced. r=#spidermonkey-reviewers! → Bug 1920955 - Part 1: Ensure date-time separators are consistent. r=#spidermonkey-reviewers!
Attachment #9427075 - Attachment description: Bug 1920955 - Part 18: Remove example optimisation when Temporal.Calendar is untampered. r=#spidermonkey-reviewers! → Bug 1920955 - Part 18: Remove example optimization when Temporal.Calendar is untampered. r=#spidermonkey-reviewers!
Keywords: leave-open
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/75430ad783ac Part 1: Ensure date-time separators are consistent. r=sfink https://hg.mozilla.org/integration/autoland/rev/7ff849c408a6 Part 2: Update step references. r=sfink https://hg.mozilla.org/integration/autoland/rev/5b180eff11ec Part 3: Revert U+2212 from offset grammar. r=sfink https://hg.mozilla.org/integration/autoland/rev/ebbccc0d0252 Part 4: Replace TimeZone transition methods with ZonedDateTime methods. r=sfink https://hg.mozilla.org/integration/autoland/rev/587ebdf6f856 Part 5: Remove getCalendar/getTimeZone methods. r=sfink https://hg.mozilla.org/integration/autoland/rev/5f746077910e Part 6: Remove getISOFields methods. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/ef023754bb7d Part 7: Remove direct access to Temporal.Calendar and Temporal.TimeZone. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/63569709f437 Part 8: Remove non-string time zone support from ToTemporalTimeZone. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/7545bd11d727 Part 9: Remove Temporal.TimeZone processing from Temporal.PlainDate.prototype.toZonedDateTime. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/35f79c75ee4f Part 10: Remove Temporal.TimeZone. r=mgaudet
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/85b88e8c4b10 Part 11: Merge BuiltinTimeZoneObject and TimeZoneObjectMaybeBuiltin. r=dminor https://hg.mozilla.org/integration/autoland/rev/85e0af8c0496 Part 12: Remove time zone method lookups. r=dminor https://hg.mozilla.org/integration/autoland/rev/026e06bb17c8 Part 13: Make TimeZoneValue a wrapper around BuiltinTimeZoneObject. r=dminor https://hg.mozilla.org/integration/autoland/rev/9fdd39380be7 Part 14: Remove TimeZoneRecord. r=dminor https://hg.mozilla.org/integration/autoland/rev/1a1f4c790be2 Part 15: Avoid passing no longer observable objects to time zone methods. r=dminor https://hg.mozilla.org/integration/autoland/rev/3e92d0869dc8 Part 16: Simplify TimeZoneEquals. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/5cd53678e5d4 Part 17: Remove non-string calendar support from ToTemporalCalendar. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/b3680be15e6f Part 18: Remove example optimization when Temporal.Calendar is untampered. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/99f119d32769 Part 19: Remove Temporal.Calendar. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/36240485d15f Part 20: Remove calendar method lookups. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/17bedf295f7c Part 21: Make CalendarValue a wrapper around CalendarId. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/d6ed03f9e0ec Part 22: Remove CallCalendarMethod. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/1a0d9ed19138 Part 23: Simplify CalendarEquals. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/f4629e5bb997 Part 24: Avoid JSString allocation for calendar identifiers in ToString. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/f50174176e6b Part 25: Remove SnapshotOwnProperties from DifferenceTemporalInstant. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/d0de41762757 Part 26: Remove SnapshotOwnProperties from PlainDate. r=sfink https://hg.mozilla.org/integration/autoland/rev/1de9d82ae23d Part 27: Remove SnapshotOwnProperties from PlainDateTime. r=sfink https://hg.mozilla.org/integration/autoland/rev/9aafcf82540d Part 28: Remove SnapshotOwnProperties from PlainMonthDay. r=sfink https://hg.mozilla.org/integration/autoland/rev/0189182b83e0 Part 29: Remove SnapshotOwnProperties from PlainYearMonth. r=sfink https://hg.mozilla.org/integration/autoland/rev/e04ee6d5701d Part 30: Remove SnapshotOwnProperties from PlainTime. r=sfink
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/c4ba92c70858 Part 31: Remove SnapshotOwnProperties from ZonedDateTime. r=dminor https://hg.mozilla.org/integration/autoland/rev/07c626e0e407 Part 32: Remove DifferenceDate. r=dminor https://hg.mozilla.org/integration/autoland/rev/53770328c9b7 Part 33: Update remaining AddDate callers to avoid using CalendarRecord. r=dminor https://hg.mozilla.org/integration/autoland/rev/4682c8da468f Part 34: Update GetTemporalRelativeToOption return types. r=dminor https://hg.mozilla.org/integration/autoland/rev/8ae2f778a3c3 Part 35: Remove CalendarRecord from AddZonedDateTime. r=dminor https://hg.mozilla.org/integration/autoland/rev/eb6503420c90 Part 36: Remove CalendarRecord from CalendarMergeFields. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/b04ad3b0b5be Part 37: Remove IsBuiltinAccess example optimisation. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/126e731356bf Part 38: Remove CalendarRecord from CalendarMonthDayFromFields. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/555b80e2bb5e Part 39: Remove CalendarRecord from CalendarYearMonthFromFields. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/c1e68a5a3d07 Part 40: Remove CalendarRecord from CalendarDateFromFields. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/f5fe8114d5d5 Part 41: Remove CalendarRecord from CalendarDateUntil. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/8b9542c994c2 Part 42: Remove CalendarRecord from CalendarDateAdd. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/c0eedf5b6ed5 Part 43: Remove CalendarRecord from PrepareCalendarFields{,AndFieldNames}. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/e226a5e289ca Part 44: Remove last CalendarRecord uses and references. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/0cf5a39aba64 Part 45: Change field names from StackGCVector to EnumSet. r=mgaudet https://hg.mozilla.org/integration/autoland/rev/971dbe22931a Part 46: Remove allocations from PrepareTemporalFields. r=sfink
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/d2fdb7e06acb Part 47: Remove ToCalendarValue and ToTemporalTimeZone from constructors. r=sfink https://hg.mozilla.org/integration/autoland/rev/de7fc134aa46 Part 48: Simplify ToTemporalDuration. r=sfink https://hg.mozilla.org/integration/autoland/rev/13c8ea94002d Part 49: Remove unused ToTemporalInstant. r=sfink https://hg.mozilla.org/integration/autoland/rev/924273c2a46c Part 50: Remove last use of Wrapped. r=sfink https://hg.mozilla.org/integration/autoland/rev/4e872db3f4fe Part 51: Remove Wrapped. r=dminor https://hg.mozilla.org/integration/autoland/rev/3aa13e988267 Part 52: Use GetTemporalCalendarWithISODefault in ToTemporalMonthDay. r=dminor https://hg.mozilla.org/integration/autoland/rev/8e27c98071eb Part 53: Clean-up Duration definitions. r=dminor https://hg.mozilla.org/integration/autoland/rev/0ed2c19fa8a6 Part 54: Clean-up PlainDate definitions. r=dminor https://hg.mozilla.org/integration/autoland/rev/c83e30c11bb1 Part 55: Prefer calendar-less PlainDateTime when possible. r=dminor https://hg.mozilla.org/integration/autoland/rev/b892183ecf72 Part 56: Clean-up PlainDateTime definitions. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/8e9bd367ff9a Part 57: Clean-up PlainMonthDay definitions. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/8f78980c140d Part 58: Call PrepareTemporalFields in ToTemporalTimeRecord per spec. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/d8359ea14575 Part 59: Clean-up PlainYearMonth definitions. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/51bbcb5aea0c Part 60: Clean-up Temporal definitions. r=allstarschh https://hg.mozilla.org/integration/autoland/rev/f60b95fa39f3 Part 61: Clean-up TimeZone definitions. r=sfink https://hg.mozilla.org/integration/autoland/rev/a5edc91cbb2d Part 62: Use JSLinearString for the time zone identifier. r=sfink https://hg.mozilla.org/integration/autoland/rev/687e61ce4b1d Part 63: Remove MaybeFormatCalendarAnnotation. r=dminor
Keywords: leave-open

https://hg.mozilla.org/mozilla-central/rev/75430ad783ac
https://hg.mozilla.org/mozilla-central/rev/7ff849c408a6
https://hg.mozilla.org/mozilla-central/rev/5b180eff11ec
https://hg.mozilla.org/mozilla-central/rev/ebbccc0d0252
https://hg.mozilla.org/mozilla-central/rev/587ebdf6f856
https://hg.mozilla.org/mozilla-central/rev/5f746077910e
https://hg.mozilla.org/mozilla-central/rev/ef023754bb7d
https://hg.mozilla.org/mozilla-central/rev/63569709f437
https://hg.mozilla.org/mozilla-central/rev/7545bd11d727
https://hg.mozilla.org/mozilla-central/rev/35f79c75ee4f
https://hg.mozilla.org/mozilla-central/rev/85b88e8c4b10
https://hg.mozilla.org/mozilla-central/rev/85e0af8c0496
https://hg.mozilla.org/mozilla-central/rev/026e06bb17c8
https://hg.mozilla.org/mozilla-central/rev/9fdd39380be7
https://hg.mozilla.org/mozilla-central/rev/1a1f4c790be2
https://hg.mozilla.org/mozilla-central/rev/3e92d0869dc8
https://hg.mozilla.org/mozilla-central/rev/5cd53678e5d4
https://hg.mozilla.org/mozilla-central/rev/b3680be15e6f
https://hg.mozilla.org/mozilla-central/rev/99f119d32769
https://hg.mozilla.org/mozilla-central/rev/36240485d15f
https://hg.mozilla.org/mozilla-central/rev/17bedf295f7c
https://hg.mozilla.org/mozilla-central/rev/d6ed03f9e0ec
https://hg.mozilla.org/mozilla-central/rev/1a0d9ed19138
https://hg.mozilla.org/mozilla-central/rev/f4629e5bb997
https://hg.mozilla.org/mozilla-central/rev/f50174176e6b
https://hg.mozilla.org/mozilla-central/rev/d0de41762757
https://hg.mozilla.org/mozilla-central/rev/1de9d82ae23d
https://hg.mozilla.org/mozilla-central/rev/9aafcf82540d
https://hg.mozilla.org/mozilla-central/rev/0189182b83e0
https://hg.mozilla.org/mozilla-central/rev/e04ee6d5701d
https://hg.mozilla.org/mozilla-central/rev/c4ba92c70858
https://hg.mozilla.org/mozilla-central/rev/07c626e0e407
https://hg.mozilla.org/mozilla-central/rev/53770328c9b7
https://hg.mozilla.org/mozilla-central/rev/4682c8da468f
https://hg.mozilla.org/mozilla-central/rev/8ae2f778a3c3
https://hg.mozilla.org/mozilla-central/rev/eb6503420c90
https://hg.mozilla.org/mozilla-central/rev/b04ad3b0b5be
https://hg.mozilla.org/mozilla-central/rev/126e731356bf
https://hg.mozilla.org/mozilla-central/rev/555b80e2bb5e
https://hg.mozilla.org/mozilla-central/rev/c1e68a5a3d07
https://hg.mozilla.org/mozilla-central/rev/f5fe8114d5d5
https://hg.mozilla.org/mozilla-central/rev/8b9542c994c2
https://hg.mozilla.org/mozilla-central/rev/c0eedf5b6ed5
https://hg.mozilla.org/mozilla-central/rev/e226a5e289ca
https://hg.mozilla.org/mozilla-central/rev/0cf5a39aba64
https://hg.mozilla.org/mozilla-central/rev/971dbe22931a
https://hg.mozilla.org/mozilla-central/rev/d2fdb7e06acb
https://hg.mozilla.org/mozilla-central/rev/de7fc134aa46
https://hg.mozilla.org/mozilla-central/rev/13c8ea94002d
https://hg.mozilla.org/mozilla-central/rev/924273c2a46c
https://hg.mozilla.org/mozilla-central/rev/4e872db3f4fe
https://hg.mozilla.org/mozilla-central/rev/3aa13e988267
https://hg.mozilla.org/mozilla-central/rev/8e27c98071eb
https://hg.mozilla.org/mozilla-central/rev/0ed2c19fa8a6
https://hg.mozilla.org/mozilla-central/rev/c83e30c11bb1
https://hg.mozilla.org/mozilla-central/rev/b892183ecf72
https://hg.mozilla.org/mozilla-central/rev/8e9bd367ff9a
https://hg.mozilla.org/mozilla-central/rev/8f78980c140d
https://hg.mozilla.org/mozilla-central/rev/d8359ea14575
https://hg.mozilla.org/mozilla-central/rev/51bbcb5aea0c
https://hg.mozilla.org/mozilla-central/rev/f60b95fa39f3
https://hg.mozilla.org/mozilla-central/rev/a5edc91cbb2d
https://hg.mozilla.org/mozilla-central/rev/687e61ce4b1d

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: