11cb0ef41Sopenharmony_ci// Copyright 2021 the V8 project authors. All rights reserved. 21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be 31cb0ef41Sopenharmony_ci// found in the LICENSE file. 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ci#ifndef V8_OBJECTS_JS_TEMPORAL_OBJECTS_H_ 61cb0ef41Sopenharmony_ci#define V8_OBJECTS_JS_TEMPORAL_OBJECTS_H_ 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ci#include "src/execution/isolate.h" 91cb0ef41Sopenharmony_ci#include "src/heap/factory.h" 101cb0ef41Sopenharmony_ci#include "src/objects/objects.h" 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci// Has to be the last include (doesn't have include guards): 131cb0ef41Sopenharmony_ci#include "src/objects/object-macros.h" 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_cinamespace v8 { 161cb0ef41Sopenharmony_cinamespace internal { 171cb0ef41Sopenharmony_ci 181cb0ef41Sopenharmony_ci#include "torque-generated/src/objects/js-temporal-objects-tq.inc" 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_ci#define DECLARE_TEMPORAL_INLINE_GETTER_SETTER(field) \ 211cb0ef41Sopenharmony_ci inline void set_##field(int32_t field); \ 221cb0ef41Sopenharmony_ci inline int32_t field() const; 231cb0ef41Sopenharmony_ci 241cb0ef41Sopenharmony_ci#define DECLARE_TEMPORAL_TIME_INLINE_GETTER_SETTER() \ 251cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_hour) \ 261cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_minute) \ 271cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_second) \ 281cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_millisecond) \ 291cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_microsecond) \ 301cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_nanosecond) 311cb0ef41Sopenharmony_ci 321cb0ef41Sopenharmony_ci#define DECLARE_TEMPORAL_DATE_INLINE_GETTER_SETTER() \ 331cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_year) \ 341cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_month) \ 351cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_day) 361cb0ef41Sopenharmony_ci 371cb0ef41Sopenharmony_ci#define TEMPORAL_UNIMPLEMENTED(T) \ 381cb0ef41Sopenharmony_ci { \ 391cb0ef41Sopenharmony_ci printf("TBW %s\n", __PRETTY_FUNCTION__); \ 401cb0ef41Sopenharmony_ci UNIMPLEMENTED(); \ 411cb0ef41Sopenharmony_ci } 421cb0ef41Sopenharmony_ci 431cb0ef41Sopenharmony_ciclass JSTemporalPlainDate; 441cb0ef41Sopenharmony_ciclass JSTemporalPlainMonthDay; 451cb0ef41Sopenharmony_ciclass JSTemporalPlainYearMonth; 461cb0ef41Sopenharmony_ci 471cb0ef41Sopenharmony_ciclass JSTemporalCalendar 481cb0ef41Sopenharmony_ci : public TorqueGeneratedJSTemporalCalendar<JSTemporalCalendar, JSObject> { 491cb0ef41Sopenharmony_ci public: 501cb0ef41Sopenharmony_ci // #sec-temporal.calendar 511cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalCalendar> Constructor( 521cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSFunction> target, 531cb0ef41Sopenharmony_ci Handle<HeapObject> new_target, Handle<Object> identifier); 541cb0ef41Sopenharmony_ci 551cb0ef41Sopenharmony_ci // #sec-temporal.calendar.prototype.year 561cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<Smi> Year( 571cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalCalendar> calendar, 581cb0ef41Sopenharmony_ci Handle<Object> temporal_date_like); 591cb0ef41Sopenharmony_ci 601cb0ef41Sopenharmony_ci // #sec-temporal.calendar.prototype.daysinyear 611cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<Smi> DaysInYear( 621cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalCalendar> calendar, 631cb0ef41Sopenharmony_ci Handle<Object> temporal_date_like); 641cb0ef41Sopenharmony_ci 651cb0ef41Sopenharmony_ci // #sec-temporal.calendar.prototype.dayofweek 661cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<Smi> DayOfWeek( 671cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalCalendar> calendar, 681cb0ef41Sopenharmony_ci Handle<Object> temporal_date_like); 691cb0ef41Sopenharmony_ci 701cb0ef41Sopenharmony_ci // #sec-temporal.calendar.prototype.dayofyear 711cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<Smi> DayOfYear( 721cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalCalendar> calendar, 731cb0ef41Sopenharmony_ci Handle<Object> temporal_date_like); 741cb0ef41Sopenharmony_ci 751cb0ef41Sopenharmony_ci // #sec-temporal.calendar.prototype.monthsinyear 761cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<Smi> MonthsInYear( 771cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalCalendar> calendar, 781cb0ef41Sopenharmony_ci Handle<Object> temporal_date_like); 791cb0ef41Sopenharmony_ci 801cb0ef41Sopenharmony_ci // #sec-temporal.calendar.prototype.inleapyear 811cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<Oddball> InLeapYear( 821cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalCalendar> calendar, 831cb0ef41Sopenharmony_ci Handle<Object> temporal_date_like); 841cb0ef41Sopenharmony_ci 851cb0ef41Sopenharmony_ci // #sec-temporal.calendar.prototype.daysinmonth 861cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<Smi> DaysInMonth( 871cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalCalendar> calendar, 881cb0ef41Sopenharmony_ci Handle<Object> temporal_date_like); 891cb0ef41Sopenharmony_ci 901cb0ef41Sopenharmony_ci // #sec-temporal.calendar.prototype.daysinweek 911cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<Smi> DaysInWeek( 921cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalCalendar> calendar, 931cb0ef41Sopenharmony_ci Handle<Object> temporal_date_like); 941cb0ef41Sopenharmony_ci 951cb0ef41Sopenharmony_ci // #sec-temporal.calendar.prototype.datefromfields 961cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainDate> DateFromFields( 971cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalCalendar> calendar, 981cb0ef41Sopenharmony_ci Handle<Object> fields, Handle<Object> options); 991cb0ef41Sopenharmony_ci 1001cb0ef41Sopenharmony_ci // #sec-temporal.calendar.prototype.mergefields 1011cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSReceiver> MergeFields( 1021cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalCalendar> calendar, 1031cb0ef41Sopenharmony_ci Handle<Object> fields, Handle<Object> additional_fields); 1041cb0ef41Sopenharmony_ci 1051cb0ef41Sopenharmony_ci // #sec-temporal.calendar.prototype.tostring 1061cb0ef41Sopenharmony_ci static MaybeHandle<String> ToString(Isolate* isolate, 1071cb0ef41Sopenharmony_ci Handle<JSTemporalCalendar> calendar, 1081cb0ef41Sopenharmony_ci const char* method); 1091cb0ef41Sopenharmony_ci 1101cb0ef41Sopenharmony_ci DECL_PRINTER(JSTemporalCalendar) 1111cb0ef41Sopenharmony_ci 1121cb0ef41Sopenharmony_ci DEFINE_TORQUE_GENERATED_JS_TEMPORAL_CALENDAR_FLAGS() 1131cb0ef41Sopenharmony_ci 1141cb0ef41Sopenharmony_ci DECL_INT_ACCESSORS(calendar_index) 1151cb0ef41Sopenharmony_ci 1161cb0ef41Sopenharmony_ci TQ_OBJECT_CONSTRUCTORS(JSTemporalCalendar) 1171cb0ef41Sopenharmony_ci}; 1181cb0ef41Sopenharmony_ci 1191cb0ef41Sopenharmony_ciclass JSTemporalDuration 1201cb0ef41Sopenharmony_ci : public TorqueGeneratedJSTemporalDuration<JSTemporalDuration, JSObject> { 1211cb0ef41Sopenharmony_ci public: 1221cb0ef41Sopenharmony_ci // #sec-temporal.duration 1231cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalDuration> Constructor( 1241cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSFunction> target, 1251cb0ef41Sopenharmony_ci Handle<HeapObject> new_target, Handle<Object> years, 1261cb0ef41Sopenharmony_ci Handle<Object> months, Handle<Object> weeks, Handle<Object> days, 1271cb0ef41Sopenharmony_ci Handle<Object> hours, Handle<Object> minutes, Handle<Object> seconds, 1281cb0ef41Sopenharmony_ci Handle<Object> milliseconds, Handle<Object> microseconds, 1291cb0ef41Sopenharmony_ci Handle<Object> nanoseconds); 1301cb0ef41Sopenharmony_ci 1311cb0ef41Sopenharmony_ci // #sec-get-temporal.duration.prototype.sign 1321cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<Smi> Sign( 1331cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalDuration> duration); 1341cb0ef41Sopenharmony_ci 1351cb0ef41Sopenharmony_ci // #sec-get-temporal.duration.prototype.blank 1361cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<Oddball> Blank( 1371cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalDuration> duration); 1381cb0ef41Sopenharmony_ci 1391cb0ef41Sopenharmony_ci // #sec-temporal.duration.prototype.negated 1401cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalDuration> Negated( 1411cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalDuration> duration); 1421cb0ef41Sopenharmony_ci 1431cb0ef41Sopenharmony_ci // #sec-temporal.duration.prototype.abs 1441cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalDuration> Abs( 1451cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalDuration> duration); 1461cb0ef41Sopenharmony_ci 1471cb0ef41Sopenharmony_ci DECL_PRINTER(JSTemporalDuration) 1481cb0ef41Sopenharmony_ci 1491cb0ef41Sopenharmony_ci TQ_OBJECT_CONSTRUCTORS(JSTemporalDuration) 1501cb0ef41Sopenharmony_ci}; 1511cb0ef41Sopenharmony_ci 1521cb0ef41Sopenharmony_ciclass JSTemporalInstant 1531cb0ef41Sopenharmony_ci : public TorqueGeneratedJSTemporalInstant<JSTemporalInstant, JSObject> { 1541cb0ef41Sopenharmony_ci public: 1551cb0ef41Sopenharmony_ci // #sec-temporal-instant-constructor 1561cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalInstant> Constructor( 1571cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSFunction> target, 1581cb0ef41Sopenharmony_ci Handle<HeapObject> new_target, Handle<Object> epoch_nanoseconds); 1591cb0ef41Sopenharmony_ci 1601cb0ef41Sopenharmony_ci // #sec-temporal.now.instant 1611cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalInstant> Now( 1621cb0ef41Sopenharmony_ci Isolate* isolate); 1631cb0ef41Sopenharmony_ci 1641cb0ef41Sopenharmony_ci // #sec-temporal.instant.fromepochseconds 1651cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalInstant> FromEpochSeconds( 1661cb0ef41Sopenharmony_ci Isolate* isolate, Handle<Object> epoch_seconds); 1671cb0ef41Sopenharmony_ci // #sec-temporal.instant.fromepochmilliseconds 1681cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalInstant> 1691cb0ef41Sopenharmony_ci FromEpochMilliseconds(Isolate* isolate, Handle<Object> epoch_milliseconds); 1701cb0ef41Sopenharmony_ci // #sec-temporal.instant.fromepochmicroseconds 1711cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalInstant> 1721cb0ef41Sopenharmony_ci FromEpochMicroseconds(Isolate* isolate, Handle<Object> epoch_microseconds); 1731cb0ef41Sopenharmony_ci // #sec-temporal.instant.fromepochnanoeconds 1741cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalInstant> 1751cb0ef41Sopenharmony_ci FromEpochNanoseconds(Isolate* isolate, Handle<Object> epoch_nanoseconds); 1761cb0ef41Sopenharmony_ci 1771cb0ef41Sopenharmony_ci // #sec-temporal.instant.from 1781cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalInstant> From( 1791cb0ef41Sopenharmony_ci Isolate* isolate, Handle<Object> item); 1801cb0ef41Sopenharmony_ci 1811cb0ef41Sopenharmony_ci DECL_PRINTER(JSTemporalInstant) 1821cb0ef41Sopenharmony_ci 1831cb0ef41Sopenharmony_ci TQ_OBJECT_CONSTRUCTORS(JSTemporalInstant) 1841cb0ef41Sopenharmony_ci}; 1851cb0ef41Sopenharmony_ci 1861cb0ef41Sopenharmony_ciclass JSTemporalPlainDate 1871cb0ef41Sopenharmony_ci : public TorqueGeneratedJSTemporalPlainDate<JSTemporalPlainDate, JSObject> { 1881cb0ef41Sopenharmony_ci public: 1891cb0ef41Sopenharmony_ci // #sec-temporal-createtemporaldate 1901cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainDate> Constructor( 1911cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSFunction> target, 1921cb0ef41Sopenharmony_ci Handle<HeapObject> new_target, Handle<Object> iso_year, 1931cb0ef41Sopenharmony_ci Handle<Object> iso_month, Handle<Object> iso_day, 1941cb0ef41Sopenharmony_ci Handle<Object> calendar_like); 1951cb0ef41Sopenharmony_ci 1961cb0ef41Sopenharmony_ci // #sec-temporal.plaindate.prototype.withcalendar 1971cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainDate> WithCalendar( 1981cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalPlainDate> plain_date, 1991cb0ef41Sopenharmony_ci Handle<Object> calendar_like); 2001cb0ef41Sopenharmony_ci 2011cb0ef41Sopenharmony_ci // #sec-temporal.plaindate.from 2021cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainDate> From( 2031cb0ef41Sopenharmony_ci Isolate* isolate, Handle<Object> item, Handle<Object> options); 2041cb0ef41Sopenharmony_ci 2051cb0ef41Sopenharmony_ci // #sec-temporal.plaindate.prototype.getisofields 2061cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSReceiver> GetISOFields( 2071cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalPlainDate> plain_date); 2081cb0ef41Sopenharmony_ci 2091cb0ef41Sopenharmony_ci // #sec-temporal.now.plaindate 2101cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainDate> Now( 2111cb0ef41Sopenharmony_ci Isolate* isolate, Handle<Object> calendar_like, 2121cb0ef41Sopenharmony_ci Handle<Object> temporal_time_zone_like); 2131cb0ef41Sopenharmony_ci 2141cb0ef41Sopenharmony_ci // #sec-temporal.now.plaindateiso 2151cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainDate> NowISO( 2161cb0ef41Sopenharmony_ci Isolate* isolate, Handle<Object> temporal_time_zone_like); 2171cb0ef41Sopenharmony_ci DECL_PRINTER(JSTemporalPlainDate) 2181cb0ef41Sopenharmony_ci 2191cb0ef41Sopenharmony_ci DEFINE_TORQUE_GENERATED_JS_TEMPORAL_YEAR_MONTH_DAY() 2201cb0ef41Sopenharmony_ci 2211cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_DATE_INLINE_GETTER_SETTER() 2221cb0ef41Sopenharmony_ci 2231cb0ef41Sopenharmony_ci TQ_OBJECT_CONSTRUCTORS(JSTemporalPlainDate) 2241cb0ef41Sopenharmony_ci}; 2251cb0ef41Sopenharmony_ci 2261cb0ef41Sopenharmony_ciclass JSTemporalPlainDateTime 2271cb0ef41Sopenharmony_ci : public TorqueGeneratedJSTemporalPlainDateTime<JSTemporalPlainDateTime, 2281cb0ef41Sopenharmony_ci JSObject> { 2291cb0ef41Sopenharmony_ci public: 2301cb0ef41Sopenharmony_ci // #sec-temporal-createtemporaldatetime 2311cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainDateTime> Constructor( 2321cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSFunction> target, 2331cb0ef41Sopenharmony_ci Handle<HeapObject> new_target, Handle<Object> iso_year, 2341cb0ef41Sopenharmony_ci Handle<Object> iso_month, Handle<Object> iso_day, Handle<Object> hour, 2351cb0ef41Sopenharmony_ci Handle<Object> minute, Handle<Object> second, Handle<Object> millisecond, 2361cb0ef41Sopenharmony_ci Handle<Object> microsecond, Handle<Object> nanosecond, 2371cb0ef41Sopenharmony_ci Handle<Object> calendar_like); 2381cb0ef41Sopenharmony_ci 2391cb0ef41Sopenharmony_ci // #sec-temporal.plaindatetime.prototype.withcalendar 2401cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainDateTime> 2411cb0ef41Sopenharmony_ci WithCalendar(Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time, 2421cb0ef41Sopenharmony_ci Handle<Object> calendar_like); 2431cb0ef41Sopenharmony_ci 2441cb0ef41Sopenharmony_ci // #sec-temporal.plaindatetime.prototype.getisofields 2451cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSReceiver> GetISOFields( 2461cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalPlainDateTime> date_time); 2471cb0ef41Sopenharmony_ci 2481cb0ef41Sopenharmony_ci // #sec-temporal.now.plaindatetime 2491cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainDateTime> Now( 2501cb0ef41Sopenharmony_ci Isolate* isolate, Handle<Object> calendar_like, 2511cb0ef41Sopenharmony_ci Handle<Object> temporal_time_zone_like); 2521cb0ef41Sopenharmony_ci 2531cb0ef41Sopenharmony_ci // #sec-temporal.now.plaindatetimeiso 2541cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainDateTime> NowISO( 2551cb0ef41Sopenharmony_ci Isolate* isolate, Handle<Object> temporal_time_zone_like); 2561cb0ef41Sopenharmony_ci 2571cb0ef41Sopenharmony_ci DECL_PRINTER(JSTemporalPlainDateTime) 2581cb0ef41Sopenharmony_ci 2591cb0ef41Sopenharmony_ci DEFINE_TORQUE_GENERATED_JS_TEMPORAL_YEAR_MONTH_DAY() 2601cb0ef41Sopenharmony_ci DEFINE_TORQUE_GENERATED_JS_TEMPORAL_HOUR_MINUTE_SECOND() 2611cb0ef41Sopenharmony_ci DEFINE_TORQUE_GENERATED_JS_TEMPORAL_SECOND_PARTS() 2621cb0ef41Sopenharmony_ci 2631cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_DATE_INLINE_GETTER_SETTER() 2641cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_TIME_INLINE_GETTER_SETTER() 2651cb0ef41Sopenharmony_ci 2661cb0ef41Sopenharmony_ci TQ_OBJECT_CONSTRUCTORS(JSTemporalPlainDateTime) 2671cb0ef41Sopenharmony_ci}; 2681cb0ef41Sopenharmony_ci 2691cb0ef41Sopenharmony_ciclass JSTemporalPlainMonthDay 2701cb0ef41Sopenharmony_ci : public TorqueGeneratedJSTemporalPlainMonthDay<JSTemporalPlainMonthDay, 2711cb0ef41Sopenharmony_ci JSObject> { 2721cb0ef41Sopenharmony_ci public: 2731cb0ef41Sopenharmony_ci // ##sec-temporal.plainmonthday 2741cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainMonthDay> Constructor( 2751cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSFunction> target, 2761cb0ef41Sopenharmony_ci Handle<HeapObject> new_target, Handle<Object> iso_month, 2771cb0ef41Sopenharmony_ci Handle<Object> iso_day, Handle<Object> calendar_like, 2781cb0ef41Sopenharmony_ci Handle<Object> reference_iso_year); 2791cb0ef41Sopenharmony_ci 2801cb0ef41Sopenharmony_ci // #sec-temporal.plainmonthday.prototype.getisofields 2811cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSReceiver> GetISOFields( 2821cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalPlainMonthDay> month_day); 2831cb0ef41Sopenharmony_ci 2841cb0ef41Sopenharmony_ci DECL_PRINTER(JSTemporalPlainMonthDay) 2851cb0ef41Sopenharmony_ci 2861cb0ef41Sopenharmony_ci DEFINE_TORQUE_GENERATED_JS_TEMPORAL_YEAR_MONTH_DAY() 2871cb0ef41Sopenharmony_ci 2881cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_DATE_INLINE_GETTER_SETTER() 2891cb0ef41Sopenharmony_ci 2901cb0ef41Sopenharmony_ci TQ_OBJECT_CONSTRUCTORS(JSTemporalPlainMonthDay) 2911cb0ef41Sopenharmony_ci}; 2921cb0ef41Sopenharmony_ci 2931cb0ef41Sopenharmony_ciclass JSTemporalPlainTime 2941cb0ef41Sopenharmony_ci : public TorqueGeneratedJSTemporalPlainTime<JSTemporalPlainTime, JSObject> { 2951cb0ef41Sopenharmony_ci public: 2961cb0ef41Sopenharmony_ci // #sec-temporal-plaintime-constructor 2971cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainTime> Constructor( 2981cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSFunction> target, 2991cb0ef41Sopenharmony_ci Handle<HeapObject> new_target, Handle<Object> hour, Handle<Object> minute, 3001cb0ef41Sopenharmony_ci Handle<Object> second, Handle<Object> millisecond, 3011cb0ef41Sopenharmony_ci Handle<Object> microsecond, Handle<Object> nanosecond); 3021cb0ef41Sopenharmony_ci 3031cb0ef41Sopenharmony_ci // #sec-temporal.plaintime.from 3041cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainTime> From( 3051cb0ef41Sopenharmony_ci Isolate* isolate, Handle<Object> item, Handle<Object> options); 3061cb0ef41Sopenharmony_ci 3071cb0ef41Sopenharmony_ci // #sec-temporal.plaintime.prototype.getisofields 3081cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSReceiver> GetISOFields( 3091cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalPlainTime> plain_time); 3101cb0ef41Sopenharmony_ci 3111cb0ef41Sopenharmony_ci // #sec-temporal.now.plaintimeiso 3121cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainTime> NowISO( 3131cb0ef41Sopenharmony_ci Isolate* isolate, Handle<Object> temporal_time_zone_like); 3141cb0ef41Sopenharmony_ci 3151cb0ef41Sopenharmony_ci DECL_PRINTER(JSTemporalPlainTime) 3161cb0ef41Sopenharmony_ci 3171cb0ef41Sopenharmony_ci DEFINE_TORQUE_GENERATED_JS_TEMPORAL_HOUR_MINUTE_SECOND() 3181cb0ef41Sopenharmony_ci DEFINE_TORQUE_GENERATED_JS_TEMPORAL_SECOND_PARTS() 3191cb0ef41Sopenharmony_ci 3201cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_TIME_INLINE_GETTER_SETTER() 3211cb0ef41Sopenharmony_ci 3221cb0ef41Sopenharmony_ci TQ_OBJECT_CONSTRUCTORS(JSTemporalPlainTime) 3231cb0ef41Sopenharmony_ci}; 3241cb0ef41Sopenharmony_ci 3251cb0ef41Sopenharmony_ciclass JSTemporalPlainYearMonth 3261cb0ef41Sopenharmony_ci : public TorqueGeneratedJSTemporalPlainYearMonth<JSTemporalPlainYearMonth, 3271cb0ef41Sopenharmony_ci JSObject> { 3281cb0ef41Sopenharmony_ci public: 3291cb0ef41Sopenharmony_ci // ##sec-temporal.plainyearmonth 3301cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainYearMonth> 3311cb0ef41Sopenharmony_ci Constructor(Isolate* isolate, Handle<JSFunction> target, 3321cb0ef41Sopenharmony_ci Handle<HeapObject> new_target, Handle<Object> iso_year, 3331cb0ef41Sopenharmony_ci Handle<Object> iso_month, Handle<Object> calendar_like, 3341cb0ef41Sopenharmony_ci Handle<Object> reference_iso_day); 3351cb0ef41Sopenharmony_ci 3361cb0ef41Sopenharmony_ci // #sec-temporal.plainyearmonth.prototype.getisofields 3371cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSReceiver> GetISOFields( 3381cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalPlainYearMonth> year_month); 3391cb0ef41Sopenharmony_ci 3401cb0ef41Sopenharmony_ci // Abstract Operations 3411cb0ef41Sopenharmony_ci 3421cb0ef41Sopenharmony_ci DECL_PRINTER(JSTemporalPlainYearMonth) 3431cb0ef41Sopenharmony_ci 3441cb0ef41Sopenharmony_ci DEFINE_TORQUE_GENERATED_JS_TEMPORAL_YEAR_MONTH_DAY() 3451cb0ef41Sopenharmony_ci 3461cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_DATE_INLINE_GETTER_SETTER() 3471cb0ef41Sopenharmony_ci 3481cb0ef41Sopenharmony_ci TQ_OBJECT_CONSTRUCTORS(JSTemporalPlainYearMonth) 3491cb0ef41Sopenharmony_ci}; 3501cb0ef41Sopenharmony_ci 3511cb0ef41Sopenharmony_ciclass JSTemporalTimeZone 3521cb0ef41Sopenharmony_ci : public TorqueGeneratedJSTemporalTimeZone<JSTemporalTimeZone, JSObject> { 3531cb0ef41Sopenharmony_ci public: 3541cb0ef41Sopenharmony_ci // #sec-temporal.now.timezone 3551cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalTimeZone> Now( 3561cb0ef41Sopenharmony_ci Isolate* isolate); 3571cb0ef41Sopenharmony_ci 3581cb0ef41Sopenharmony_ci // #sec-temporal.timezone 3591cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalTimeZone> Constructor( 3601cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSFunction> target, 3611cb0ef41Sopenharmony_ci Handle<HeapObject> new_target, Handle<Object> identifier); 3621cb0ef41Sopenharmony_ci 3631cb0ef41Sopenharmony_ci // #sec-temporal.timezone.prototype.tostring 3641cb0ef41Sopenharmony_ci static MaybeHandle<Object> ToString(Isolate* isolate, 3651cb0ef41Sopenharmony_ci Handle<JSTemporalTimeZone> time_zone, 3661cb0ef41Sopenharmony_ci const char* method); 3671cb0ef41Sopenharmony_ci 3681cb0ef41Sopenharmony_ci DECL_PRINTER(JSTemporalTimeZone) 3691cb0ef41Sopenharmony_ci 3701cb0ef41Sopenharmony_ci DEFINE_TORQUE_GENERATED_JS_TEMPORAL_TIME_ZONE_FLAGS() 3711cb0ef41Sopenharmony_ci DEFINE_TORQUE_GENERATED_JS_TEMPORAL_TIME_ZONE_SUB_MILLISECONDS() 3721cb0ef41Sopenharmony_ci 3731cb0ef41Sopenharmony_ci DECL_BOOLEAN_ACCESSORS(is_offset) 3741cb0ef41Sopenharmony_ci DECL_INT_ACCESSORS(offset_milliseconds_or_time_zone_index) 3751cb0ef41Sopenharmony_ci 3761cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_INLINE_GETTER_SETTER(offset_milliseconds) 3771cb0ef41Sopenharmony_ci DECLARE_TEMPORAL_INLINE_GETTER_SETTER(offset_sub_milliseconds) 3781cb0ef41Sopenharmony_ci 3791cb0ef41Sopenharmony_ci int32_t time_zone_index() const; 3801cb0ef41Sopenharmony_ci int64_t offset_nanoseconds() const; 3811cb0ef41Sopenharmony_ci void set_offset_nanoseconds(int64_t offset_nanoseconds); 3821cb0ef41Sopenharmony_ci 3831cb0ef41Sopenharmony_ci MaybeHandle<String> id(Isolate* isolate) const; 3841cb0ef41Sopenharmony_ci 3851cb0ef41Sopenharmony_ci TQ_OBJECT_CONSTRUCTORS(JSTemporalTimeZone) 3861cb0ef41Sopenharmony_ci}; 3871cb0ef41Sopenharmony_ci 3881cb0ef41Sopenharmony_ciclass JSTemporalZonedDateTime 3891cb0ef41Sopenharmony_ci : public TorqueGeneratedJSTemporalZonedDateTime<JSTemporalZonedDateTime, 3901cb0ef41Sopenharmony_ci JSObject> { 3911cb0ef41Sopenharmony_ci public: 3921cb0ef41Sopenharmony_ci // #sec-temporal.zoneddatetime 3931cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalZonedDateTime> Constructor( 3941cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSFunction> target, 3951cb0ef41Sopenharmony_ci Handle<HeapObject> new_target, Handle<Object> epoch_nanoseconds, 3961cb0ef41Sopenharmony_ci Handle<Object> time_zone_like, Handle<Object> calendar_like); 3971cb0ef41Sopenharmony_ci 3981cb0ef41Sopenharmony_ci // #sec-temporal.zoneddatetime.prototype.withcalendar 3991cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalZonedDateTime> 4001cb0ef41Sopenharmony_ci WithCalendar(Isolate* isolate, 4011cb0ef41Sopenharmony_ci Handle<JSTemporalZonedDateTime> zoned_date_time, 4021cb0ef41Sopenharmony_ci Handle<Object> calendar_like); 4031cb0ef41Sopenharmony_ci 4041cb0ef41Sopenharmony_ci // #sec-temporal.zoneddatetime.prototype.withtimezone 4051cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalZonedDateTime> 4061cb0ef41Sopenharmony_ci WithTimeZone(Isolate* isolate, 4071cb0ef41Sopenharmony_ci Handle<JSTemporalZonedDateTime> zoned_date_time, 4081cb0ef41Sopenharmony_ci Handle<Object> time_zone_like); 4091cb0ef41Sopenharmony_ci 4101cb0ef41Sopenharmony_ci // #sec-temporal.zoneddatetime.prototype.getisofields 4111cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSReceiver> GetISOFields( 4121cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSTemporalZonedDateTime> zoned_date_time); 4131cb0ef41Sopenharmony_ci 4141cb0ef41Sopenharmony_ci // #sec-temporal.zoneddatetime.prototype.toplainyearmonth 4151cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainYearMonth> 4161cb0ef41Sopenharmony_ci ToPlainYearMonth(Isolate* isolate, 4171cb0ef41Sopenharmony_ci Handle<JSTemporalZonedDateTime> zoned_date_time); 4181cb0ef41Sopenharmony_ci 4191cb0ef41Sopenharmony_ci // #sec-temporal.zoneddatetime.prototype.toplainmonthday 4201cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalPlainMonthDay> 4211cb0ef41Sopenharmony_ci ToPlainMonthDay(Isolate* isolate, 4221cb0ef41Sopenharmony_ci Handle<JSTemporalZonedDateTime> zoned_date_time); 4231cb0ef41Sopenharmony_ci 4241cb0ef41Sopenharmony_ci // #sec-temporal.now.zoneddatetime 4251cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalZonedDateTime> Now( 4261cb0ef41Sopenharmony_ci Isolate* isolate, Handle<Object> calendar_like, 4271cb0ef41Sopenharmony_ci Handle<Object> temporal_time_zone_like); 4281cb0ef41Sopenharmony_ci 4291cb0ef41Sopenharmony_ci // #sec-temporal.now.zoneddatetimeiso 4301cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT static MaybeHandle<JSTemporalZonedDateTime> NowISO( 4311cb0ef41Sopenharmony_ci Isolate* isolate, Handle<Object> temporal_time_zone_like); 4321cb0ef41Sopenharmony_ci 4331cb0ef41Sopenharmony_ci DECL_PRINTER(JSTemporalZonedDateTime) 4341cb0ef41Sopenharmony_ci 4351cb0ef41Sopenharmony_ci TQ_OBJECT_CONSTRUCTORS(JSTemporalZonedDateTime) 4361cb0ef41Sopenharmony_ci}; 4371cb0ef41Sopenharmony_ci 4381cb0ef41Sopenharmony_cinamespace temporal { 4391cb0ef41Sopenharmony_ci 4401cb0ef41Sopenharmony_ci// #sec-temporal-createtemporalinstant 4411cb0ef41Sopenharmony_ciV8_WARN_UNUSED_RESULT MaybeHandle<JSTemporalInstant> CreateTemporalInstant( 4421cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSFunction> target, Handle<HeapObject> new_target, 4431cb0ef41Sopenharmony_ci Handle<BigInt> epoch_nanoseconds); 4441cb0ef41Sopenharmony_ciV8_WARN_UNUSED_RESULT MaybeHandle<JSTemporalInstant> CreateTemporalInstant( 4451cb0ef41Sopenharmony_ci Isolate* isolate, Handle<BigInt> epoch_nanoseconds); 4461cb0ef41Sopenharmony_ci 4471cb0ef41Sopenharmony_ci// #sec-temporal-calendaryear 4481cb0ef41Sopenharmony_ci#define DECLARE_CALENDAR_ABSTRACT_OPERATION(Name) \ 4491cb0ef41Sopenharmony_ci V8_WARN_UNUSED_RESULT MaybeHandle<Object> Calendar##Name( \ 4501cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSReceiver> calendar, \ 4511cb0ef41Sopenharmony_ci Handle<JSReceiver> date_like); 4521cb0ef41Sopenharmony_ciDECLARE_CALENDAR_ABSTRACT_OPERATION(Year) 4531cb0ef41Sopenharmony_ciDECLARE_CALENDAR_ABSTRACT_OPERATION(Month) 4541cb0ef41Sopenharmony_ciDECLARE_CALENDAR_ABSTRACT_OPERATION(MonthCode) 4551cb0ef41Sopenharmony_ciDECLARE_CALENDAR_ABSTRACT_OPERATION(Day) 4561cb0ef41Sopenharmony_ci 4571cb0ef41Sopenharmony_ci#ifdef V8_INTL_SUPPORT 4581cb0ef41Sopenharmony_ciDECLARE_CALENDAR_ABSTRACT_OPERATION(Era) 4591cb0ef41Sopenharmony_ciDECLARE_CALENDAR_ABSTRACT_OPERATION(EraYear) 4601cb0ef41Sopenharmony_ci#endif // V8_INTL_SUPPORT 4611cb0ef41Sopenharmony_ci 4621cb0ef41Sopenharmony_ci#undef DECLARE_CALENDAR_ABSTRACT_OPERATION 4631cb0ef41Sopenharmony_ci 4641cb0ef41Sopenharmony_ci// #sec-temporal-getiso8601calendar 4651cb0ef41Sopenharmony_ciV8_WARN_UNUSED_RESULT MaybeHandle<JSTemporalCalendar> GetISO8601Calendar( 4661cb0ef41Sopenharmony_ci Isolate* isolate); 4671cb0ef41Sopenharmony_ci 4681cb0ef41Sopenharmony_ci// #sec-temporal-builtintimezonegetplaindatetimefor 4691cb0ef41Sopenharmony_ciV8_WARN_UNUSED_RESULT MaybeHandle<JSTemporalPlainDateTime> 4701cb0ef41Sopenharmony_ciBuiltinTimeZoneGetPlainDateTimeFor(Isolate* isolate, 4711cb0ef41Sopenharmony_ci Handle<JSReceiver> time_zone, 4721cb0ef41Sopenharmony_ci Handle<JSTemporalInstant> instant, 4731cb0ef41Sopenharmony_ci Handle<JSReceiver> calendar, 4741cb0ef41Sopenharmony_ci const char* method); 4751cb0ef41Sopenharmony_ci 4761cb0ef41Sopenharmony_ciV8_WARN_UNUSED_RESULT MaybeHandle<Object> InvokeCalendarMethod( 4771cb0ef41Sopenharmony_ci Isolate* isolate, Handle<JSReceiver> calendar, Handle<String> name, 4781cb0ef41Sopenharmony_ci Handle<JSReceiver> temporal_like); 4791cb0ef41Sopenharmony_ci 4801cb0ef41Sopenharmony_ciV8_WARN_UNUSED_RESULT MaybeHandle<JSReceiver> ToTemporalCalendar( 4811cb0ef41Sopenharmony_ci Isolate* isolate, Handle<Object> temporal_calendar_like, 4821cb0ef41Sopenharmony_ci const char* method); 4831cb0ef41Sopenharmony_ci 4841cb0ef41Sopenharmony_ciV8_WARN_UNUSED_RESULT MaybeHandle<JSReceiver> ToTemporalTimeZone( 4851cb0ef41Sopenharmony_ci Isolate* isolate, Handle<Object> temporal_time_zone_like, 4861cb0ef41Sopenharmony_ci const char* method); 4871cb0ef41Sopenharmony_ci 4881cb0ef41Sopenharmony_ci} // namespace temporal 4891cb0ef41Sopenharmony_ci} // namespace internal 4901cb0ef41Sopenharmony_ci} // namespace v8 4911cb0ef41Sopenharmony_ci#include "src/objects/object-macros-undef.h" 4921cb0ef41Sopenharmony_ci#endif // V8_OBJECTS_JS_TEMPORAL_OBJECTS_H_ 493