Torquefy a few simple types

JSDate, JSStringIterator, JSAsyncFromSyncIterator, JSDataPropertyDescriptor

Change-Id: Ia2cfd8fa61672fb4d6ec5082bae07e7add97fe60
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1500674
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#60041}
This commit is contained in:
Z Duong Nguyen-Huu 2019-03-05 10:27:40 -08:00 committed by Commit Bot
parent 5f4f57eb07
commit 6d1913faa7
2 changed files with 39 additions and 47 deletions

View File

@ -66,6 +66,9 @@ type Number = Smi | HeapNumber;
type BigInt extends HeapObject generates 'TNode<BigInt>';
type Numeric = Number | BigInt;
// The HeapNumber value NaN
type NaN extends HeapNumber;
extern class Struct extends HeapObject {}
extern class Tuple2 extends Struct {
@ -296,6 +299,35 @@ extern class JSAccessorPropertyDescriptor extends JSObject {
extern class JSCollection extends JSObject { table: Object; }
extern class JSDate extends JSObject {
value: NumberOrUndefined;
year: Undefined | Smi | NaN;
month: Undefined | Smi | NaN;
day: Undefined | Smi | NaN;
weekday: Undefined | Smi | NaN;
hour: Undefined | Smi | NaN;
min: Undefined | Smi | NaN;
sec: Undefined | Smi | NaN;
cache_stamp: Undefined | Smi | NaN;
}
extern class JSAsyncFromSyncIterator extends JSObject {
sync_iterator: JSReceiver;
next: Object;
}
extern class JSStringIterator extends JSObject {
string: String;
next_index: Smi;
}
extern class JSDataPropertyDescriptor extends JSObject {
value: Object;
writable: Object;
enumerable: Object;
configurable: Object;
}
type JSDataView extends JSArrayBufferView generates 'TNode<JSDataView>';
type InstanceType generates 'TNode<Int32T>' constexpr 'InstanceType';

View File

@ -846,18 +846,8 @@ class JSAccessorPropertyDescriptor : public JSObject {
// FromPropertyDescriptor function for regular data properties.
class JSDataPropertyDescriptor : public JSObject {
public:
// Layout description.
#define JS_DATA_PROPERTY_DESCRIPTOR_FIELDS(V) \
V(kValueOffset, kTaggedSize) \
V(kWritableOffset, kTaggedSize) \
V(kEnumerableOffset, kTaggedSize) \
V(kConfigurableOffset, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
JS_DATA_PROPERTY_DESCRIPTOR_FIELDS)
#undef JS_DATA_PROPERTY_DESCRIPTOR_FIELDS
DEFINE_FIELD_OFFSET_CONSTANTS(
JSObject::kHeaderSize, TORQUE_GENERATED_JSDATA_PROPERTY_DESCRIPTOR_FIELDS)
// Indices of in-object properties.
static const int kValueIndex = 0;
@ -1303,22 +1293,8 @@ class JSDate : public JSObject {
kTimezoneOffset
};
// Layout description.
#define JS_DATE_FIELDS(V) \
V(kValueOffset, kTaggedSize) \
V(kYearOffset, kTaggedSize) \
V(kMonthOffset, kTaggedSize) \
V(kDayOffset, kTaggedSize) \
V(kWeekdayOffset, kTaggedSize) \
V(kHourOffset, kTaggedSize) \
V(kMinOffset, kTaggedSize) \
V(kSecOffset, kTaggedSize) \
V(kCacheStampOffset, kTaggedSize) \
/* Header size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, JS_DATE_FIELDS)
#undef JS_DATE_FIELDS
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
TORQUE_GENERATED_JSDATE_FIELDS)
private:
inline Object DoGetField(FieldIndex index);
@ -1428,16 +1404,8 @@ class JSAsyncFromSyncIterator : public JSObject {
// subsequent "next" invocations.
DECL_ACCESSORS(next, Object)
// Layout description.
#define JS_ASYNC_FROM_SYNC_ITERATOR_FIELDS(V) \
V(kSyncIteratorOffset, kTaggedSize) \
V(kNextOffset, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
JS_ASYNC_FROM_SYNC_ITERATOR_FIELDS)
#undef JS_ASYNC_FROM_SYNC_ITERATOR_FIELDS
DEFINE_FIELD_OFFSET_CONSTANTS(
JSObject::kHeaderSize, TORQUE_GENERATED_JSASYNC_FROM_SYNC_ITERATOR_FIELDS)
OBJECT_CONSTRUCTORS(JSAsyncFromSyncIterator, JSObject);
};
@ -1457,16 +1425,8 @@ class JSStringIterator : public JSObject {
inline int index() const;
inline void set_index(int value);
// Layout description.
#define JS_STRING_ITERATOR_FIELDS(V) \
V(kStringOffset, kTaggedSize) \
V(kNextIndexOffset, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
JS_STRING_ITERATOR_FIELDS)
#undef JS_STRING_ITERATOR_FIELDS
TORQUE_GENERATED_JSSTRING_ITERATOR_FIELDS)
OBJECT_CONSTRUCTORS(JSStringIterator, JSObject);
};