1// Copyright 2021 the V8 project authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#include 'src/objects/js-temporal-objects.h' 6 7bitfield struct JSTemporalCalendarFlags extends uint31 { 8 calendar_index: int32: 5 bit; 9} 10 11bitfield struct JSTemporalYearMonthDay extends uint31 { 12 iso_year: int32: 20 bit; 13 iso_month: int32: 4 bit; 14 iso_day: int32: 5 bit; 15} 16 17bitfield struct JSTemporalHourMinuteSecond extends uint31 { 18 iso_hour: int32: 5 bit; 19 iso_minute: int32: 6 bit; 20 iso_second: int32: 6 bit; 21} 22 23bitfield struct JSTemporalSecondParts extends uint31 { 24 iso_millisecond: int32: 10 bit; 25 iso_microsecond: int32: 10 bit; 26 iso_nanosecond: int32: 10 bit; 27} 28 29bitfield struct JSTemporalTimeZoneFlags extends uint31 { 30 is_offset: bool: 1 bit; 31 offset_milliseconds_or_time_zone_index: int32: 28 bit; 32} 33bitfield struct JSTemporalTimeZoneSubMilliseconds extends uint31 { 34 offset_sub_milliseconds: int32: 21 bit; 35} 36 37extern class JSTemporalCalendar extends JSObject { 38 flags: SmiTagged<JSTemporalCalendarFlags>; 39} 40 41extern class JSTemporalDuration extends JSObject { 42 years: Number; 43 months: Number; 44 weeks: Number; 45 days: Number; 46 hours: Number; 47 minutes: Number; 48 seconds: Number; 49 milliseconds: Number; 50 microseconds: Number; 51 nanoseconds: Number; 52} 53 54extern class JSTemporalInstant extends JSObject { nanoseconds: BigInt; } 55 56extern class JSTemporalPlainDateTime extends JSObject { 57 year_month_day: SmiTagged<JSTemporalYearMonthDay>; 58 hour_minute_second: SmiTagged<JSTemporalHourMinuteSecond>; 59 second_parts: SmiTagged<JSTemporalSecondParts>; 60 calendar: JSReceiver; 61} 62 63extern class JSTemporalPlainDate extends JSObject { 64 year_month_day: SmiTagged<JSTemporalYearMonthDay>; 65 calendar: JSReceiver; 66} 67 68extern class JSTemporalPlainMonthDay extends JSObject { 69 year_month_day: SmiTagged<JSTemporalYearMonthDay>; 70 calendar: JSReceiver; 71} 72 73extern class JSTemporalPlainTime extends JSObject { 74 hour_minute_second: SmiTagged<JSTemporalHourMinuteSecond>; 75 second_parts: SmiTagged<JSTemporalSecondParts>; 76 calendar: JSReceiver; 77} 78 79extern class JSTemporalPlainYearMonth extends JSObject { 80 year_month_day: SmiTagged<JSTemporalYearMonthDay>; 81 calendar: JSReceiver; 82} 83 84extern class JSTemporalTimeZone extends JSObject { 85 flags: SmiTagged<JSTemporalTimeZoneFlags>; 86 details: SmiTagged<JSTemporalTimeZoneSubMilliseconds>; 87} 88 89extern class JSTemporalZonedDateTime extends JSObject { 90 nanoseconds: BigInt; 91 time_zone: JSReceiver; 92 calendar: JSReceiver; 93} 94