-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use strings in slots to optimize builtin calendar and time zone implementations #2482
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
justingrant
reviewed
Jan 19, 2023
justingrant
reviewed
Jan 19, 2023
ptomato
force-pushed
the
1808-string-builtin-calendar
branch
from
January 19, 2023 19:46
e87cca2
to
c1ebf65
Compare
To do after today's discussion:
|
justingrant
changed the title
Draft: Strings for builtin calendars and time zones
Draft: Use strings in slots to optimize builtin calendar and time zone implementations
Jan 20, 2023
ptomato
force-pushed
the
1808-string-builtin-calendar
branch
from
January 21, 2023 01:13
c1ebf65
to
106b1a5
Compare
ptomato
force-pushed
the
1808-string-builtin-calendar
branch
from
February 16, 2023 23:23
106b1a5
to
31882e9
Compare
Codecov Report
@@ Coverage Diff @@
## main #2482 +/- ##
==========================================
+ Coverage 95.89% 95.91% +0.01%
==========================================
Files 20 20
Lines 10938 11104 +166
Branches 2046 2112 +66
==========================================
+ Hits 10489 10650 +161
- Misses 388 392 +4
- Partials 61 62 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
ptomato
force-pushed
the
1808-string-builtin-calendar
branch
from
February 16, 2023 23:33
31882e9
to
89cba80
Compare
ptomato
added a commit
to ptomato/test262
that referenced
this pull request
Feb 17, 2023
Now.timeZoneId() returns a string so that it can be used to construct objects that have the builtin time zone behaviour. Normative PR: tc39/proposal-temporal#2482
ptomato
added a commit
to ptomato/test262
that referenced
this pull request
Feb 17, 2023
Has several effects on existing tests: - Remove PlainTime from various tests that extract a Temporal.Calendar instance from another Temporal object. - Remove Temporal.PlainTime.prototype.calendar property. - Remove calendar property from object returned from Temporal.PlainTime.prototype.getISOFields(). - Ignore calendar annotation when converting ISO string to PlainTime. Normative PR: tc39/proposal-temporal#2482
ptomato
added a commit
to ptomato/test262
that referenced
this pull request
Feb 17, 2023
…ndar This is the replacement of the old API with the new API. Semantics will be corrected in the following commit. Normative PR: tc39/proposal-temporal#2482
ptomato
added a commit
to ptomato/test262
that referenced
this pull request
Feb 17, 2023
In several tests involving custom calendars, we need to change the implementation of dateFromFields/monthDayFromFields/yearMonthFromFields so that the returned object gets the receiver as its calendar after chaining up to the builtin implementation. Normative PR: tc39/proposal-temporal#2482
ptomato
added a commit
to ptomato/test262
that referenced
this pull request
Feb 17, 2023
Compare semantics for custom calendars that _don't_ extend Temporal.Calendar (and therefore don't have the internal slot) use the value of the .id property, instead of calling toString(). Normative PR: tc39/proposal-temporal#2482
ptomato
added a commit
to ptomato/test262
that referenced
this pull request
Feb 17, 2023
ptomato
added a commit
to ptomato/test262
that referenced
this pull request
Feb 17, 2023
This is the replacement of the old API with the new API, .timeZoneId and .getTimeZone(). Semantics will be corrected in the following commit. Normative PR: tc39/proposal-temporal#2482
ptomato
added a commit
to ptomato/test262
that referenced
this pull request
Feb 17, 2023
ptomato
added a commit
to ptomato/test262
that referenced
this pull request
Feb 17, 2023
Compare semantics for custom time zones that _don't_ extend Temporal.TimeZone (and therefore don't have the internal slot) use the value of the .id property, instead of calling toString(). Normative PR: tc39/proposal-temporal#2482
ptomato
added a commit
to ptomato/test262
that referenced
this pull request
Feb 17, 2023
This change now has coverage in test262: tc39/test262#3788 |
ptomato
force-pushed
the
1808-string-builtin-calendar
branch
from
February 18, 2023 00:59
89cba80
to
2db24fa
Compare
ptomato
added a commit
to ptomato/test262
that referenced
this pull request
Feb 18, 2023
Now.timeZoneId() returns a string so that it can be used to construct objects that have the builtin time zone behaviour. Normative PR: tc39/proposal-temporal#2482
ptomato
added a commit
to ptomato/test262
that referenced
this pull request
Feb 18, 2023
Has several effects on existing tests: - Remove PlainTime from various tests that extract a Temporal.Calendar instance from another Temporal object. - Remove Temporal.PlainTime.prototype.calendar property. - Remove calendar property from object returned from Temporal.PlainTime.prototype.getISOFields(). - Ignore calendar annotation when converting ISO string to PlainTime. Normative PR: tc39/proposal-temporal#2482
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Jul 21, 2023
…type.toJSON. r=spidermonkey-reviewers,sfink Also per <tc39/proposal-temporal#2482> Depends on D182027 Differential Revision: https://phabricator.services.mozilla.com/D182028 UltraBlame original commit: 1499a730b4bf448ff87289899b462eaadd92bc36
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Jul 21, 2023
…type.toJSON. r=spidermonkey-reviewers,dminor Also per <tc39/proposal-temporal#2482>. Depends on D182028 Differential Revision: https://phabricator.services.mozilla.com/D182029 UltraBlame original commit: 06d1f2c99d3655bb48f32c40284c4b676d578f5c
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Jul 21, 2023
…t operation. r=spidermonkey-reviewers,dminor From <tc39/proposal-temporal#2482>. Depends on D182029 Differential Revision: https://phabricator.services.mozilla.com/D182030 UltraBlame original commit: e85fd6da2df853727ec62267c18fd2948b0e08d0
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Jul 21, 2023
…t operation. r=spidermonkey-reviewers,dminor From <tc39/proposal-temporal#2482>. Depends on D182030 Differential Revision: https://phabricator.services.mozilla.com/D182031 UltraBlame original commit: 7c449d1bc88f0c7656dc99ac3982f10b44ac312f
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Jul 21, 2023
…poral objects. r=spidermonkey-reviewers,dminor From <tc39/proposal-temporal#2482>. Depends on D182031 Differential Revision: https://phabricator.services.mozilla.com/D182032 UltraBlame original commit: 5bf5631f760c7672d7541e838805b2e5aa5a49df
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Jul 21, 2023
…ey-reviewers,allstarschh `CalendarValue` now holds either a calendar object (`CalendarObject` or any `JSObject` for user-calendars) or a calendar identifier string. This isn't necessarily the final design for `CalendarValue`, but works for now until we add support more built-in calendars beside the ISO-8601 calendar. Per <tc39/proposal-temporal#2482> Differential Revision: https://phabricator.services.mozilla.com/D182034 UltraBlame original commit: 193dea45a684255439b5532696b4df3cdc1b96f7
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Jul 21, 2023
…w.timeZoneId. r=spidermonkey-reviewers,allstarschh Replace the function per <tc39/proposal-temporal#2482>. Differential Revision: https://phabricator.services.mozilla.com/D182035 UltraBlame original commit: b4fe5032e88b5b06047c9781d75774e56fc527c9
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
Jul 21, 2023
…ejectTemporalLikeObject. r=spidermonkey-reviewers,allstarschh Rename per <tc39/proposal-temporal#2482>. Depends on D182036 Differential Revision: https://phabricator.services.mozilla.com/D182038 UltraBlame original commit: 4bb3d334eaacf0084e325b1b85d1352f9fd44051
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Jul 21, 2023
…reviewers,mgaudet PlainTime objects no longer have an associated calendar slot. See <tc39/proposal-temporal#2482>. Depends on D182022 Differential Revision: https://phabricator.services.mozilla.com/D182023 UltraBlame original commit: ece2a09b9b46acf5245b5e04f96a79a3ed3c9c3e
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Jul 21, 2023
…type.toJSON. r=spidermonkey-reviewers,sfink Also per <tc39/proposal-temporal#2482> Depends on D182027 Differential Revision: https://phabricator.services.mozilla.com/D182028 UltraBlame original commit: 1499a730b4bf448ff87289899b462eaadd92bc36
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Jul 21, 2023
…type.toJSON. r=spidermonkey-reviewers,dminor Also per <tc39/proposal-temporal#2482>. Depends on D182028 Differential Revision: https://phabricator.services.mozilla.com/D182029 UltraBlame original commit: 06d1f2c99d3655bb48f32c40284c4b676d578f5c
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Jul 21, 2023
…t operation. r=spidermonkey-reviewers,dminor From <tc39/proposal-temporal#2482>. Depends on D182029 Differential Revision: https://phabricator.services.mozilla.com/D182030 UltraBlame original commit: e85fd6da2df853727ec62267c18fd2948b0e08d0
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Jul 21, 2023
…t operation. r=spidermonkey-reviewers,dminor From <tc39/proposal-temporal#2482>. Depends on D182030 Differential Revision: https://phabricator.services.mozilla.com/D182031 UltraBlame original commit: 7c449d1bc88f0c7656dc99ac3982f10b44ac312f
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Jul 21, 2023
…poral objects. r=spidermonkey-reviewers,dminor From <tc39/proposal-temporal#2482>. Depends on D182031 Differential Revision: https://phabricator.services.mozilla.com/D182032 UltraBlame original commit: 5bf5631f760c7672d7541e838805b2e5aa5a49df
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Jul 21, 2023
…ey-reviewers,allstarschh `CalendarValue` now holds either a calendar object (`CalendarObject` or any `JSObject` for user-calendars) or a calendar identifier string. This isn't necessarily the final design for `CalendarValue`, but works for now until we add support more built-in calendars beside the ISO-8601 calendar. Per <tc39/proposal-temporal#2482> Differential Revision: https://phabricator.services.mozilla.com/D182034 UltraBlame original commit: 193dea45a684255439b5532696b4df3cdc1b96f7
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Jul 21, 2023
…w.timeZoneId. r=spidermonkey-reviewers,allstarschh Replace the function per <tc39/proposal-temporal#2482>. Differential Revision: https://phabricator.services.mozilla.com/D182035 UltraBlame original commit: b4fe5032e88b5b06047c9781d75774e56fc527c9
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
Jul 21, 2023
…ejectTemporalLikeObject. r=spidermonkey-reviewers,allstarschh Rename per <tc39/proposal-temporal#2482>. Depends on D182036 Differential Revision: https://phabricator.services.mozilla.com/D182038 UltraBlame original commit: 4bb3d334eaacf0084e325b1b85d1352f9fd44051
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Jul 21, 2023
…reviewers,mgaudet PlainTime objects no longer have an associated calendar slot. See <tc39/proposal-temporal#2482>. Depends on D182022 Differential Revision: https://phabricator.services.mozilla.com/D182023 UltraBlame original commit: ece2a09b9b46acf5245b5e04f96a79a3ed3c9c3e
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Jul 21, 2023
…type.toJSON. r=spidermonkey-reviewers,sfink Also per <tc39/proposal-temporal#2482> Depends on D182027 Differential Revision: https://phabricator.services.mozilla.com/D182028 UltraBlame original commit: 1499a730b4bf448ff87289899b462eaadd92bc36
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Jul 21, 2023
…type.toJSON. r=spidermonkey-reviewers,dminor Also per <tc39/proposal-temporal#2482>. Depends on D182028 Differential Revision: https://phabricator.services.mozilla.com/D182029 UltraBlame original commit: 06d1f2c99d3655bb48f32c40284c4b676d578f5c
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Jul 21, 2023
…t operation. r=spidermonkey-reviewers,dminor From <tc39/proposal-temporal#2482>. Depends on D182029 Differential Revision: https://phabricator.services.mozilla.com/D182030 UltraBlame original commit: e85fd6da2df853727ec62267c18fd2948b0e08d0
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Jul 21, 2023
…t operation. r=spidermonkey-reviewers,dminor From <tc39/proposal-temporal#2482>. Depends on D182030 Differential Revision: https://phabricator.services.mozilla.com/D182031 UltraBlame original commit: 7c449d1bc88f0c7656dc99ac3982f10b44ac312f
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Jul 21, 2023
…poral objects. r=spidermonkey-reviewers,dminor From <tc39/proposal-temporal#2482>. Depends on D182031 Differential Revision: https://phabricator.services.mozilla.com/D182032 UltraBlame original commit: 5bf5631f760c7672d7541e838805b2e5aa5a49df
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Jul 21, 2023
…ey-reviewers,allstarschh `CalendarValue` now holds either a calendar object (`CalendarObject` or any `JSObject` for user-calendars) or a calendar identifier string. This isn't necessarily the final design for `CalendarValue`, but works for now until we add support more built-in calendars beside the ISO-8601 calendar. Per <tc39/proposal-temporal#2482> Differential Revision: https://phabricator.services.mozilla.com/D182034 UltraBlame original commit: 193dea45a684255439b5532696b4df3cdc1b96f7
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Jul 21, 2023
…w.timeZoneId. r=spidermonkey-reviewers,allstarschh Replace the function per <tc39/proposal-temporal#2482>. Differential Revision: https://phabricator.services.mozilla.com/D182035 UltraBlame original commit: b4fe5032e88b5b06047c9781d75774e56fc527c9
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
Jul 21, 2023
…ejectTemporalLikeObject. r=spidermonkey-reviewers,allstarschh Rename per <tc39/proposal-temporal#2482>. Depends on D182036 Differential Revision: https://phabricator.services.mozilla.com/D182038 UltraBlame original commit: 4bb3d334eaacf0084e325b1b85d1352f9fd44051
This was referenced Aug 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the change discussed in #1808, to be discussed in the Temporal champions meeting.
This is a large breaking change requested by implementers. It optimizes implementation performance by removing the requirement to create new
Temporal.Calendar
/Temporal.TimeZone
instances in the 99%+ case of using built-in calendars and time zones. Instead, only the string IDs of those built-in calendars or time zones will be stored in the internal slots of Temporal objects likeTemporal.ZonedDateTime
that today store calendar and/or time zone objects in internal slots.