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

Go to the source code of this file.

Namespaces

namespace  v8
 
namespace  v8::internal
 
namespace  v8::internal::temporal
 

Macros

#define STRINGIFY(x)
 
#define TOSTRING(x)
 
#define AT   __FILE__ ":" TOSTRING(__LINE__)
 
#define TEMPORAL_DEBUG_INFO   AT
 
#define TEMPORAL_ENTER_FUNC()
 
#define NEW_TEMPORAL_INVALID_ARG_TYPE_ERROR()
 
#define NEW_TEMPORAL_INVALID_ARG_RANGE_ERROR()
 
#define ORDINARY_CREATE_FROM_CONSTRUCTOR(obj, target, new_target, T)
 
#define THROW_INVALID_RANGE(T)
 
#define CONSTRUCTOR(name)
 
#define EXTRACT_CALENDAR(T, obj)
 
#define CALENDAR_ABSTRACT_OPERATION_INT_ACTION(Name, name, Action)
 
#define CALENDAR_ABSTRACT_OPERATION(Name, property)
 
#define TO_INT_THROW_ON_INFTY(name, T)
 
#define DEFINE_INT_FIELD(obj, str, field, item)
 
#define DEFINE_STRING_FIELD(obj, str, field)
 

Functions

MaybeDirectHandle< JSTemporalPlainDateTimev8::internal::temporal::CreateTemporalDateTime (Isolate *isolate, const DateTimeRecord &date_time, DirectHandle< JSReceiver > calendar)
 
MaybeDirectHandle< JSTemporalInstantv8::internal::temporal::CreateTemporalInstant (Isolate *isolate, DirectHandle< JSFunction > target, DirectHandle< HeapObject > new_target, DirectHandle< BigInt > epoch_nanoseconds)
 
MaybeDirectHandle< JSTemporalInstantv8::internal::temporal::CreateTemporalInstant (Isolate *isolate, DirectHandle< BigInt > epoch_nanoseconds)
 
MaybeDirectHandle< JSTemporalTimeZonev8::internal::temporal::CreateTemporalTimeZone (Isolate *isolate, DirectHandle< String > identifier)
 
MaybeDirectHandle< JSTemporalPlainDateTimev8::internal::temporal::BuiltinTimeZoneGetPlainDateTimeFor (Isolate *isolate, DirectHandle< JSReceiver > time_zone, DirectHandle< JSTemporalInstant > instant, DirectHandle< JSReceiver > calendar, const char *method_name)
 
MaybeDirectHandle< JSReceiverv8::internal::temporal::ToTemporalCalendar (Isolate *isolate, DirectHandle< Object > temporal_calendar_like, const char *method_name)
 
Maybe< TimeRecordv8::internal::temporal::RegulateTime (Isolate *isolate, const TimeRecord &time, ShowOverflow overflow)
 
MaybeDirectHandle< JSTemporalPlainTimev8::internal::temporal::ToTemporalTime (Isolate *isolate, DirectHandle< Object > item_obj, const char *method_name, ShowOverflow overflow=ShowOverflow::kConstrain)
 
Maybe< boolv8::internal::temporal::IterateDurationRecordFieldsTable (Isolate *isolate, DirectHandle< JSReceiver > temporal_duration_like, Maybe< bool >(*RowFunction)(Isolate *, DirectHandle< JSReceiver > temporal_duration_like, DirectHandle< String >, double *), DurationRecord *record)
 
Maybe< DurationRecordv8::internal::temporal::ToTemporalDurationRecord (Isolate *isolate, DirectHandle< Object > temporal_duration_like_obj, const char *method_name)
 
MaybeDirectHandle< JSTemporalDurationv8::internal::temporal::ToTemporalDuration (Isolate *isolate, DirectHandle< Object > item, const char *method_name)
 
MaybeDirectHandle< JSReceiverv8::internal::temporal::ToTemporalTimeZone (Isolate *isolate, DirectHandle< Object > temporal_time_zone_like, const char *method_name)
 
MaybeDirectHandle< Objectv8::internal::temporal::InvokeCalendarMethod (Isolate *isolate, DirectHandle< JSReceiver > calendar, DirectHandle< String > name, DirectHandle< JSReceiver > date_like)
 
MaybeDirectHandle< Objectv8::internal::temporal::CalendarMonthCode (Isolate *isolate, DirectHandle< JSReceiver > calendar, DirectHandle< JSReceiver > date_like)
 
DirectHandle< JSTemporalCalendarv8::internal::temporal::GetISO8601Calendar (Isolate *isolate)
 
bool v8::internal::temporal::IsValidDuration (Isolate *isolate, const DurationRecord &dur)
 
Maybe< DurationRecordv8::internal::temporal::ToPartialDuration (Isolate *isolate, DirectHandle< Object > temporal_duration_like_obj, const DurationRecord &input)
 
template<DirectHandle< Object >(*)(Isolate *, DirectHandle< BigInt >, int32_t) iana_func>
MaybeDirectHandle< Objectv8::internal::GetTransition (Isolate *isolate, DirectHandle< JSTemporalTimeZone > time_zone, DirectHandle< Object > starting_point_obj, const char *method_name)
 
MaybeDirectHandle< JSArrayv8::internal::GetIANATimeZoneEpochValueAsArrayOfInstantForUTC (Isolate *isolate, const DateTimeRecord &date_time)
 
MaybeDirectHandle< JSArrayv8::internal::GetIANATimeZoneEpochValueAsArrayOfInstant (Isolate *isolate, int32_t time_zone_index, const DateTimeRecord &date_time)
 
template<typename T , typename R , MaybeDirectHandle< R >(*)(Isolate *, DirectHandle< JSReceiver >, DirectHandle< JSReceiver >, DirectHandle< Object >) from_fields>
MaybeDirectHandle< R > v8::internal::ToPlain (Isolate *isolate, DirectHandle< T > t, DirectHandle< String > f1, DirectHandle< String > f2)
 
template<typename T , MaybeDirectHandle< T >(*)(Isolate *, DirectHandle< JSReceiver >, DirectHandle< JSReceiver >, DirectHandle< Object >) from_fields_func>
MaybeDirectHandle< Tv8::internal::ZonedDateTimeToPlainYearMonthOrMonthDay (Isolate *isolate, DirectHandle< JSTemporalZonedDateTime > zoned_date_time, DirectHandle< String > field_name_1, DirectHandle< String > field_name_2, const char *method_name)
 
MaybeDirectHandle< Oddballv8::internal::temporal::IsInvalidTemporalCalendarField (Isolate *isolate, DirectHandle< String > next_value, DirectHandle< FixedArray > fields_name)
 
MaybeDirectHandle< JSTemporalCalendarv8::internal::temporal::GetBuiltinCalendar (Isolate *isolate, DirectHandle< String > id)
 
MaybeDirectHandle< JSTemporalInstantv8::internal::temporal::BuiltinTimeZoneGetInstantForCompatible (Isolate *isolate, DirectHandle< JSReceiver > time_zone, DirectHandle< JSTemporalPlainDateTime > date_time, const char *method_name)
 

Macro Definition Documentation

◆ AT

#define AT   __FILE__ ":" TOSTRING(__LINE__)

Definition at line 478 of file js-temporal-objects.cc.

◆ CALENDAR_ABSTRACT_OPERATION

#define CALENDAR_ABSTRACT_OPERATION ( Name,
property )
Value:
MaybeDirectHandle<Object> Calendar##Name( \
Isolate* isolate, DirectHandle<JSReceiver> calendar, \
DirectHandle<JSReceiver> date_like) { \
return InvokeCalendarMethod(isolate, calendar, \
isolate->factory()->property##_string(), \
date_like); \
}
DirectHandle< Object > calendar

Definition at line 4393 of file js-temporal-objects.cc.

◆ CALENDAR_ABSTRACT_OPERATION_INT_ACTION

#define CALENDAR_ABSTRACT_OPERATION_INT_ACTION ( Name,
name,
Action )
Value:
MaybeDirectHandle<Smi> Calendar##Name(Isolate* isolate, \
DirectHandle<JSReceiver> calendar, \
DirectHandle<JSReceiver> date_like) { \
/* 1. Assert: Type(calendar) is Object. */ \
/* 2. Let result be ? Invoke(calendar, property, « dateLike »). */ \
DirectHandle<Object> result; \
ASSIGN_RETURN_ON_EXCEPTION( \
isolate, result, \
InvokeCalendarMethod(isolate, calendar, \
isolate->factory()->name##_string(), date_like)); \
/* 3. If result is undefined, throw a RangeError exception. */ \
if (IsUndefined(*result)) { \
THROW_NEW_ERROR(isolate, NEW_TEMPORAL_INVALID_ARG_RANGE_ERROR()); \
} \
/* 4. Return ? Action(result). */ \
ASSIGN_RETURN_ON_EXCEPTION(isolate, result, Action(isolate, result)); \
return direct_handle( \
Smi::FromInt(Object::NumberValue(Cast<Number>(*result))), isolate); \
}
#define NEW_TEMPORAL_INVALID_ARG_RANGE_ERROR()
ZoneVector< RpoNumber > & result

Definition at line 4372 of file js-temporal-objects.cc.

◆ CONSTRUCTOR

#define CONSTRUCTOR ( name)
Value:
DirectHandle<JSFunction>( \
Cast<JSFunction>( \
isolate->context()->native_context()->temporal_##name##_function()), \
isolate)

Definition at line 596 of file js-temporal-objects.cc.

◆ DEFINE_INT_FIELD

#define DEFINE_INT_FIELD ( obj,
str,
field,
item )
Value:
CHECK(JSReceiver::CreateDataProperty( \
isolate, obj, factory->str##_string(), \
DirectHandle<Smi>(Smi::FromInt(item->field()), isolate), \
Just(kThrowOnError)) \
.FromJust());
#define CHECK(condition)
Definition logging.h:124

Definition at line 11994 of file js-temporal-objects.cc.

◆ DEFINE_STRING_FIELD

#define DEFINE_STRING_FIELD ( obj,
str,
field )
Value:
CHECK(JSReceiver::CreateDataProperty(isolate, obj, factory->str##_string(), \
field, Just(kThrowOnError)) \
.FromJust());

◆ EXTRACT_CALENDAR

#define EXTRACT_CALENDAR ( T,
obj )
Value:
if (IsJSTemporal##T(*obj)) { \
return direct_handle(Cast<JSTemporal##T>(obj)->calendar(), isolate); \
}
#define T

◆ NEW_TEMPORAL_INVALID_ARG_RANGE_ERROR

#define NEW_TEMPORAL_INVALID_ARG_RANGE_ERROR ( )
Value:
NewRangeError( \
MessageTemplate::kInvalidTimeValueForTemporal, \
isolate->factory()->NewStringFromStaticChars(TEMPORAL_DEBUG_INFO))
#define TEMPORAL_DEBUG_INFO

Definition at line 498 of file js-temporal-objects.cc.

◆ NEW_TEMPORAL_INVALID_ARG_TYPE_ERROR

#define NEW_TEMPORAL_INVALID_ARG_TYPE_ERROR ( )
Value:
NewTypeError( \
MessageTemplate::kInvalidArgumentForTemporal, \
isolate->factory()->NewStringFromStaticChars(TEMPORAL_DEBUG_INFO))

Definition at line 493 of file js-temporal-objects.cc.

◆ ORDINARY_CREATE_FROM_CONSTRUCTOR

#define ORDINARY_CREATE_FROM_CONSTRUCTOR ( obj,
target,
new_target,
T )
Value:
DirectHandle<JSReceiver> new_target_receiver = Cast<JSReceiver>(new_target); \
DirectHandle<Map> map; \
ASSIGN_RETURN_ON_EXCEPTION( \
isolate, map, \
JSFunction::GetDerivedMap(isolate, target, new_target_receiver)); \
DirectHandle<T> object = \
Cast<T>(isolate->factory()->NewFastOrSlowJSObjectFromMap(map));
DirectHandle< Object > new_target
Definition execution.cc:75
std::map< const std::string, const std::string > map

Definition at line 584 of file js-temporal-objects.cc.

◆ STRINGIFY

#define STRINGIFY ( x)
Value:
#x

Definition at line 476 of file js-temporal-objects.cc.

◆ TEMPORAL_DEBUG_INFO

#define TEMPORAL_DEBUG_INFO   AT

Definition at line 487 of file js-temporal-objects.cc.

◆ TEMPORAL_ENTER_FUNC

#define TEMPORAL_ENTER_FUNC ( )

Definition at line 488 of file js-temporal-objects.cc.

◆ THROW_INVALID_RANGE

#define THROW_INVALID_RANGE ( T)
Value:
#define THROW_NEW_ERROR(isolate, call)
Definition isolate.h:307

Definition at line 593 of file js-temporal-objects.cc.

◆ TO_INT_THROW_ON_INFTY

#define TO_INT_THROW_ON_INFTY ( name,
T )
Value:
int32_t name; \
{ \
DirectHandle<Object> number_##name; \
/* x. Let name be ? ToIntegerThrowOnInfinity(name). */ \
ASSIGN_RETURN_ON_EXCEPTION(isolate, number_##name, \
ToIntegerThrowOnInfinity(isolate, name##_obj)); \
name = NumberToInt32(*number_##name); \
}
DirectHandle< Object > name

◆ TOSTRING

#define TOSTRING ( x)
Value:
#define STRINGIFY(x)
int x

Definition at line 477 of file js-temporal-objects.cc.

Variable Documentation

◆ calendar

DirectHandle<Object> calendar

Definition at line 75 of file js-temporal-objects.cc.

◆ date

DateRecord date

Definition at line 74 of file js-temporal-objects.cc.

◆ day_length

int64_t day_length

Definition at line 344 of file js-temporal-objects.cc.

◆ days

double days

Definition at line 116 of file js-temporal-objects.cc.

◆ defined

bool defined

Definition at line 7418 of file js-temporal-objects.cc.

◆ hour

double hour

Definition at line 61 of file js-temporal-objects.cc.

◆ increment

double increment

Definition at line 9441 of file js-temporal-objects.cc.

◆ largest_unit

Unit largest_unit

Definition at line 205 of file js-temporal-objects.cc.

◆ microsecond

double microsecond

Definition at line 65 of file js-temporal-objects.cc.

◆ millisecond

double millisecond

Definition at line 64 of file js-temporal-objects.cc.

◆ minute

double minute

Definition at line 62 of file js-temporal-objects.cc.

◆ months

double months

Definition at line 114 of file js-temporal-objects.cc.

◆ name

DirectHandle<Object> name

Definition at line 86 of file js-temporal-objects.cc.

◆ nanosecond

double nanosecond

Definition at line 66 of file js-temporal-objects.cc.

◆ nanoseconds

double nanoseconds

Definition at line 343 of file js-temporal-objects.cc.

◆ offset_string

DirectHandle<Object> offset_string

Definition at line 85 of file js-temporal-objects.cc.

◆ options

DirectHandle<JSReceiver> options

Definition at line 208 of file js-temporal-objects.cc.

◆ overflow

BalanceOverflow overflow

Definition at line 288 of file js-temporal-objects.cc.

◆ precision

Precision precision

Definition at line 9439 of file js-temporal-objects.cc.

◆ record

DurationRecord record

Definition at line 107 of file js-temporal-objects.cc.

◆ relative_to

DirectHandle<JSTemporalPlainDate> relative_to

Definition at line 6767 of file js-temporal-objects.cc.

◆ remainder

double remainder

Definition at line 108 of file js-temporal-objects.cc.

◆ rounding_increment

double rounding_increment

Definition at line 207 of file js-temporal-objects.cc.

◆ rounding_mode

RoundingMode rounding_mode

Definition at line 206 of file js-temporal-objects.cc.

◆ second

double second

Definition at line 63 of file js-temporal-objects.cc.

◆ smallest_unit

Unit smallest_unit

Definition at line 204 of file js-temporal-objects.cc.

◆ time

TimeRecord time

Definition at line 79 of file js-temporal-objects.cc.

◆ time_zone

TimeZoneRecord time_zone

Definition at line 92 of file js-temporal-objects.cc.

◆ unit

Unit unit

Definition at line 9440 of file js-temporal-objects.cc.

◆ value

double value

Definition at line 287 of file js-temporal-objects.cc.

◆ weeks

double weeks

Definition at line 115 of file js-temporal-objects.cc.

◆ years

double years

Definition at line 113 of file js-temporal-objects.cc.

◆ z

bool z

Definition at line 84 of file js-temporal-objects.cc.