13#define TO_BE_IMPLEMENTED(id) \
14 BUILTIN_NO_RCS(id) { \
15 HandleScope scope(isolate); \
19#define TEMPORAL_NOW0(T) \
20 BUILTIN(TemporalNow##T) { \
21 HandleScope scope(isolate); \
22 RETURN_RESULT_OR_FAILURE(isolate, JSTemporal##T::Now(isolate)); \
25#define TEMPORAL_NOW2(T) \
26 BUILTIN(TemporalNow##T) { \
27 HandleScope scope(isolate); \
28 RETURN_RESULT_OR_FAILURE( \
29 isolate, JSTemporal##T::Now(isolate, args.atOrUndefined(isolate, 1), \
30 args.atOrUndefined(isolate, 2))); \
33#define TEMPORAL_NOW_ISO1(T) \
34 BUILTIN(TemporalNow##T##ISO) { \
35 HandleScope scope(isolate); \
36 RETURN_RESULT_OR_FAILURE( \
38 JSTemporal##T::NowISO(isolate, args.atOrUndefined(isolate, 1))); \
41#define TEMPORAL_CONSTRUCTOR1(T) \
42 BUILTIN(Temporal##T##Constructor) { \
43 HandleScope scope(isolate); \
44 RETURN_RESULT_OR_FAILURE( \
46 JSTemporal##T::Constructor(isolate, args.target(), args.new_target(), \
47 args.atOrUndefined(isolate, 1))); \
50#define TEMPORAL_PROTOTYPE_METHOD0(T, METHOD, name) \
51 BUILTIN(Temporal##T##Prototype##METHOD) { \
52 HandleScope scope(isolate); \
53 CHECK_RECEIVER(JSTemporal##T, obj, "Temporal." #T ".prototype." #name); \
54 RETURN_RESULT_OR_FAILURE(isolate, JSTemporal##T ::METHOD(isolate, obj)); \
57#define TEMPORAL_PROTOTYPE_METHOD1(T, METHOD, name) \
58 BUILTIN(Temporal##T##Prototype##METHOD) { \
59 HandleScope scope(isolate); \
60 CHECK_RECEIVER(JSTemporal##T, obj, "Temporal." #T ".prototype." #name); \
61 RETURN_RESULT_OR_FAILURE( \
63 JSTemporal##T ::METHOD(isolate, obj, args.atOrUndefined(isolate, 1))); \
66#define TEMPORAL_PROTOTYPE_METHOD2(T, METHOD, name) \
67 BUILTIN(Temporal##T##Prototype##METHOD) { \
68 HandleScope scope(isolate); \
69 CHECK_RECEIVER(JSTemporal##T, obj, "Temporal." #T ".prototype." #name); \
70 RETURN_RESULT_OR_FAILURE( \
72 JSTemporal##T ::METHOD(isolate, obj, args.atOrUndefined(isolate, 1), \
73 args.atOrUndefined(isolate, 2))); \
76#define TEMPORAL_PROTOTYPE_METHOD3(T, METHOD, name) \
77 BUILTIN(Temporal##T##Prototype##METHOD) { \
78 HandleScope scope(isolate); \
79 CHECK_RECEIVER(JSTemporal##T, obj, "Temporal." #T ".prototype." #name); \
80 RETURN_RESULT_OR_FAILURE( \
82 JSTemporal##T ::METHOD(isolate, obj, args.atOrUndefined(isolate, 1), \
83 args.atOrUndefined(isolate, 2), \
84 args.atOrUndefined(isolate, 3))); \
87#define TEMPORAL_METHOD1(T, METHOD) \
88 BUILTIN(Temporal##T##METHOD) { \
89 HandleScope scope(isolate); \
90 RETURN_RESULT_OR_FAILURE( \
92 JSTemporal##T ::METHOD(isolate, args.atOrUndefined(isolate, 1))); \
95#define TEMPORAL_METHOD2(T, METHOD) \
96 BUILTIN(Temporal##T##METHOD) { \
97 HandleScope scope(isolate); \
98 RETURN_RESULT_OR_FAILURE( \
100 JSTemporal##T ::METHOD(isolate, args.atOrUndefined(isolate, 1), \
101 args.atOrUndefined(isolate, 2))); \
104#define TEMPORAL_VALUE_OF(T) \
105 BUILTIN(Temporal##T##PrototypeValueOf) { \
106 HandleScope scope(isolate); \
107 THROW_NEW_ERROR_RETURN_FAILURE( \
108 isolate, NewTypeError(MessageTemplate::kDoNotUse, \
109 isolate->factory()->NewStringFromAsciiChecked( \
110 "Temporal." #T ".prototype.valueOf"), \
111 isolate->factory()->NewStringFromAsciiChecked( \
113 ".prototype.compare for comparison."))); \
116#define TEMPORAL_GET_SMI(T, METHOD, field) \
117 BUILTIN(Temporal##T##Prototype##METHOD) { \
118 HandleScope scope(isolate); \
119 CHECK_RECEIVER(JSTemporal##T, obj, \
120 "get Temporal." #T ".prototype." #field); \
121 return Smi::FromInt(obj->field()); \
124#define TEMPORAL_METHOD1(T, METHOD) \
125 BUILTIN(Temporal##T##METHOD) { \
126 HandleScope scope(isolate); \
127 RETURN_RESULT_OR_FAILURE( \
129 JSTemporal##T ::METHOD(isolate, args.atOrUndefined(isolate, 1))); \
132#define TEMPORAL_METHOD2(T, METHOD) \
133 BUILTIN(Temporal##T##METHOD) { \
134 HandleScope scope(isolate); \
135 RETURN_RESULT_OR_FAILURE( \
137 JSTemporal##T ::METHOD(isolate, args.atOrUndefined(isolate, 1), \
138 args.atOrUndefined(isolate, 2))); \
141#define TEMPORAL_GET(T, METHOD, field) \
142 BUILTIN(Temporal##T##Prototype##METHOD) { \
143 HandleScope scope(isolate); \
144 CHECK_RECEIVER(JSTemporal##T, obj, "Temporal." #T ".prototype." #field); \
145 return obj->field(); \
148#define TEMPORAL_GET_NUMBER_AFTER_DIVID(T, M, field, scale, name) \
149 BUILTIN(Temporal##T##Prototype##M) { \
150 HandleScope scope(isolate); \
151 CHECK_RECEIVER(JSTemporal##T, handle, \
152 "get Temporal." #T ".prototype." #name); \
153 DirectHandle<BigInt> value; \
154 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( \
156 BigInt::Divide(isolate, direct_handle(handle->field(), isolate), \
157 BigInt::FromUint64(isolate, scale))); \
158 DirectHandle<Object> number = BigInt::ToNumber(isolate, value); \
159 DCHECK(std::isfinite(Object::NumberValue(*number))); \
163#define TEMPORAL_GET_BIGINT_AFTER_DIVID(T, M, field, scale, name) \
164 BUILTIN(Temporal##T##Prototype##M) { \
165 HandleScope scope(isolate); \
166 CHECK_RECEIVER(JSTemporal##T, handle, \
167 "get Temporal." #T ".prototype." #name); \
168 RETURN_RESULT_OR_FAILURE( \
170 BigInt::Divide(isolate, direct_handle(handle->field(), isolate), \
171 BigInt::FromUint64(isolate, scale))); \
174#define TEMPORAL_GET_BY_FORWARD_CALENDAR(T, METHOD, name) \
175 BUILTIN(Temporal##T##Prototype##METHOD) { \
176 HandleScope scope(isolate); \
177 CHECK_RECEIVER(JSTemporal##T, temporal_date, \
178 "get Temporal." #T ".prototype." #name); \
179 RETURN_RESULT_OR_FAILURE( \
181 temporal::Calendar##METHOD( \
182 isolate, direct_handle(temporal_date->calendar(), isolate), \
186#define TEMPORAL_GET_BY_INVOKE_CALENDAR_METHOD(T, METHOD, name) \
187 BUILTIN(Temporal##T##Prototype##METHOD) { \
188 HandleScope scope(isolate); \
191 CHECK_RECEIVER(JSTemporal##T, date_like, \
192 "get Temporal." #T ".prototype." #name); \
194 DirectHandle<JSReceiver> calendar(date_like->calendar(), isolate); \
196 RETURN_RESULT_OR_FAILURE( \
197 isolate, temporal::InvokeCalendarMethod( \
198 isolate, calendar, isolate->factory()->name##_string(), \
221 isolate,
args.target(),
args.new_target(),
222 args.atOrUndefined(isolate, 1),
223 args.atOrUndefined(isolate, 2),
224 args.atOrUndefined(isolate, 3),
225 args.atOrUndefined(isolate, 4)));
264 isolate,
args.target(),
args.new_target(),
265 args.atOrUndefined(isolate, 1),
266 args.atOrUndefined(isolate, 2),
267 args.atOrUndefined(isolate, 3),
268 args.atOrUndefined(isolate, 4),
269 args.atOrUndefined(isolate, 5),
270 args.atOrUndefined(isolate, 6)));
301 isolate,
args.target(),
args.new_target(),
302 args.atOrUndefined(isolate, 1),
303 args.atOrUndefined(isolate, 2),
304 args.atOrUndefined(isolate, 3),
305 args.atOrUndefined(isolate, 4),
306 args.atOrUndefined(isolate, 5),
307 args.atOrUndefined(isolate, 6),
308 args.atOrUndefined(isolate, 7),
309 args.atOrUndefined(isolate, 8),
310 args.atOrUndefined(isolate, 9),
311 args.atOrUndefined(isolate, 10)));
357BUILTIN(TemporalPlainYearMonthConstructor) {
361 isolate,
args.target(),
args.new_target(),
362 args.atOrUndefined(isolate, 1),
363 args.atOrUndefined(isolate, 2),
364 args.atOrUndefined(isolate, 3),
365 args.atOrUndefined(isolate, 4)));
392BUILTIN(TemporalPlainMonthDayConstructor) {
396 isolate,
args.target(),
args.new_target(),
397 args.atOrUndefined(isolate, 1),
398 args.atOrUndefined(isolate, 2),
399 args.atOrUndefined(isolate, 3),
400 args.atOrUndefined(isolate, 4)));
417#define TEMPORAL_ZONED_DATE_TIME_GET_PREPARE(M) \
418 HandleScope scope(isolate); \
419 const char* method_name = "get Temporal.ZonedDateTime.prototype." #M; \
423 CHECK_RECEIVER(JSTemporalZonedDateTime, zoned_date_time, method_name); \
425 DirectHandle<JSReceiver> time_zone(zoned_date_time->time_zone(), isolate); \
428 DirectHandle<JSTemporalInstant> instant; \
429 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( \
431 temporal::CreateTemporalInstant( \
432 isolate, direct_handle(zoned_date_time->nanoseconds(), isolate))); \
434 DirectHandle<JSReceiver> calendar(zoned_date_time->calendar(), isolate); \
438 DirectHandle<JSTemporalPlainDateTime> temporal_date_time; \
439 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( \
440 isolate, temporal_date_time, \
441 temporal::BuiltinTimeZoneGetPlainDateTimeFor( \
442 isolate, time_zone, instant, calendar, method_name));
444#define TEMPORAL_ZONED_DATE_TIME_GET_BY_FORWARD_TIME_ZONE_AND_CALENDAR(M) \
445 BUILTIN(TemporalZonedDateTimePrototype##M) { \
446 TEMPORAL_ZONED_DATE_TIME_GET_PREPARE(M) \
448 RETURN_RESULT_OR_FAILURE( \
450 temporal::Calendar##M(isolate, calendar, temporal_date_time)); \
453#define TEMPORAL_ZONED_DATE_TIME_GET_INT_BY_FORWARD_TIME_ZONE(M, field) \
454 BUILTIN(TemporalZonedDateTimePrototype##M) { \
455 TEMPORAL_ZONED_DATE_TIME_GET_PREPARE(M) \
457 return Smi::FromInt(temporal_date_time->field()); \
464 isolate,
args.target(),
args.new_target(),
465 args.atOrUndefined(isolate, 1),
466 args.atOrUndefined(isolate, 2),
467 args.atOrUndefined(isolate, 3)));
479 1000000000, epochSeconds)
481 1000000, epochMilliseconds)
483 1000, epochMicroseconds)
533 isolate,
args.target(),
args.new_target(),
534 args.atOrUndefined(isolate, 1),
535 args.atOrUndefined(isolate, 2),
536 args.atOrUndefined(isolate, 3),
537 args.atOrUndefined(isolate, 4),
538 args.atOrUndefined(isolate, 5),
539 args.atOrUndefined(isolate, 6),
540 args.atOrUndefined(isolate, 7),
541 args.atOrUndefined(isolate, 8),
542 args.atOrUndefined(isolate, 9),
543 args.atOrUndefined(isolate, 10)));
549 isolate,
args.atOrUndefined(isolate, 1),
550 args.atOrUndefined(isolate, 2),
551 args.atOrUndefined(isolate, 3)));
592 1000000, epochMilliseconds)
610BUILTIN(TemporalCalendarPrototypeId) {
616 "Temporal.Calendar.prototype.id");
628 "Temporal.Calendar.prototype.toJSON");
636 const char* method_name =
"Temporal.Calendar.prototype.toString";
668 isolate,
args.atOrUndefined(isolate, 1),
669 "Temporal.Calendar.from"));
677 getOffsetNanosecondsFor)
681 getPossibleInstantFor)
683 getPreviousTransition)
686BUILTIN(TemporalTimeZonePrototypeId) {
692 "Temporal.TimeZone.prototype.id");
704 "Temporal.TimeZone.prototype.toJSON");
712 const char* method_name =
"Temporal.TimeZone.prototype.toString";
726 isolate,
args.atOrUndefined(isolate, 1),
727 "Temporal.TimeZone.from"));
730#ifdef V8_INTL_SUPPORT
#define TEMPORAL_METHOD1(T, METHOD)
#define TEMPORAL_ZONED_DATE_TIME_GET_INT_BY_FORWARD_TIME_ZONE(M, field)
#define TEMPORAL_CONSTRUCTOR1(T)
#define TEMPORAL_VALUE_OF(T)
#define TEMPORAL_METHOD2(T, METHOD)
#define TEMPORAL_GET(T, METHOD, field)
#define TEMPORAL_GET_BY_FORWARD_CALENDAR(T, METHOD, name)
#define TEMPORAL_PROTOTYPE_METHOD0(T, METHOD, name)
#define TEMPORAL_GET_NUMBER_AFTER_DIVID(T, M, field, scale, name)
#define TEMPORAL_GET_BY_INVOKE_CALENDAR_METHOD(T, METHOD, name)
#define TEMPORAL_NOW_ISO1(T)
#define TEMPORAL_ZONED_DATE_TIME_GET_BY_FORWARD_TIME_ZONE_AND_CALENDAR(M)
#define TEMPORAL_PROTOTYPE_METHOD1(T, METHOD, name)
#define TEMPORAL_PROTOTYPE_METHOD2(T, METHOD, name)
#define TEMPORAL_GET_BIGINT_AFTER_DIVID(T, M, field, scale, name)
#define TEMPORAL_GET_SMI(T, METHOD, field)
#define TEMPORAL_PROTOTYPE_METHOD3(T, METHOD, name)
#define CHECK_RECEIVER(Type, name, method)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< String > ToString(Isolate *isolate, DirectHandle< JSTemporalCalendar > calendar, const char *method_name)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< JSTemporalDuration > Constructor(Isolate *isolate, DirectHandle< JSFunction > target, DirectHandle< HeapObject > new_target, DirectHandle< Object > years, DirectHandle< Object > months, DirectHandle< Object > weeks, DirectHandle< Object > days, DirectHandle< Object > hours, DirectHandle< Object > minutes, DirectHandle< Object > seconds, DirectHandle< Object > milliseconds, DirectHandle< Object > microseconds, DirectHandle< Object > nanoseconds)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< Smi > Compare(Isolate *isolate, DirectHandle< Object > one, DirectHandle< Object > two, DirectHandle< Object > options)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< JSTemporalPlainDateTime > Constructor(Isolate *isolate, DirectHandle< JSFunction > target, DirectHandle< HeapObject > new_target, DirectHandle< Object > iso_year, DirectHandle< Object > iso_month, DirectHandle< Object > iso_day, DirectHandle< Object > hour, DirectHandle< Object > minute, DirectHandle< Object > second, DirectHandle< Object > millisecond, DirectHandle< Object > microsecond, DirectHandle< Object > nanosecond, DirectHandle< Object > calendar_like)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< JSTemporalPlainDate > Constructor(Isolate *isolate, DirectHandle< JSFunction > target, DirectHandle< HeapObject > new_target, DirectHandle< Object > iso_year, DirectHandle< Object > iso_month, DirectHandle< Object > iso_day, DirectHandle< Object > calendar_like)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< JSTemporalPlainMonthDay > Constructor(Isolate *isolate, DirectHandle< JSFunction > target, DirectHandle< HeapObject > new_target, DirectHandle< Object > iso_month, DirectHandle< Object > iso_day, DirectHandle< Object > calendar_like, DirectHandle< Object > reference_iso_year)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< JSTemporalPlainTime > Constructor(Isolate *isolate, DirectHandle< JSFunction > target, DirectHandle< HeapObject > new_target, DirectHandle< Object > hour, DirectHandle< Object > minute, DirectHandle< Object > second, DirectHandle< Object > millisecond, DirectHandle< Object > microsecond, DirectHandle< Object > nanosecond)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< JSTemporalPlainYearMonth > Constructor(Isolate *isolate, DirectHandle< JSFunction > target, DirectHandle< HeapObject > new_target, DirectHandle< Object > iso_year, DirectHandle< Object > iso_month, DirectHandle< Object > calendar_like, DirectHandle< Object > reference_iso_day)
static MaybeDirectHandle< Object > ToString(Isolate *isolate, DirectHandle< JSTemporalTimeZone > time_zone, const char *method_name)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< JSTemporalZonedDateTime > Constructor(Isolate *isolate, DirectHandle< JSFunction > target, DirectHandle< HeapObject > new_target, DirectHandle< Object > epoch_nanoseconds, DirectHandle< Object > time_zone_like, DirectHandle< Object > calendar_like)
static V8_WARN_UNUSED_RESULT HandleType< String >::MaybeType ToString(Isolate *isolate, HandleType< T > input)
#define RETURN_RESULT_OR_FAILURE(isolate, call)
base::Vector< const DirectHandle< Object > > args
DirectHandle< Object > calendar
MaybeDirectHandle< JSReceiver > ToTemporalCalendar(Isolate *isolate, DirectHandle< Object > temporal_calendar_like, const char *method_name)
MaybeDirectHandle< JSReceiver > ToTemporalTimeZone(Isolate *isolate, DirectHandle< Object > temporal_time_zone_like, const char *method_name)
constexpr const char * ToString(DeoptimizeKind kind)
std::make_unsigned< T >::type Abs(T a)
constexpr AddrMode Offset
int Compare(const T &a, const T &b)