v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
builtins-temporal.cc File Reference
Include dependency graph for builtins-temporal.cc:

Go to the source code of this file.

Namespaces

namespace  v8
 
namespace  v8::internal
 

Macros

#define TO_BE_IMPLEMENTED(id)
 
#define TEMPORAL_NOW0(T)
 
#define TEMPORAL_NOW2(T)
 
#define TEMPORAL_NOW_ISO1(T)
 
#define TEMPORAL_CONSTRUCTOR1(T)
 
#define TEMPORAL_PROTOTYPE_METHOD0(T, METHOD, name)
 
#define TEMPORAL_PROTOTYPE_METHOD1(T, METHOD, name)
 
#define TEMPORAL_PROTOTYPE_METHOD2(T, METHOD, name)
 
#define TEMPORAL_PROTOTYPE_METHOD3(T, METHOD, name)
 
#define TEMPORAL_METHOD1(T, METHOD)
 
#define TEMPORAL_METHOD2(T, METHOD)
 
#define TEMPORAL_VALUE_OF(T)
 
#define TEMPORAL_GET_SMI(T, METHOD, field)
 
#define TEMPORAL_METHOD1(T, METHOD)
 
#define TEMPORAL_METHOD2(T, METHOD)
 
#define TEMPORAL_GET(T, METHOD, field)
 
#define TEMPORAL_GET_NUMBER_AFTER_DIVID(T, M, field, scale, name)
 
#define TEMPORAL_GET_BIGINT_AFTER_DIVID(T, M, field, scale, name)
 
#define TEMPORAL_GET_BY_FORWARD_CALENDAR(T, METHOD, name)
 
#define TEMPORAL_GET_BY_INVOKE_CALENDAR_METHOD(T, METHOD, name)
 
#define TEMPORAL_ZONED_DATE_TIME_GET_PREPARE(M)
 
#define TEMPORAL_ZONED_DATE_TIME_GET_BY_FORWARD_TIME_ZONE_AND_CALENDAR(M)
 
#define TEMPORAL_ZONED_DATE_TIME_GET_INT_BY_FORWARD_TIME_ZONE(M, field)
 

Functions

 v8::internal::BUILTIN (TemporalPlainDateConstructor)
 
 v8::internal::BUILTIN (TemporalPlainTimeConstructor)
 
 v8::internal::BUILTIN (TemporalPlainDateTimeConstructor)
 
 v8::internal::TEMPORAL_GET_BY_INVOKE_CALENDAR_METHOD (PlainDateTime, MonthsInYear, monthsInYear) BUILTIN(TemporalPlainYearMonthConstructor)
 
 v8::internal::TEMPORAL_GET_BY_INVOKE_CALENDAR_METHOD (PlainYearMonth, MonthsInYear, monthsInYear) BUILTIN(TemporalPlainMonthDayConstructor)
 
 v8::internal::BUILTIN (TemporalZonedDateTimeConstructor)
 
 v8::internal::TEMPORAL_GET_NUMBER_AFTER_DIVID (ZonedDateTime, EpochSeconds, nanoseconds, 1000000000, epochSeconds) TEMPORAL_GET_NUMBER_AFTER_DIVID(ZonedDateTime
 
epochMilliseconds v8::internal::TEMPORAL_GET_BIGINT_AFTER_DIVID (ZonedDateTime, EpochMicroseconds, nanoseconds, 1000, epochMicroseconds) TEMPORAL_ZONED_DATE_TIME_GET_INT_BY_FORWARD_TIME_ZONE(Millisecond
 
epochMilliseconds iso_millisecond v8::internal::TEMPORAL_ZONED_DATE_TIME_GET_INT_BY_FORWARD_TIME_ZONE (Microsecond, iso_microsecond) TEMPORAL_ZONED_DATE_TIME_GET_INT_BY_FORWARD_TIME_ZONE(Nanosecond
 
epochMilliseconds iso_millisecond iso_nanosecond v8::internal::BUILTIN (TemporalDurationConstructor)
 
 v8::internal::BUILTIN (TemporalDurationCompare)
 
 v8::internal::TEMPORAL_GET_NUMBER_AFTER_DIVID (Instant, EpochSeconds, nanoseconds, 1000000000, epochSeconds) TEMPORAL_GET_NUMBER_AFTER_DIVID(Instant
 
epochMilliseconds v8::internal::TEMPORAL_GET_BIGINT_AFTER_DIVID (Instant, EpochMicroseconds, nanoseconds, 1000, epochMicroseconds) BUILTIN(TemporalCalendarPrototypeId)
 
 v8::internal::BUILTIN (TemporalCalendarPrototypeToJSON)
 
 v8::internal::BUILTIN (TemporalCalendarPrototypeToString)
 
 v8::internal::BUILTIN (TemporalCalendarFrom)
 
 v8::internal::TEMPORAL_PROTOTYPE_METHOD1 (TimeZone, GetOffsetNanosecondsFor, getOffsetNanosecondsFor) TEMPORAL_PROTOTYPE_METHOD1(TimeZone
 
getPossibleInstantFor v8::internal::TEMPORAL_PROTOTYPE_METHOD1 (TimeZone, GetPreviousTransition, getPreviousTransition) BUILTIN(TemporalTimeZonePrototypeId)
 
 v8::internal::BUILTIN (TemporalTimeZonePrototypeToJSON)
 
 v8::internal::BUILTIN (TemporalTimeZonePrototypeToString)
 
 v8::internal::BUILTIN (TemporalTimeZoneFrom)
 

Variables

 v8::internal::EpochMilliseconds
 
 v8::internal::nanoseconds
 
 v8::internal::GetPossibleInstantsFor
 

Macro Definition Documentation

◆ TEMPORAL_CONSTRUCTOR1

#define TEMPORAL_CONSTRUCTOR1 ( T)
Value:
BUILTIN(Temporal##T##Constructor) { \
HandleScope scope(isolate); \
RETURN_RESULT_OR_FAILURE( \
isolate, \
JSTemporal##T::Constructor(isolate, args.target(), args.new_target(), \
args.atOrUndefined(isolate, 1))); \
}
#define BUILTIN(name)
base::Vector< const DirectHandle< Object > > args
Definition execution.cc:74

Definition at line 41 of file builtins-temporal.cc.

◆ TEMPORAL_GET

#define TEMPORAL_GET ( T,
METHOD,
field )
Value:
BUILTIN(Temporal##T##Prototype##METHOD) { \
HandleScope scope(isolate); \
CHECK_RECEIVER(JSTemporal##T, obj, "Temporal." #T ".prototype." #field); \
return obj->field(); \
}

Definition at line 141 of file builtins-temporal.cc.

◆ TEMPORAL_GET_BIGINT_AFTER_DIVID

#define TEMPORAL_GET_BIGINT_AFTER_DIVID ( T,
M,
field,
scale,
name )
Value:
BUILTIN(Temporal##T##Prototype##M) { \
HandleScope scope(isolate); \
CHECK_RECEIVER(JSTemporal##T, handle, \
"get Temporal." #T ".prototype." #name); \
RETURN_RESULT_OR_FAILURE( \
isolate, \
BigInt::Divide(isolate, direct_handle(handle->field(), isolate), \
BigInt::FromUint64(isolate, scale))); \
}
interpreter::OperandScale scale
Definition builtins.cc:44

Definition at line 163 of file builtins-temporal.cc.

◆ TEMPORAL_GET_BY_FORWARD_CALENDAR

#define TEMPORAL_GET_BY_FORWARD_CALENDAR ( T,
METHOD,
name )
Value:
BUILTIN(Temporal##T##Prototype##METHOD) { \
HandleScope scope(isolate); \
CHECK_RECEIVER(JSTemporal##T, temporal_date, \
"get Temporal." #T ".prototype." #name); \
RETURN_RESULT_OR_FAILURE( \
isolate, \
temporal::Calendar##METHOD( \
isolate, direct_handle(temporal_date->calendar(), isolate), \
temporal_date)); \
}

Definition at line 174 of file builtins-temporal.cc.

◆ TEMPORAL_GET_BY_INVOKE_CALENDAR_METHOD

#define TEMPORAL_GET_BY_INVOKE_CALENDAR_METHOD ( T,
METHOD,
name )
Value:
BUILTIN(Temporal##T##Prototype##METHOD) { \
HandleScope scope(isolate); \
/* 2. Perform ? RequireInternalSlot(temporalDate, */ \
/* [[InitializedTemporal#T]]). */ \
CHECK_RECEIVER(JSTemporal##T, date_like, \
"get Temporal." #T ".prototype." #name); \
/* 3. Let calendar be temporalDate.[[Calendar]]. */ \
DirectHandle<JSReceiver> calendar(date_like->calendar(), isolate); \
/* 2. Return ? Invoke(calendar, "name", « dateLike »). */ \
RETURN_RESULT_OR_FAILURE( \
isolate, temporal::InvokeCalendarMethod( \
isolate, calendar, isolate->factory()->name##_string(), \
date_like)); \
}
DirectHandle< Object > calendar

Definition at line 186 of file builtins-temporal.cc.

◆ TEMPORAL_GET_NUMBER_AFTER_DIVID

#define TEMPORAL_GET_NUMBER_AFTER_DIVID ( T,
M,
field,
scale,
name )
Value:
BUILTIN(Temporal##T##Prototype##M) { \
HandleScope scope(isolate); \
CHECK_RECEIVER(JSTemporal##T, handle, \
"get Temporal." #T ".prototype." #name); \
DirectHandle<BigInt> value; \
ASSIGN_RETURN_FAILURE_ON_EXCEPTION( \
isolate, value, \
BigInt::Divide(isolate, direct_handle(handle->field(), isolate), \
BigInt::FromUint64(isolate, scale))); \
DirectHandle<Object> number = BigInt::ToNumber(isolate, value); \
DCHECK(std::isfinite(Object::NumberValue(*number))); \
return *number; \
}
std::unique_ptr< ValueMirror > value

Definition at line 148 of file builtins-temporal.cc.

◆ TEMPORAL_GET_SMI

#define TEMPORAL_GET_SMI ( T,
METHOD,
field )
Value:
BUILTIN(Temporal##T##Prototype##METHOD) { \
HandleScope scope(isolate); \
CHECK_RECEIVER(JSTemporal##T, obj, \
"get Temporal." #T ".prototype." #field); \
return Smi::FromInt(obj->field()); \
}

Definition at line 116 of file builtins-temporal.cc.

◆ TEMPORAL_METHOD1 [1/2]

#define TEMPORAL_METHOD1 ( T,
METHOD )
Value:
BUILTIN(Temporal##T##METHOD) { \
HandleScope scope(isolate); \
RETURN_RESULT_OR_FAILURE( \
isolate, \
JSTemporal##T ::METHOD(isolate, args.atOrUndefined(isolate, 1))); \
}

Definition at line 87 of file builtins-temporal.cc.

◆ TEMPORAL_METHOD1 [2/2]

#define TEMPORAL_METHOD1 ( T,
METHOD )
Value:
BUILTIN(Temporal##T##METHOD) { \
HandleScope scope(isolate); \
RETURN_RESULT_OR_FAILURE( \
isolate, \
JSTemporal##T ::METHOD(isolate, args.atOrUndefined(isolate, 1))); \
}

Definition at line 87 of file builtins-temporal.cc.

◆ TEMPORAL_METHOD2 [1/2]

#define TEMPORAL_METHOD2 ( T,
METHOD )
Value:
BUILTIN(Temporal##T##METHOD) { \
HandleScope scope(isolate); \
RETURN_RESULT_OR_FAILURE( \
isolate, \
JSTemporal##T ::METHOD(isolate, args.atOrUndefined(isolate, 1), \
args.atOrUndefined(isolate, 2))); \
}

Definition at line 95 of file builtins-temporal.cc.

◆ TEMPORAL_METHOD2 [2/2]

#define TEMPORAL_METHOD2 ( T,
METHOD )
Value:
BUILTIN(Temporal##T##METHOD) { \
HandleScope scope(isolate); \
RETURN_RESULT_OR_FAILURE( \
isolate, \
JSTemporal##T ::METHOD(isolate, args.atOrUndefined(isolate, 1), \
args.atOrUndefined(isolate, 2))); \
}

Definition at line 95 of file builtins-temporal.cc.

◆ TEMPORAL_NOW0

#define TEMPORAL_NOW0 ( T)
Value:
BUILTIN(TemporalNow##T) { \
HandleScope scope(isolate); \
RETURN_RESULT_OR_FAILURE(isolate, JSTemporal##T::Now(isolate)); \
}

Definition at line 19 of file builtins-temporal.cc.

◆ TEMPORAL_NOW2

#define TEMPORAL_NOW2 ( T)
Value:
BUILTIN(TemporalNow##T) { \
HandleScope scope(isolate); \
RETURN_RESULT_OR_FAILURE( \
isolate, JSTemporal##T::Now(isolate, args.atOrUndefined(isolate, 1), \
args.atOrUndefined(isolate, 2))); \
}

Definition at line 25 of file builtins-temporal.cc.

◆ TEMPORAL_NOW_ISO1

#define TEMPORAL_NOW_ISO1 ( T)
Value:
BUILTIN(TemporalNow##T##ISO) { \
HandleScope scope(isolate); \
RETURN_RESULT_OR_FAILURE( \
isolate, \
JSTemporal##T::NowISO(isolate, args.atOrUndefined(isolate, 1))); \
}

Definition at line 33 of file builtins-temporal.cc.

◆ TEMPORAL_PROTOTYPE_METHOD0

#define TEMPORAL_PROTOTYPE_METHOD0 ( T,
METHOD,
name )
Value:
BUILTIN(Temporal##T##Prototype##METHOD) { \
HandleScope scope(isolate); \
CHECK_RECEIVER(JSTemporal##T, obj, "Temporal." #T ".prototype." #name); \
RETURN_RESULT_OR_FAILURE(isolate, JSTemporal##T ::METHOD(isolate, obj)); \
}

Definition at line 50 of file builtins-temporal.cc.

◆ TEMPORAL_PROTOTYPE_METHOD1

#define TEMPORAL_PROTOTYPE_METHOD1 ( T,
METHOD,
name )
Value:
BUILTIN(Temporal##T##Prototype##METHOD) { \
HandleScope scope(isolate); \
CHECK_RECEIVER(JSTemporal##T, obj, "Temporal." #T ".prototype." #name); \
RETURN_RESULT_OR_FAILURE( \
isolate, \
JSTemporal##T ::METHOD(isolate, obj, args.atOrUndefined(isolate, 1))); \
}

Definition at line 57 of file builtins-temporal.cc.

◆ TEMPORAL_PROTOTYPE_METHOD2

#define TEMPORAL_PROTOTYPE_METHOD2 ( T,
METHOD,
name )
Value:
BUILTIN(Temporal##T##Prototype##METHOD) { \
HandleScope scope(isolate); \
CHECK_RECEIVER(JSTemporal##T, obj, "Temporal." #T ".prototype." #name); \
RETURN_RESULT_OR_FAILURE( \
isolate, \
JSTemporal##T ::METHOD(isolate, obj, args.atOrUndefined(isolate, 1), \
args.atOrUndefined(isolate, 2))); \
}

Definition at line 66 of file builtins-temporal.cc.

◆ TEMPORAL_PROTOTYPE_METHOD3

#define TEMPORAL_PROTOTYPE_METHOD3 ( T,
METHOD,
name )
Value:
BUILTIN(Temporal##T##Prototype##METHOD) { \
HandleScope scope(isolate); \
CHECK_RECEIVER(JSTemporal##T, obj, "Temporal." #T ".prototype." #name); \
RETURN_RESULT_OR_FAILURE( \
isolate, \
JSTemporal##T ::METHOD(isolate, obj, args.atOrUndefined(isolate, 1), \
args.atOrUndefined(isolate, 2), \
args.atOrUndefined(isolate, 3))); \
}

Definition at line 76 of file builtins-temporal.cc.

◆ TEMPORAL_VALUE_OF

#define TEMPORAL_VALUE_OF ( T)
Value:
BUILTIN(Temporal##T##PrototypeValueOf) { \
HandleScope scope(isolate); \
THROW_NEW_ERROR_RETURN_FAILURE( \
isolate, NewTypeError(MessageTemplate::kDoNotUse, \
isolate->factory()->NewStringFromAsciiChecked( \
"Temporal." #T ".prototype.valueOf"), \
isolate->factory()->NewStringFromAsciiChecked( \
"use Temporal." #T \
".prototype.compare for comparison."))); \
}

Definition at line 104 of file builtins-temporal.cc.

◆ TEMPORAL_ZONED_DATE_TIME_GET_BY_FORWARD_TIME_ZONE_AND_CALENDAR

#define TEMPORAL_ZONED_DATE_TIME_GET_BY_FORWARD_TIME_ZONE_AND_CALENDAR ( M)
Value:
BUILTIN(TemporalZonedDateTimePrototype##M) { \
TEMPORAL_ZONED_DATE_TIME_GET_PREPARE(M) \
/* 7. Return ? Calendar##M(calendar, temporalDateTime). */ \
RETURN_RESULT_OR_FAILURE( \
isolate, \
temporal::Calendar##M(isolate, calendar, temporal_date_time)); \
}

Definition at line 444 of file builtins-temporal.cc.

◆ TEMPORAL_ZONED_DATE_TIME_GET_INT_BY_FORWARD_TIME_ZONE

#define TEMPORAL_ZONED_DATE_TIME_GET_INT_BY_FORWARD_TIME_ZONE ( M,
field )
Value:
BUILTIN(TemporalZonedDateTimePrototype##M) { \
TEMPORAL_ZONED_DATE_TIME_GET_PREPARE(M) \
/* 7. Return 𝔽(temporalDateTime.[[ #field ]]). */ \
return Smi::FromInt(temporal_date_time->field()); \
}

Definition at line 453 of file builtins-temporal.cc.

◆ TEMPORAL_ZONED_DATE_TIME_GET_PREPARE

#define TEMPORAL_ZONED_DATE_TIME_GET_PREPARE ( M)
Value:
HandleScope scope(isolate); \
const char* method_name = "get Temporal.ZonedDateTime.prototype." #M; \
/* 1. Let zonedDateTime be the this value. */ \
/* 2. Perform ? RequireInternalSlot(zonedDateTime, */ \
/* [[InitializedTemporalZonedDateTime]]). */ \
CHECK_RECEIVER(JSTemporalZonedDateTime, zoned_date_time, method_name); \
/* 3. Let timeZone be zonedDateTime.[[TimeZone]]. */ \
DirectHandle<JSReceiver> time_zone(zoned_date_time->time_zone(), isolate); \
/* 4. Let instant be ? */ \
/* CreateTemporalInstant(zonedDateTime.[[Nanoseconds]]). */ \
DirectHandle<JSTemporalInstant> instant; \
ASSIGN_RETURN_FAILURE_ON_EXCEPTION( \
isolate, instant, \
temporal::CreateTemporalInstant( \
isolate, direct_handle(zoned_date_time->nanoseconds(), isolate))); \
/* 5. Let calendar be zonedDateTime.[[Calendar]]. */ \
DirectHandle<JSReceiver> calendar(zoned_date_time->calendar(), isolate); \
/* 6. Let temporalDateTime be ? */ \
/* BuiltinTimeZoneGetPlainDateTimeFor(timeZone, */ \
/* instant, calendar). */ \
DirectHandle<JSTemporalPlainDateTime> temporal_date_time; \
ASSIGN_RETURN_FAILURE_ON_EXCEPTION( \
isolate, temporal_date_time, \
temporal::BuiltinTimeZoneGetPlainDateTimeFor( \
isolate, time_zone, instant, calendar, method_name));
TimeZoneRecord time_zone

Definition at line 417 of file builtins-temporal.cc.

◆ TO_BE_IMPLEMENTED

#define TO_BE_IMPLEMENTED ( id)
Value:
HandleScope scope(isolate); \
UNIMPLEMENTED(); \
}
#define BUILTIN_NO_RCS(name)

Definition at line 13 of file builtins-temporal.cc.