Commit 0adc1410 authored by Frank Tang's avatar Frank Tang Committed by V8 LUCI CQ

[Temporal] Part 1 - Skeleton

1. Expose all the functions to empty buildins.
2. Wire up basic structure of classes and internal slots.

Design Doc: https://docs.google.com/document/d/1Huu2OUlmveBh4wjgx0D7ouC9O9vSdiZWaRK3OwkQZU0/

This is just a CL to establish a skeleton for Temporal.
The Temporal is very big. The prototype CL is in
https://chromium-review.googlesource.com/c/v8/v8/+/2967755
but too big to be reviewed so I break up the basic structure here first.

Cq-Include-Trybots: luci.v8.try:v8_linux64_bazel
Bug: v8:11544
Change-Id: I10d09e3c2530e5b1a6ba60014a2294e138879ff3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3092561Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76819}
parent 89f36a15
......@@ -806,6 +806,7 @@ filegroup(
"src/objects/js-proxy.tq",
"src/objects/js-regexp-string-iterator.tq",
"src/objects/js-regexp.tq",
"src/objects/js-temporal-objects.tq",
"src/objects/js-weak-refs.tq",
"src/objects/literal-objects.tq",
"src/objects/map.tq",
......@@ -998,6 +999,7 @@ filegroup(
"src/builtins/builtins-sharedarraybuffer.cc",
"src/builtins/builtins-string.cc",
"src/builtins/builtins-symbol.cc",
"src/builtins/builtins-temporal.cc",
"src/builtins/builtins-trace.cc",
"src/builtins/builtins-typed-array.cc",
"src/builtins/builtins-utils-inl.h",
......@@ -1575,6 +1577,8 @@ filegroup(
"src/objects/js-regexp-string-iterator.h",
"src/objects/js-regexp.cc",
"src/objects/js-regexp.h",
"src/objects/js-temporal-objects.h",
"src/objects/js-temporal-objects-inl.h",
"src/objects/js-weak-refs.h",
"src/objects/js-weak-refs-inl.h",
"src/objects/keys.cc",
......
......@@ -1599,6 +1599,7 @@ torque_files = [
"src/objects/js-proxy.tq",
"src/objects/js-regexp-string-iterator.tq",
"src/objects/js-regexp.tq",
"src/objects/js-temporal-objects.tq",
"src/objects/js-weak-refs.tq",
"src/objects/literal-objects.tq",
"src/objects/map.tq",
......@@ -2995,6 +2996,8 @@ v8_header_set("v8_internal_headers") {
"src/objects/js-regexp.h",
"src/objects/js-segments-inl.h",
"src/objects/js-segments.h",
"src/objects/js-temporal-objects-inl.h",
"src/objects/js-temporal-objects.h",
"src/objects/js-weak-refs-inl.h",
"src/objects/js-weak-refs.h",
"src/objects/keys.h",
......@@ -3842,6 +3845,7 @@ v8_source_set("v8_base_without_compiler") {
"src/builtins/builtins-sharedarraybuffer.cc",
"src/builtins/builtins-string.cc",
"src/builtins/builtins-symbol.cc",
"src/builtins/builtins-temporal.cc",
"src/builtins/builtins-trace.cc",
"src/builtins/builtins-typed-array.cc",
"src/builtins/builtins-weak-refs.cc",
......
This diff is collapsed.
This diff is collapsed.
......@@ -256,6 +256,16 @@ Type::bitset BitsetType::Lub(const MapRefLike& map) {
case JS_WEAK_REF_TYPE:
case JS_WEAK_SET_TYPE:
case JS_PROMISE_TYPE:
case JS_TEMPORAL_CALENDAR_TYPE:
case JS_TEMPORAL_DURATION_TYPE:
case JS_TEMPORAL_INSTANT_TYPE:
case JS_TEMPORAL_PLAIN_DATE_TYPE:
case JS_TEMPORAL_PLAIN_DATE_TIME_TYPE:
case JS_TEMPORAL_PLAIN_MONTH_DAY_TYPE:
case JS_TEMPORAL_PLAIN_TIME_TYPE:
case JS_TEMPORAL_PLAIN_YEAR_MONTH_TYPE:
case JS_TEMPORAL_TIME_ZONE_TYPE:
case JS_TEMPORAL_ZONED_DATE_TIME_TYPE:
#if V8_ENABLE_WEBASSEMBLY
case WASM_ARRAY_TYPE:
case WASM_TAG_OBJECT_TYPE:
......
......@@ -8,9 +8,15 @@ namespace v8 {
namespace internal {
const bool Deoptimizer::kSupportsFixedDeoptExitSizes = true;
const int Deoptimizer::kNonLazyDeoptExitSize = 2 * kInstrSize;
const int Deoptimizer::kLazyDeoptExitSize = 2 * kInstrSize;
const int Deoptimizer::kEagerWithResumeBeforeArgsSize = 3 * kInstrSize;
// These constants should *not* change unless the instruction sequence
// of deoptimization exits (CallForDeoptimization) is changed. Changes
// due to additional IsolateData fields (e.g. roots, builtins) should
// be made s.t. exit sizes remain unchanged.
// TODO(crbug.com/v8/12203)
const int Deoptimizer::kNonLazyDeoptExitSize = 3 * kInstrSize;
const int Deoptimizer::kLazyDeoptExitSize = 3 * kInstrSize;
const int Deoptimizer::kEagerWithResumeBeforeArgsSize = 4 * kInstrSize;
const int Deoptimizer::kEagerWithResumeDeoptExitSize =
kEagerWithResumeBeforeArgsSize + 2 * kSystemPointerSize;
const int Deoptimizer::kEagerWithResumeImmedArgs1PcOffset = kInstrSize;
......
......@@ -58,6 +58,7 @@
#include "src/objects/js-segmenter-inl.h"
#include "src/objects/js-segments-inl.h"
#endif // V8_INTL_SUPPORT
#include "src/objects/js-temporal-objects-inl.h"
#include "src/objects/js-weak-refs-inl.h"
#include "src/objects/literal-objects-inl.h"
#include "src/objects/maybe-object.h"
......
......@@ -2255,6 +2255,55 @@ void Script::ScriptPrint(std::ostream& os) {
os << "\n";
}
void JSTemporalPlainDate::JSTemporalPlainDatePrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSTemporalPlainDate");
JSObjectPrintBody(os, *this);
}
void JSTemporalPlainTime::JSTemporalPlainTimePrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSTemporalPlainTime");
JSObjectPrintBody(os, *this);
}
void JSTemporalPlainDateTime::JSTemporalPlainDateTimePrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSTemporalPlainDateTime");
JSObjectPrintBody(os, *this);
}
void JSTemporalZonedDateTime::JSTemporalZonedDateTimePrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSTemporalZonedDateTime");
JSObjectPrintBody(os, *this);
}
void JSTemporalDuration::JSTemporalDurationPrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSTemporalDuration");
JSObjectPrintBody(os, *this);
}
void JSTemporalInstant::JSTemporalInstantPrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSTemporalInstant");
JSObjectPrintBody(os, *this);
}
void JSTemporalPlainYearMonth::JSTemporalPlainYearMonthPrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSTemporalPlainYearMonth");
JSObjectPrintBody(os, *this);
}
void JSTemporalPlainMonthDay::JSTemporalPlainMonthDayPrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSTemporalPlainMonthDay");
JSObjectPrintBody(os, *this);
}
void JSTemporalTimeZone::JSTemporalTimeZonePrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSTemporalTimeZone");
JSObjectPrintBody(os, *this);
}
void JSTemporalCalendar::JSTemporalCalendarPrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSTemporalCalendar");
JSObjectPrintBody(os, *this);
}
#ifdef V8_INTL_SUPPORT
void JSV8BreakIterator::JSV8BreakIteratorPrint(std::ostream& os) {
JSObjectPrintHeader(os, *this, "JSV8BreakIterator");
......
......@@ -298,7 +298,8 @@ DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features")
V(harmony_import_assertions, "harmony import assertions") \
V(harmony_rab_gsab, \
"harmony ResizableArrayBuffer / GrowableSharedArrayBuffer") \
V(harmony_array_find_last, "harmony array find last helpers")
V(harmony_array_find_last, "harmony array find last helpers") \
V(harmony_temporal, "Temporal")
#ifdef V8_INTL_SUPPORT
#define HARMONY_INPROGRESS(V) HARMONY_INPROGRESS_BASE(V)
......
This diff is collapsed.
This diff is collapsed.
......@@ -46,6 +46,7 @@
#include "src/objects/js-proxy-inl.h"
#include "src/objects/js-regexp-inl.h"
#include "src/objects/js-regexp-string-iterator-inl.h"
#include "src/objects/js-temporal-objects-inl.h"
#include "src/objects/js-weak-refs-inl.h"
#include "src/objects/literal-objects-inl.h"
#include "src/objects/lookup-cache-inl.h"
......
......@@ -189,6 +189,25 @@ enum ContextLookupFlags {
V(JS_WEAK_REF_FUNCTION_INDEX, JSFunction, js_weak_ref_fun) \
V(JS_FINALIZATION_REGISTRY_FUNCTION_INDEX, JSFunction, \
js_finalization_registry_fun) \
V(JS_TEMPORAL_CALENDAR_FUNCTION_INDEX, JSFunction, \
temporal_calendar_function) \
V(JS_TEMPORAL_DURATION_FUNCTION_INDEX, JSFunction, \
temporal_duration_function) \
V(JS_TEMPORAL_INSTANT_FUNCTION_INDEX, JSFunction, temporal_instant_function) \
V(JS_TEMPORAL_PLAIN_DATE_FUNCTION_INDEX, JSFunction, \
temporal_plain_date_function) \
V(JS_TEMPORAL_PLAIN_DATE_TIME_FUNCTION_INDEX, JSFunction, \
temporal_plain_date_time_function) \
V(JS_TEMPORAL_PLAIN_MONTH_DAY_FUNCTION_INDEX, JSFunction, \
temporal_plain_month_day_function) \
V(JS_TEMPORAL_PLAIN_TIME_FUNCTION_INDEX, JSFunction, \
temporal_plain_time_function) \
V(JS_TEMPORAL_PLAIN_YEAR_MONTH_FUNCTION_INDEX, JSFunction, \
temporal_plain_year_month_function) \
V(JS_TEMPORAL_TIME_ZONE_FUNCTION_INDEX, JSFunction, \
temporal_time_zone_function) \
V(JS_TEMPORAL_ZONED_DATE_TIME_FUNCTION_INDEX, JSFunction, \
temporal_zoned_date_time_function) \
/* Context maps */ \
V(NATIVE_CONTEXT_MAP_INDEX, Map, native_context_map) \
V(FUNCTION_CONTEXT_MAP_INDEX, Map, function_context_map) \
......
......@@ -593,6 +593,16 @@ bool CanSubclassHaveInobjectProperties(InstanceType instance_type) {
case JS_SPECIAL_API_OBJECT_TYPE:
case JS_TYPED_ARRAY_TYPE:
case JS_PRIMITIVE_WRAPPER_TYPE:
case JS_TEMPORAL_CALENDAR_TYPE:
case JS_TEMPORAL_DURATION_TYPE:
case JS_TEMPORAL_INSTANT_TYPE:
case JS_TEMPORAL_PLAIN_DATE_TYPE:
case JS_TEMPORAL_PLAIN_DATE_TIME_TYPE:
case JS_TEMPORAL_PLAIN_MONTH_DAY_TYPE:
case JS_TEMPORAL_PLAIN_TIME_TYPE:
case JS_TEMPORAL_PLAIN_YEAR_MONTH_TYPE:
case JS_TEMPORAL_TIME_ZONE_TYPE:
case JS_TEMPORAL_ZONED_DATE_TIME_TYPE:
case JS_WEAK_MAP_TYPE:
case JS_WEAK_REF_TYPE:
case JS_WEAK_SET_TYPE:
......
......@@ -58,6 +58,7 @@
#include "src/objects/js-segmenter.h"
#include "src/objects/js-segments.h"
#endif // V8_INTL_SUPPORT
#include "src/objects/js-temporal-objects-inl.h"
#include "src/objects/js-weak-refs.h"
#include "src/objects/map-inl.h"
#include "src/objects/module.h"
......@@ -2297,6 +2298,26 @@ int JSObject::GetHeaderSize(InstanceType type,
return JSStringIterator::kHeaderSize;
case JS_MODULE_NAMESPACE_TYPE:
return JSModuleNamespace::kHeaderSize;
case JS_TEMPORAL_CALENDAR_TYPE:
return JSTemporalCalendar::kHeaderSize;
case JS_TEMPORAL_DURATION_TYPE:
return JSTemporalDuration::kHeaderSize;
case JS_TEMPORAL_INSTANT_TYPE:
return JSTemporalInstant::kHeaderSize;
case JS_TEMPORAL_PLAIN_DATE_TYPE:
return JSTemporalPlainDate::kHeaderSize;
case JS_TEMPORAL_PLAIN_DATE_TIME_TYPE:
return JSTemporalPlainDateTime::kHeaderSize;
case JS_TEMPORAL_PLAIN_MONTH_DAY_TYPE:
return JSTemporalPlainMonthDay::kHeaderSize;
case JS_TEMPORAL_PLAIN_TIME_TYPE:
return JSTemporalPlainTime::kHeaderSize;
case JS_TEMPORAL_PLAIN_YEAR_MONTH_TYPE:
return JSTemporalPlainYearMonth::kHeaderSize;
case JS_TEMPORAL_TIME_ZONE_TYPE:
return JSTemporalTimeZone::kHeaderSize;
case JS_TEMPORAL_ZONED_DATE_TIME_TYPE:
return JSTemporalZonedDateTime::kHeaderSize;
#ifdef V8_INTL_SUPPORT
case JS_V8_BREAK_ITERATOR_TYPE:
return JSV8BreakIterator::kHeaderSize;
......
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_OBJECTS_JS_TEMPORAL_OBJECTS_INL_H_
#define V8_OBJECTS_JS_TEMPORAL_OBJECTS_INL_H_
#include "src/api/api-inl.h"
#include "src/objects/js-temporal-objects.h"
#include "src/objects/objects-inl.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
namespace v8 {
namespace internal {
#include "torque-generated/src/objects/js-temporal-objects-tq-inl.inc"
#define TEMPORAL_INLINE_GETTER_SETTER(T, data, field, lower, upper, B) \
inline void T::set_##field(int32_t field) { \
DCHECK_GE(upper, field); \
DCHECK_LE(lower, field); \
int hints = data(); \
hints = B##Bits::update(hints, field); \
set_##data(hints); \
} \
inline int32_t T::field() const { \
int32_t v = B##Bits::decode(data()); \
DCHECK_GE(upper, v); \
DCHECK_LE(lower, v); \
return v; \
}
#define TEMPORAL_INLINE_SIGNED_GETTER_SETTER(T, data, field, lower, upper, B) \
inline void T::set_##field(int32_t field) { \
DCHECK_GE(upper, field); \
DCHECK_LE(lower, field); \
int hints = data(); \
hints = B##Bits::update(hints, field); \
set_##data(hints); \
} \
inline int32_t T::field() const { \
int32_t v = B##Bits::decode(data()); \
v |= ((int32_t{1} << (B##Bits::kSize - 1) & v) \
? (static_cast<uint32_t>(int32_t{-1}) << B##Bits::kSize) \
: 0); \
CHECK_GE(upper, v); \
CHECK_LE(lower, v); \
return v; \
}
#define TEMPORAL_DATE_INLINE_GETTER_SETTER(T, data) \
TEMPORAL_INLINE_SIGNED_GETTER_SETTER(T, data, iso_year, -32767, 32768, \
IsoYear) \
TEMPORAL_INLINE_GETTER_SETTER(T, data, iso_month, 1, 12, IsoMonth) \
TEMPORAL_INLINE_GETTER_SETTER(T, data, iso_day, 1, 31, IsoDay)
#define TEMPORAL_TIME_INLINE_GETTER_SETTER(T, data1, data2) \
TEMPORAL_INLINE_GETTER_SETTER(T, data1, iso_hour, 0, 23, IsoHour) \
TEMPORAL_INLINE_GETTER_SETTER(T, data1, iso_minute, 0, 59, IsoMinute) \
TEMPORAL_INLINE_GETTER_SETTER(T, data1, iso_second, 0, 59, IsoSecond) \
TEMPORAL_INLINE_GETTER_SETTER(T, data2, iso_millisecond, 0, 999, \
IsoMillisecond) \
TEMPORAL_INLINE_GETTER_SETTER(T, data2, iso_microsecond, 0, 999, \
IsoMicrosecond) \
TEMPORAL_INLINE_GETTER_SETTER(T, data2, iso_nanosecond, 0, 999, IsoNanosecond)
TEMPORAL_DATE_INLINE_GETTER_SETTER(JSTemporalPlainDate, year_month_day)
TEMPORAL_DATE_INLINE_GETTER_SETTER(JSTemporalPlainDateTime, year_month_day)
TEMPORAL_TIME_INLINE_GETTER_SETTER(JSTemporalPlainDateTime, hour_minute_second,
second_parts)
TEMPORAL_DATE_INLINE_GETTER_SETTER(JSTemporalPlainMonthDay, year_month_day)
TEMPORAL_TIME_INLINE_GETTER_SETTER(JSTemporalPlainTime, hour_minute_second,
second_parts)
TEMPORAL_DATE_INLINE_GETTER_SETTER(JSTemporalPlainYearMonth, year_month_day)
TQ_OBJECT_CONSTRUCTORS_IMPL(JSTemporalCalendar)
TQ_OBJECT_CONSTRUCTORS_IMPL(JSTemporalDuration)
TQ_OBJECT_CONSTRUCTORS_IMPL(JSTemporalInstant)
TQ_OBJECT_CONSTRUCTORS_IMPL(JSTemporalPlainDate)
TQ_OBJECT_CONSTRUCTORS_IMPL(JSTemporalPlainDateTime)
TQ_OBJECT_CONSTRUCTORS_IMPL(JSTemporalPlainMonthDay)
TQ_OBJECT_CONSTRUCTORS_IMPL(JSTemporalPlainTime)
TQ_OBJECT_CONSTRUCTORS_IMPL(JSTemporalPlainYearMonth)
TQ_OBJECT_CONSTRUCTORS_IMPL(JSTemporalTimeZone)
TQ_OBJECT_CONSTRUCTORS_IMPL(JSTemporalZonedDateTime)
BIT_FIELD_ACCESSORS(JSTemporalCalendar, flags, calendar_index,
JSTemporalCalendar::CalendarIndexBits)
BOOL_ACCESSORS(JSTemporalTimeZone, flags, is_offset, IsOffsetBit::kShift)
BIT_FIELD_ACCESSORS(JSTemporalTimeZone, flags,
offset_milliseconds_or_time_zone_index,
JSTemporalTimeZone::OffsetMillisecondsOrTimeZoneIndexBits)
} // namespace internal
} // namespace v8
#include "src/objects/object-macros-undef.h"
#endif // V8_OBJECTS_JS_TEMPORAL_OBJECTS_INL_H_
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_OBJECTS_JS_TEMPORAL_OBJECTS_H_
#define V8_OBJECTS_JS_TEMPORAL_OBJECTS_H_
#include "src/execution/isolate.h"
#include "src/heap/factory.h"
#include "src/objects/objects.h"
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"
namespace v8 {
namespace internal {
#include "torque-generated/src/objects/js-temporal-objects-tq.inc"
#define DECLARE_TEMPORAL_INLINE_GETTER_SETTER(field) \
inline void set_##field(int32_t field); \
inline int32_t field() const;
#define DECLARE_TEMPORAL_TIME_INLINE_GETTER_SETTER() \
DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_hour) \
DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_minute) \
DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_second) \
DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_millisecond) \
DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_microsecond) \
DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_nanosecond)
#define DECLARE_TEMPORAL_DATE_INLINE_GETTER_SETTER() \
DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_year) \
DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_month) \
DECLARE_TEMPORAL_INLINE_GETTER_SETTER(iso_day)
#define TEMPORAL_UNIMPLEMENTED(T) \
{ \
printf("TBW %s\n", __PRETTY_FUNCTION__); \
UNIMPLEMENTED(); \
}
class JSTemporalCalendar
: public TorqueGeneratedJSTemporalCalendar<JSTemporalCalendar, JSObject> {
public:
DECL_PRINTER(JSTemporalCalendar)
DEFINE_TORQUE_GENERATED_JS_TEMPORAL_CALENDAR_FLAGS()
DECL_INT_ACCESSORS(calendar_index)
TQ_OBJECT_CONSTRUCTORS(JSTemporalCalendar)
};
class JSTemporalDuration
: public TorqueGeneratedJSTemporalDuration<JSTemporalDuration, JSObject> {
public:
DECL_PRINTER(JSTemporalDuration)
TQ_OBJECT_CONSTRUCTORS(JSTemporalDuration)
};
class JSTemporalInstant
: public TorqueGeneratedJSTemporalInstant<JSTemporalInstant, JSObject> {
public:
DECL_PRINTER(JSTemporalInstant)
TQ_OBJECT_CONSTRUCTORS(JSTemporalInstant)
};
class JSTemporalPlainDate
: public TorqueGeneratedJSTemporalPlainDate<JSTemporalPlainDate, JSObject> {
public:
DECL_PRINTER(JSTemporalPlainDate)
DEFINE_TORQUE_GENERATED_JS_TEMPORAL_YEAR_MONTH_DAY()
DECLARE_TEMPORAL_DATE_INLINE_GETTER_SETTER()
TQ_OBJECT_CONSTRUCTORS(JSTemporalPlainDate)
};
class JSTemporalPlainDateTime
: public TorqueGeneratedJSTemporalPlainDateTime<JSTemporalPlainDateTime,
JSObject> {
public:
DECL_PRINTER(JSTemporalPlainDateTime)
DEFINE_TORQUE_GENERATED_JS_TEMPORAL_YEAR_MONTH_DAY()
DEFINE_TORQUE_GENERATED_JS_TEMPORAL_HOUR_MINUTE_SECOND()
DEFINE_TORQUE_GENERATED_JS_TEMPORAL_SECOND_PARTS()
DECLARE_TEMPORAL_DATE_INLINE_GETTER_SETTER()
DECLARE_TEMPORAL_TIME_INLINE_GETTER_SETTER()
TQ_OBJECT_CONSTRUCTORS(JSTemporalPlainDateTime)
};
class JSTemporalPlainMonthDay
: public TorqueGeneratedJSTemporalPlainMonthDay<JSTemporalPlainMonthDay,
JSObject> {
public:
DECL_PRINTER(JSTemporalPlainMonthDay)
DEFINE_TORQUE_GENERATED_JS_TEMPORAL_YEAR_MONTH_DAY()
DECLARE_TEMPORAL_DATE_INLINE_GETTER_SETTER()
TQ_OBJECT_CONSTRUCTORS(JSTemporalPlainMonthDay)
};
class JSTemporalPlainTime
: public TorqueGeneratedJSTemporalPlainTime<JSTemporalPlainTime, JSObject> {
public:
DECL_PRINTER(JSTemporalPlainTime)
DEFINE_TORQUE_GENERATED_JS_TEMPORAL_HOUR_MINUTE_SECOND()
DEFINE_TORQUE_GENERATED_JS_TEMPORAL_SECOND_PARTS()
DECLARE_TEMPORAL_TIME_INLINE_GETTER_SETTER()
TQ_OBJECT_CONSTRUCTORS(JSTemporalPlainTime)
};
class JSTemporalPlainYearMonth
: public TorqueGeneratedJSTemporalPlainYearMonth<JSTemporalPlainYearMonth,
JSObject> {
public:
DECL_PRINTER(JSTemporalPlainYearMonth)
DEFINE_TORQUE_GENERATED_JS_TEMPORAL_YEAR_MONTH_DAY()
DECLARE_TEMPORAL_DATE_INLINE_GETTER_SETTER()
TQ_OBJECT_CONSTRUCTORS(JSTemporalPlainYearMonth)
};
class JSTemporalTimeZone
: public TorqueGeneratedJSTemporalTimeZone<JSTemporalTimeZone, JSObject> {
public:
DECL_PRINTER(JSTemporalTimeZone)
DEFINE_TORQUE_GENERATED_JS_TEMPORAL_TIME_ZONE_FLAGS()
DECL_BOOLEAN_ACCESSORS(is_offset)
DECL_INT_ACCESSORS(offset_milliseconds_or_time_zone_index)
TQ_OBJECT_CONSTRUCTORS(JSTemporalTimeZone)
};
class JSTemporalZonedDateTime
: public TorqueGeneratedJSTemporalZonedDateTime<JSTemporalZonedDateTime,
JSObject> {
public:
DECL_PRINTER(JSTemporalZonedDateTime)
TQ_OBJECT_CONSTRUCTORS(JSTemporalZonedDateTime)
};
} // namespace internal
} // namespace v8
#include "src/objects/object-macros-undef.h"
#endif // V8_OBJECTS_JS_TEMPORAL_OBJECTS_H_
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include 'src/objects/js-temporal-objects.h'
bitfield struct JSTemporalCalendarFlags extends uint31 {
calendar_index: int32: 5 bit;
}
bitfield struct JSTemporalYearMonthDay extends uint31 {
iso_year: int32: 16 bit;
iso_month: int32: 4 bit;
iso_day: int32: 5 bit;
}
bitfield struct JSTemporalHourMinuteSecond extends uint31 {
iso_hour: int32: 5 bit;
iso_minute: int32: 6 bit;
iso_second: int32: 6 bit;
}
bitfield struct JSTemporalSecondParts extends uint31 {
iso_millisecond: int32: 10 bit;
iso_microsecond: int32: 10 bit;
iso_nanosecond: int32: 10 bit;
}
bitfield struct JSTemporalTimeZoneFlags extends uint31 {
is_offset: bool: 1 bit;
offset_milliseconds_or_time_zone_index: int32: 28 bit;
}
extern class JSTemporalCalendar extends JSObject {
flags: SmiTagged<JSTemporalCalendarFlags>;
}
extern class JSTemporalDuration extends JSObject {
years: Number;
months: Number;
weeks: Number;
days: Number;
hours: Number;
minutes: Number;
seconds: Number;
milliseconds: Number;
microseconds: Number;
nanoseconds: Number;
}
extern class JSTemporalInstant extends JSObject { nanoseconds: BigInt; }
extern class JSTemporalPlainDateTime extends JSObject {
year_month_day: SmiTagged<JSTemporalYearMonthDay>;
hour_minute_second: SmiTagged<JSTemporalHourMinuteSecond>;
second_parts: SmiTagged<JSTemporalSecondParts>;
calendar: JSReceiver;
}
extern class JSTemporalPlainDate extends JSObject {
year_month_day: SmiTagged<JSTemporalYearMonthDay>;
calendar: JSReceiver;
}
extern class JSTemporalPlainMonthDay extends JSObject {
year_month_day: SmiTagged<JSTemporalYearMonthDay>;
calendar: JSReceiver;
}
extern class JSTemporalPlainTime extends JSObject {
hour_minute_second: SmiTagged<JSTemporalHourMinuteSecond>;
second_parts: SmiTagged<JSTemporalSecondParts>;
calendar: JSReceiver;
}
extern class JSTemporalPlainYearMonth extends JSObject {
year_month_day: SmiTagged<JSTemporalYearMonthDay>;
calendar: JSReceiver;
}
extern class JSTemporalTimeZone extends JSObject {
flags: SmiTagged<JSTemporalTimeZoneFlags>;
}
extern class JSTemporalZonedDateTime extends JSObject {
nanoseconds: BigInt;
time_zone: JSReceiver;
calendar: JSReceiver;
}
......@@ -274,6 +274,16 @@ VisitorId Map::GetVisitorId(Map map) {
case JS_SET_VALUE_ITERATOR_TYPE:
case JS_STRING_ITERATOR_PROTOTYPE_TYPE:
case JS_STRING_ITERATOR_TYPE:
case JS_TEMPORAL_CALENDAR_TYPE:
case JS_TEMPORAL_DURATION_TYPE:
case JS_TEMPORAL_INSTANT_TYPE:
case JS_TEMPORAL_PLAIN_DATE_TYPE:
case JS_TEMPORAL_PLAIN_DATE_TIME_TYPE:
case JS_TEMPORAL_PLAIN_MONTH_DAY_TYPE:
case JS_TEMPORAL_PLAIN_TIME_TYPE:
case JS_TEMPORAL_PLAIN_YEAR_MONTH_TYPE:
case JS_TEMPORAL_TIME_ZONE_TYPE:
case JS_TEMPORAL_ZONED_DATE_TIME_TYPE:
case JS_TYPED_ARRAY_PROTOTYPE_TYPE:
#ifdef V8_INTL_SUPPORT
case JS_V8_BREAK_ITERATOR_TYPE:
......
......@@ -158,6 +158,16 @@ class ZoneForwardList;
V(JSSetIterator) \
V(JSSpecialObject) \
V(JSStringIterator) \
V(JSTemporalCalendar) \
V(JSTemporalDuration) \
V(JSTemporalInstant) \
V(JSTemporalPlainDate) \
V(JSTemporalPlainTime) \
V(JSTemporalPlainDateTime) \
V(JSTemporalPlainMonthDay) \
V(JSTemporalPlainYearMonth) \
V(JSTemporalTimeZone) \
V(JSTemporalZonedDateTime) \
V(JSTypedArray) \
V(JSWeakCollection) \
V(JSWeakRef) \
......
......@@ -1112,6 +1112,16 @@ ReturnType BodyDescriptorApply(InstanceType type, T1 p1, T2 p2, T3 p3, T4 p4) {
case JS_SPECIAL_API_OBJECT_TYPE:
case JS_STRING_ITERATOR_PROTOTYPE_TYPE:
case JS_STRING_ITERATOR_TYPE:
case JS_TEMPORAL_CALENDAR_TYPE:
case JS_TEMPORAL_DURATION_TYPE:
case JS_TEMPORAL_INSTANT_TYPE:
case JS_TEMPORAL_PLAIN_DATE_TYPE:
case JS_TEMPORAL_PLAIN_DATE_TIME_TYPE:
case JS_TEMPORAL_PLAIN_MONTH_DAY_TYPE:
case JS_TEMPORAL_PLAIN_TIME_TYPE:
case JS_TEMPORAL_PLAIN_YEAR_MONTH_TYPE:
case JS_TEMPORAL_TIME_ZONE_TYPE:
case JS_TEMPORAL_ZONED_DATE_TIME_TYPE:
case JS_TYPED_ARRAY_PROTOTYPE_TYPE:
case JS_FUNCTION_TYPE:
case JS_PROMISE_CONSTRUCTOR_TYPE:
......
......@@ -65,6 +65,16 @@
// - JSRegExp
// - JSSetIterator
// - JSStringIterator
// - JSTemporalCalendar
// - JSTemporalDuration
// - JSTemporalInstant
// - JSTemporalPlainDate
// - JSTemporalPlainDateTime
// - JSTemporalPlainMonthDay
// - JSTemporalPlainTime
// - JSTemporalPlainYearMonth
// - JSTemporalTimeZone
// - JSTemporalZonedDateTime
// - JSWeakCollection
// - JSWeakMap
// - JSWeakSet
......
......@@ -5248,6 +5248,7 @@ void ImplementationVisitor::GenerateExportedMacrosAssembler(
cc_contents << "#include \"src/objects/fixed-array-inl.h\"\n";
cc_contents << "#include \"src/objects/free-space.h\"\n";
cc_contents << "#include \"src/objects/js-regexp-string-iterator.h\"\n";
cc_contents << "#include \"src/objects/js-temporal-objects.h\"\n";
cc_contents << "#include \"src/objects/js-weak-refs.h\"\n";
cc_contents << "#include \"src/objects/ordered-hash-table.h\"\n";
cc_contents << "#include \"src/objects/property-descriptor-object.h\"\n";
......
This diff is collapsed.
......@@ -222,15 +222,25 @@ INSTANCE_TYPES = {
2121: "JS_SEGMENTER_TYPE",
2122: "JS_SEGMENTS_TYPE",
2123: "JS_STRING_ITERATOR_TYPE",
2124: "JS_V8_BREAK_ITERATOR_TYPE",
2125: "JS_WEAK_REF_TYPE",
2126: "WASM_GLOBAL_OBJECT_TYPE",
2127: "WASM_INSTANCE_OBJECT_TYPE",
2128: "WASM_MEMORY_OBJECT_TYPE",
2129: "WASM_MODULE_OBJECT_TYPE",
2130: "WASM_TABLE_OBJECT_TYPE",
2131: "WASM_TAG_OBJECT_TYPE",
2132: "WASM_VALUE_OBJECT_TYPE",
2124: "JS_TEMPORAL_CALENDAR_TYPE",
2125: "JS_TEMPORAL_DURATION_TYPE",
2126: "JS_TEMPORAL_INSTANT_TYPE",
2127: "JS_TEMPORAL_PLAIN_DATE_TYPE",
2128: "JS_TEMPORAL_PLAIN_DATE_TIME_TYPE",
2129: "JS_TEMPORAL_PLAIN_MONTH_DAY_TYPE",
2130: "JS_TEMPORAL_PLAIN_TIME_TYPE",
2131: "JS_TEMPORAL_PLAIN_YEAR_MONTH_TYPE",
2132: "JS_TEMPORAL_TIME_ZONE_TYPE",
2133: "JS_TEMPORAL_ZONED_DATE_TIME_TYPE",
2134: "JS_V8_BREAK_ITERATOR_TYPE",
2135: "JS_WEAK_REF_TYPE",
2136: "WASM_GLOBAL_OBJECT_TYPE",
2137: "WASM_INSTANCE_OBJECT_TYPE",
2138: "WASM_MEMORY_OBJECT_TYPE",
2139: "WASM_MODULE_OBJECT_TYPE",
2140: "WASM_TABLE_OBJECT_TYPE",
2141: "WASM_TAG_OBJECT_TYPE",
2142: "WASM_VALUE_OBJECT_TYPE",
}
# List of known V8 maps.
......@@ -329,65 +339,65 @@ KNOWN_MAPS = {
("read_only_space", 0x03215): (67, "BasicBlockCountersMarkerMap"),
("read_only_space", 0x03259): (91, "ArrayBoilerplateDescriptionMap"),
("read_only_space", 0x03359): (103, "InterceptorInfoMap"),
("read_only_space", 0x05699): (76, "PromiseFulfillReactionJobTaskMap"),
("read_only_space", 0x056c1): (77, "PromiseRejectReactionJobTaskMap"),
("read_only_space", 0x056e9): (78, "CallableTaskMap"),
("read_only_space", 0x05711): (79, "CallbackTaskMap"),
("read_only_space", 0x05739): (80, "PromiseResolveThenableJobTaskMap"),
("read_only_space", 0x05761): (83, "FunctionTemplateInfoMap"),
("read_only_space", 0x05789): (84, "ObjectTemplateInfoMap"),
("read_only_space", 0x057b1): (85, "AccessCheckInfoMap"),
("read_only_space", 0x057d9): (86, "AccessorInfoMap"),
("read_only_space", 0x05801): (87, "AccessorPairMap"),
("read_only_space", 0x05829): (88, "AliasedArgumentsEntryMap"),
("read_only_space", 0x05851): (89, "AllocationMementoMap"),
("read_only_space", 0x05879): (92, "AsmWasmDataMap"),
("read_only_space", 0x058a1): (93, "AsyncGeneratorRequestMap"),
("read_only_space", 0x058c9): (94, "BreakPointMap"),
("read_only_space", 0x058f1): (95, "BreakPointInfoMap"),
("read_only_space", 0x05919): (96, "CachedTemplateObjectMap"),
("read_only_space", 0x05941): (98, "ClassPositionsMap"),
("read_only_space", 0x05969): (99, "DebugInfoMap"),
("read_only_space", 0x05991): (102, "FunctionTemplateRareDataMap"),
("read_only_space", 0x059b9): (104, "InterpreterDataMap"),
("read_only_space", 0x059e1): (105, "ModuleRequestMap"),
("read_only_space", 0x05a09): (106, "PromiseCapabilityMap"),
("read_only_space", 0x05a31): (107, "PromiseReactionMap"),
("read_only_space", 0x05a59): (108, "PropertyDescriptorObjectMap"),
("read_only_space", 0x05a81): (109, "PrototypeInfoMap"),
("read_only_space", 0x05aa9): (110, "RegExpBoilerplateDescriptionMap"),
("read_only_space", 0x05ad1): (111, "ScriptMap"),
("read_only_space", 0x05af9): (112, "SourceTextModuleInfoEntryMap"),
("read_only_space", 0x05b21): (113, "StackFrameInfoMap"),
("read_only_space", 0x05b49): (114, "TemplateObjectDescriptionMap"),
("read_only_space", 0x05b71): (115, "Tuple2Map"),
("read_only_space", 0x05b99): (116, "WasmExceptionTagMap"),
("read_only_space", 0x05bc1): (117, "WasmIndirectFunctionTableMap"),
("read_only_space", 0x05be9): (135, "SloppyArgumentsElementsMap"),
("read_only_space", 0x05c11): (152, "DescriptorArrayMap"),
("read_only_space", 0x05c39): (157, "UncompiledDataWithoutPreparseDataMap"),
("read_only_space", 0x05c61): (156, "UncompiledDataWithPreparseDataMap"),
("read_only_space", 0x05c89): (173, "OnHeapBasicBlockProfilerDataMap"),
("read_only_space", 0x05cb1): (169, "InternalClassMap"),
("read_only_space", 0x05cd9): (180, "SmiPairMap"),
("read_only_space", 0x05d01): (179, "SmiBoxMap"),
("read_only_space", 0x05d29): (146, "ExportedSubClassBaseMap"),
("read_only_space", 0x05d51): (147, "ExportedSubClassMap"),
("read_only_space", 0x05d79): (68, "AbstractInternalClassSubclass1Map"),
("read_only_space", 0x05da1): (69, "AbstractInternalClassSubclass2Map"),
("read_only_space", 0x05dc9): (134, "InternalClassWithSmiElementsMap"),
("read_only_space", 0x05df1): (170, "InternalClassWithStructElementsMap"),
("read_only_space", 0x05e19): (148, "ExportedSubClass2Map"),
("read_only_space", 0x05e41): (181, "SortStateMap"),
("read_only_space", 0x05e69): (90, "AllocationSiteWithWeakNextMap"),
("read_only_space", 0x05e91): (90, "AllocationSiteWithoutWeakNextMap"),
("read_only_space", 0x05eb9): (81, "LoadHandler1Map"),
("read_only_space", 0x05ee1): (81, "LoadHandler2Map"),
("read_only_space", 0x05f09): (81, "LoadHandler3Map"),
("read_only_space", 0x05f31): (82, "StoreHandler0Map"),
("read_only_space", 0x05f59): (82, "StoreHandler1Map"),
("read_only_space", 0x05f81): (82, "StoreHandler2Map"),
("read_only_space", 0x05fa9): (82, "StoreHandler3Map"),
("read_only_space", 0x05bf1): (76, "PromiseFulfillReactionJobTaskMap"),
("read_only_space", 0x05c19): (77, "PromiseRejectReactionJobTaskMap"),
("read_only_space", 0x05c41): (78, "CallableTaskMap"),
("read_only_space", 0x05c69): (79, "CallbackTaskMap"),
("read_only_space", 0x05c91): (80, "PromiseResolveThenableJobTaskMap"),
("read_only_space", 0x05cb9): (83, "FunctionTemplateInfoMap"),
("read_only_space", 0x05ce1): (84, "ObjectTemplateInfoMap"),
("read_only_space", 0x05d09): (85, "AccessCheckInfoMap"),
("read_only_space", 0x05d31): (86, "AccessorInfoMap"),
("read_only_space", 0x05d59): (87, "AccessorPairMap"),
("read_only_space", 0x05d81): (88, "AliasedArgumentsEntryMap"),
("read_only_space", 0x05da9): (89, "AllocationMementoMap"),
("read_only_space", 0x05dd1): (92, "AsmWasmDataMap"),
("read_only_space", 0x05df9): (93, "AsyncGeneratorRequestMap"),
("read_only_space", 0x05e21): (94, "BreakPointMap"),
("read_only_space", 0x05e49): (95, "BreakPointInfoMap"),
("read_only_space", 0x05e71): (96, "CachedTemplateObjectMap"),
("read_only_space", 0x05e99): (98, "ClassPositionsMap"),
("read_only_space", 0x05ec1): (99, "DebugInfoMap"),
("read_only_space", 0x05ee9): (102, "FunctionTemplateRareDataMap"),
("read_only_space", 0x05f11): (104, "InterpreterDataMap"),
("read_only_space", 0x05f39): (105, "ModuleRequestMap"),
("read_only_space", 0x05f61): (106, "PromiseCapabilityMap"),
("read_only_space", 0x05f89): (107, "PromiseReactionMap"),
("read_only_space", 0x05fb1): (108, "PropertyDescriptorObjectMap"),
("read_only_space", 0x05fd9): (109, "PrototypeInfoMap"),
("read_only_space", 0x06001): (110, "RegExpBoilerplateDescriptionMap"),
("read_only_space", 0x06029): (111, "ScriptMap"),
("read_only_space", 0x06051): (112, "SourceTextModuleInfoEntryMap"),
("read_only_space", 0x06079): (113, "StackFrameInfoMap"),
("read_only_space", 0x060a1): (114, "TemplateObjectDescriptionMap"),
("read_only_space", 0x060c9): (115, "Tuple2Map"),
("read_only_space", 0x060f1): (116, "WasmExceptionTagMap"),
("read_only_space", 0x06119): (117, "WasmIndirectFunctionTableMap"),
("read_only_space", 0x06141): (135, "SloppyArgumentsElementsMap"),
("read_only_space", 0x06169): (152, "DescriptorArrayMap"),
("read_only_space", 0x06191): (157, "UncompiledDataWithoutPreparseDataMap"),
("read_only_space", 0x061b9): (156, "UncompiledDataWithPreparseDataMap"),
("read_only_space", 0x061e1): (173, "OnHeapBasicBlockProfilerDataMap"),
("read_only_space", 0x06209): (169, "InternalClassMap"),
("read_only_space", 0x06231): (180, "SmiPairMap"),
("read_only_space", 0x06259): (179, "SmiBoxMap"),
("read_only_space", 0x06281): (146, "ExportedSubClassBaseMap"),
("read_only_space", 0x062a9): (147, "ExportedSubClassMap"),
("read_only_space", 0x062d1): (68, "AbstractInternalClassSubclass1Map"),
("read_only_space", 0x062f9): (69, "AbstractInternalClassSubclass2Map"),
("read_only_space", 0x06321): (134, "InternalClassWithSmiElementsMap"),
("read_only_space", 0x06349): (170, "InternalClassWithStructElementsMap"),
("read_only_space", 0x06371): (148, "ExportedSubClass2Map"),
("read_only_space", 0x06399): (181, "SortStateMap"),
("read_only_space", 0x063c1): (90, "AllocationSiteWithWeakNextMap"),
("read_only_space", 0x063e9): (90, "AllocationSiteWithoutWeakNextMap"),
("read_only_space", 0x06411): (81, "LoadHandler1Map"),
("read_only_space", 0x06439): (81, "LoadHandler2Map"),
("read_only_space", 0x06461): (81, "LoadHandler3Map"),
("read_only_space", 0x06489): (82, "StoreHandler0Map"),
("read_only_space", 0x064b1): (82, "StoreHandler1Map"),
("read_only_space", 0x064d9): (82, "StoreHandler2Map"),
("read_only_space", 0x06501): (82, "StoreHandler3Map"),
("map_space", 0x02119): (1057, "ExternalMap"),
("map_space", 0x02141): (2113, "JSMessageObjectMap"),
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment