Commit 29ec0087 authored by Seth Brenith's avatar Seth Brenith Committed by Commit Bot

[torque] Remove some uses of @noVerifier

Implemented verifiers for the following classes:
- ExternalString
- FixedArrayBase
- JSCollection
- JSCollectionIterator
- JSWeakCollection
- Name
- SeqString
- Struct

Removed the following class definitions from Torque, because they're
just JSObject instances with particular starting maps, as discussed in
https://crrev.com/c/v8/v8/+/1619146/6/src/builtins/base.tq#459 :
- JSAccessorPropertyDescriptor
- JSDataPropertyDescriptor
- JSIteratorResult

Following similar logic, removed the Torque definition of
WasmExceptionPackage because it's just an error object that happens to
have a couple of private-symbol properties.

The following classes should not be defined in Torque because they're
just a starting state for JSObject, but I'm leaving them for now because
existing Torque code requires them:
- JSArgumentsObjectWithLength
- JSProxyRevocableResult

Bug: v8:9311
Change-Id: I0336b6be7d02e48e4a8a0f660e24d2c2fa5f5e34
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1637448
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61970}
parent 877257a8
...@@ -90,7 +90,6 @@ type BigInt extends HeapObject generates 'TNode<BigInt>'; ...@@ -90,7 +90,6 @@ type BigInt extends HeapObject generates 'TNode<BigInt>';
type Numeric = Number | BigInt; type Numeric = Number | BigInt;
@abstract @abstract
@noVerifier
extern class Name extends HeapObject { extern class Name extends HeapObject {
hash_field: int32; hash_field: int32;
} }
...@@ -111,7 +110,6 @@ extern class ConsString extends String { ...@@ -111,7 +110,6 @@ extern class ConsString extends String {
} }
@abstract @abstract
@noVerifier
extern class ExternalString extends String { extern class ExternalString extends String {
resource: RawPtr; resource: RawPtr;
resource_data: RawPtr; resource_data: RawPtr;
...@@ -124,7 +122,6 @@ extern class InternalizedString extends String {} ...@@ -124,7 +122,6 @@ extern class InternalizedString extends String {}
// TODO(v8:8983): Add declaration for variable-sized region. // TODO(v8:8983): Add declaration for variable-sized region.
@abstract @abstract
@noVerifier
extern class SeqString extends String { extern class SeqString extends String {
} }
extern class SeqOneByteString extends SeqString {} extern class SeqOneByteString extends SeqString {}
...@@ -141,7 +138,6 @@ extern class ThinString extends String { actual: String; } ...@@ -141,7 +138,6 @@ extern class ThinString extends String { actual: String; }
type NaN extends HeapNumber; type NaN extends HeapNumber;
@abstract @abstract
@noVerifier
@generatePrint @generatePrint
@generateCppClass @generateCppClass
extern class Struct extends HeapObject { extern class Struct extends HeapObject {
...@@ -171,7 +167,6 @@ type DirectString extends String; ...@@ -171,7 +167,6 @@ type DirectString extends String;
type RootIndex generates 'TNode<Int32T>' constexpr 'RootIndex'; type RootIndex generates 'TNode<Int32T>' constexpr 'RootIndex';
@abstract @abstract
@noVerifier
@generateCppClass @generateCppClass
extern class FixedArrayBase extends HeapObject { extern class FixedArrayBase extends HeapObject {
length: Smi; length: Smi;
...@@ -341,6 +336,7 @@ extern class JSProxy extends JSReceiver { ...@@ -341,6 +336,7 @@ extern class JSProxy extends JSReceiver {
handler: Object; handler: Object;
} }
// Just a starting shape for JSObject; properties can move after initialization.
@noVerifier @noVerifier
extern class JSProxyRevocableResult extends JSObject { extern class JSProxyRevocableResult extends JSObject {
proxy: Object; proxy: Object;
...@@ -363,11 +359,15 @@ extern class JSGlobalProxy extends JSObject { native_context: Object; } ...@@ -363,11 +359,15 @@ extern class JSGlobalProxy extends JSObject { native_context: Object; }
extern class JSValue extends JSObject { value: Object; } extern class JSValue extends JSObject { value: Object; }
extern class JSArgumentsObject extends JSObject {} extern class JSArgumentsObject extends JSObject {}
// Just a starting shape for JSObject; properties can move after initialization.
@noVerifier @noVerifier
@hasSameInstanceTypeAsParent @hasSameInstanceTypeAsParent
extern class JSArgumentsObjectWithLength extends JSArgumentsObject { extern class JSArgumentsObjectWithLength extends JSArgumentsObject {
length: Object; length: Object;
} }
// Just a starting shape for JSObject; properties can move after initialization.
@hasSameInstanceTypeAsParent @hasSameInstanceTypeAsParent
extern class JSSloppyArgumentsObject extends JSArgumentsObjectWithLength { extern class JSSloppyArgumentsObject extends JSArgumentsObjectWithLength {
callee: Object; callee: Object;
...@@ -451,14 +451,12 @@ extern class CallHandlerInfo extends Struct { ...@@ -451,14 +451,12 @@ extern class CallHandlerInfo extends Struct {
type JSModuleNamespace extends JSObject; type JSModuleNamespace extends JSObject;
@abstract @abstract
@noVerifier
extern class JSWeakCollection extends JSObject { extern class JSWeakCollection extends JSObject {
table: Object; table: Object;
} }
extern class JSWeakSet extends JSWeakCollection {} extern class JSWeakSet extends JSWeakCollection {}
extern class JSWeakMap extends JSWeakCollection {} extern class JSWeakMap extends JSWeakCollection {}
@noVerifier
extern class JSCollectionIterator extends JSObject { extern class JSCollectionIterator extends JSObject {
table: Object; table: Object;
index: Object; index: Object;
...@@ -651,16 +649,7 @@ extern class JSTypedArray extends JSArrayBufferView { ...@@ -651,16 +649,7 @@ extern class JSTypedArray extends JSArrayBufferView {
base_pointer: ByteArray | Smi; base_pointer: ByteArray | Smi;
} }
@noVerifier
extern class JSAccessorPropertyDescriptor extends JSObject {
get: Object;
set: Object;
enumerable: Object;
configurable: Object;
}
@abstract @abstract
@noVerifier
extern class JSCollection extends JSObject { extern class JSCollection extends JSObject {
table: Object; table: Object;
} }
...@@ -694,14 +683,6 @@ extern class JSStringIterator extends JSObject { ...@@ -694,14 +683,6 @@ extern class JSStringIterator extends JSObject {
next_index: Smi; next_index: Smi;
} }
@noVerifier
extern class JSDataPropertyDescriptor extends JSObject {
value: Object;
writable: Object;
enumerable: Object;
configurable: Object;
}
@abstract @abstract
extern class TemplateInfo extends Struct { extern class TemplateInfo extends Struct {
tag: Object; tag: Object;
...@@ -1173,22 +1154,8 @@ extern class JSRegExp extends JSObject { ...@@ -1173,22 +1154,8 @@ extern class JSRegExp extends JSObject {
flags: Smi | Undefined; flags: Smi | Undefined;
} }
@noVerifier extern transitioning macro AllocateJSIteratorResult(implicit context: Context)(
extern class JSIteratorResult extends JSObject { Object, Boolean): JSObject;
value: Object;
done: Boolean;
}
macro NewJSIteratorResult(implicit context: Context)(
value: Object, done: Boolean): JSIteratorResult {
return new JSIteratorResult{
map: GetIteratorResultMap(),
properties_or_hash: kEmptyFixedArray,
elements: kEmptyFixedArray,
value,
done
};
}
// Note: Although a condition for a FastJSRegExp is having a positive smi // Note: Although a condition for a FastJSRegExp is having a positive smi
// lastIndex (see RegExpBuiltinsAssembler::BranchIfFastRegExp), it is possible // lastIndex (see RegExpBuiltinsAssembler::BranchIfFastRegExp), it is possible
...@@ -1332,10 +1299,6 @@ extern class WasmExceptionObject extends JSObject { ...@@ -1332,10 +1299,6 @@ extern class WasmExceptionObject extends JSObject {
exception_tag: HeapObject; exception_tag: HeapObject;
} }
@noVerifier
extern class WasmExceptionPackage extends JSReceiver {
}
type WasmExportedFunction extends JSFunction; type WasmExportedFunction extends JSFunction;
extern class AsmWasmData extends Struct { extern class AsmWasmData extends Struct {
......
...@@ -26,7 +26,7 @@ namespace string_iterator { ...@@ -26,7 +26,7 @@ namespace string_iterator {
// ES6 #sec-%stringiteratorprototype%.next // ES6 #sec-%stringiteratorprototype%.next
transitioning javascript builtin StringIteratorPrototypeNext( transitioning javascript builtin StringIteratorPrototypeNext(
implicit context: Context)(receiver: Object): JSIteratorResult { implicit context: Context)(receiver: Object): JSObject {
const iterator = Cast<JSStringIterator>(receiver) otherwise ThrowTypeError( const iterator = Cast<JSStringIterator>(receiver) otherwise ThrowTypeError(
kIncompatibleMethodReceiver, 'String Iterator.prototype.next', kIncompatibleMethodReceiver, 'String Iterator.prototype.next',
receiver); receiver);
...@@ -34,13 +34,13 @@ namespace string_iterator { ...@@ -34,13 +34,13 @@ namespace string_iterator {
const position: intptr = SmiUntag(iterator.next_index); const position: intptr = SmiUntag(iterator.next_index);
const length: intptr = string.length_intptr; const length: intptr = string.length_intptr;
if (position >= length) { if (position >= length) {
return NewJSIteratorResult(Undefined, True); return AllocateJSIteratorResult(Undefined, True);
} }
// Move to next codepoint. // Move to next codepoint.
const encoding = UTF16; const encoding = UTF16;
const ch = string::LoadSurrogatePairAt(string, length, position, encoding); const ch = string::LoadSurrogatePairAt(string, length, position, encoding);
const value: String = string::StringFromSingleCodePoint(ch, encoding); const value: String = string::StringFromSingleCodePoint(ch, encoding);
iterator.next_index = SmiTag(position + value.length_intptr); iterator.next_index = SmiTag(position + value.length_intptr);
return NewJSIteratorResult(value, False); return AllocateJSIteratorResult(value, False);
} }
} }
...@@ -153,6 +153,10 @@ void HeapObject::HeapObjectVerify(Isolate* isolate) { ...@@ -153,6 +153,10 @@ void HeapObject::HeapObjectVerify(Isolate* isolate) {
SlicedString::cast(*this).SlicedStringVerify(isolate); SlicedString::cast(*this).SlicedStringVerify(isolate);
} else if (IsThinString()) { } else if (IsThinString()) {
ThinString::cast(*this).ThinStringVerify(isolate); ThinString::cast(*this).ThinStringVerify(isolate);
} else if (IsSeqString()) {
SeqString::cast(*this).SeqStringVerify(isolate);
} else if (IsExternalString()) {
ExternalString::cast(*this).ExternalStringVerify(isolate);
} else { } else {
String::cast(*this).StringVerify(isolate); String::cast(*this).StringVerify(isolate);
} }
...@@ -703,6 +707,10 @@ void EmbedderDataArray::EmbedderDataArrayVerify(Isolate* isolate) { ...@@ -703,6 +707,10 @@ void EmbedderDataArray::EmbedderDataArrayVerify(Isolate* isolate) {
} }
} }
USE_TORQUE_VERIFIER(Struct)
USE_TORQUE_VERIFIER(FixedArrayBase)
USE_TORQUE_VERIFIER(FixedArray) USE_TORQUE_VERIFIER(FixedArray)
void WeakFixedArray::WeakFixedArrayVerify(Isolate* isolate) { void WeakFixedArray::WeakFixedArrayVerify(Isolate* isolate) {
...@@ -954,6 +962,8 @@ void JSMessageObject::JSMessageObjectVerify(Isolate* isolate) { ...@@ -954,6 +962,8 @@ void JSMessageObject::JSMessageObjectVerify(Isolate* isolate) {
VerifySmiField(kErrorLevelOffset); VerifySmiField(kErrorLevelOffset);
} }
USE_TORQUE_VERIFIER(Name)
void String::StringVerify(Isolate* isolate) { void String::StringVerify(Isolate* isolate) {
TorqueGeneratedClassVerifiers::StringVerify(*this, isolate); TorqueGeneratedClassVerifiers::StringVerify(*this, isolate);
CHECK(length() >= 0 && length() <= Smi::kMaxValue); CHECK(length() >= 0 && length() <= Smi::kMaxValue);
...@@ -988,6 +998,10 @@ void SlicedString::SlicedStringVerify(Isolate* isolate) { ...@@ -988,6 +998,10 @@ void SlicedString::SlicedStringVerify(Isolate* isolate) {
CHECK_GE(this->length(), SlicedString::kMinLength); CHECK_GE(this->length(), SlicedString::kMinLength);
} }
USE_TORQUE_VERIFIER(SeqString)
USE_TORQUE_VERIFIER(ExternalString)
void JSBoundFunction::JSBoundFunctionVerify(Isolate* isolate) { void JSBoundFunction::JSBoundFunctionVerify(Isolate* isolate) {
TorqueGeneratedClassVerifiers::JSBoundFunctionVerify(*this, isolate); TorqueGeneratedClassVerifiers::JSBoundFunctionVerify(*this, isolate);
CHECK(IsCallable()); CHECK(IsCallable());
...@@ -1212,32 +1226,32 @@ void JSArray::JSArrayVerify(Isolate* isolate) { ...@@ -1212,32 +1226,32 @@ void JSArray::JSArrayVerify(Isolate* isolate) {
} }
} }
USE_TORQUE_VERIFIER(JSCollection)
void JSSet::JSSetVerify(Isolate* isolate) { void JSSet::JSSetVerify(Isolate* isolate) {
TorqueGeneratedClassVerifiers::JSSetVerify(*this, isolate); TorqueGeneratedClassVerifiers::JSSetVerify(*this, isolate);
VerifyHeapPointer(isolate, table());
CHECK(table().IsOrderedHashSet() || table().IsUndefined(isolate)); CHECK(table().IsOrderedHashSet() || table().IsUndefined(isolate));
// TODO(arv): Verify OrderedHashTable too. // TODO(arv): Verify OrderedHashTable too.
} }
void JSMap::JSMapVerify(Isolate* isolate) { void JSMap::JSMapVerify(Isolate* isolate) {
TorqueGeneratedClassVerifiers::JSMapVerify(*this, isolate); TorqueGeneratedClassVerifiers::JSMapVerify(*this, isolate);
VerifyHeapPointer(isolate, table());
CHECK(table().IsOrderedHashMap() || table().IsUndefined(isolate)); CHECK(table().IsOrderedHashMap() || table().IsUndefined(isolate));
// TODO(arv): Verify OrderedHashTable too. // TODO(arv): Verify OrderedHashTable too.
} }
USE_TORQUE_VERIFIER(JSCollectionIterator)
void JSSetIterator::JSSetIteratorVerify(Isolate* isolate) { void JSSetIterator::JSSetIteratorVerify(Isolate* isolate) {
CHECK(IsJSSetIterator()); CHECK(IsJSSetIterator());
JSObjectVerify(isolate); JSCollectionIteratorVerify(isolate);
VerifyHeapPointer(isolate, table());
CHECK(table().IsOrderedHashSet()); CHECK(table().IsOrderedHashSet());
CHECK(index().IsSmi()); CHECK(index().IsSmi());
} }
void JSMapIterator::JSMapIteratorVerify(Isolate* isolate) { void JSMapIterator::JSMapIteratorVerify(Isolate* isolate) {
CHECK(IsJSMapIterator()); CHECK(IsJSMapIterator());
JSObjectVerify(isolate); JSCollectionIteratorVerify(isolate);
VerifyHeapPointer(isolate, table());
CHECK(table().IsOrderedHashMap()); CHECK(table().IsOrderedHashMap());
CHECK(index().IsSmi()); CHECK(index().IsSmi());
} }
...@@ -1312,7 +1326,6 @@ void FinalizationGroupCleanupJobTask::FinalizationGroupCleanupJobTaskVerify( ...@@ -1312,7 +1326,6 @@ void FinalizationGroupCleanupJobTask::FinalizationGroupCleanupJobTaskVerify(
void JSWeakMap::JSWeakMapVerify(Isolate* isolate) { void JSWeakMap::JSWeakMapVerify(Isolate* isolate) {
TorqueGeneratedClassVerifiers::JSWeakMapVerify(*this, isolate); TorqueGeneratedClassVerifiers::JSWeakMapVerify(*this, isolate);
VerifyHeapPointer(isolate, table());
CHECK(table().IsEphemeronHashTable() || table().IsUndefined(isolate)); CHECK(table().IsEphemeronHashTable() || table().IsUndefined(isolate));
} }
...@@ -1343,9 +1356,10 @@ void JSStringIterator::JSStringIteratorVerify(Isolate* isolate) { ...@@ -1343,9 +1356,10 @@ void JSStringIterator::JSStringIteratorVerify(Isolate* isolate) {
USE_TORQUE_VERIFIER(JSAsyncFromSyncIterator) USE_TORQUE_VERIFIER(JSAsyncFromSyncIterator)
USE_TORQUE_VERIFIER(JSWeakCollection)
void JSWeakSet::JSWeakSetVerify(Isolate* isolate) { void JSWeakSet::JSWeakSetVerify(Isolate* isolate) {
TorqueGeneratedClassVerifiers::JSWeakSetVerify(*this, isolate); TorqueGeneratedClassVerifiers::JSWeakSetVerify(*this, isolate);
VerifyHeapPointer(isolate, table());
CHECK(table().IsEphemeronHashTable() || table().IsUndefined(isolate)); CHECK(table().IsEphemeronHashTable() || table().IsUndefined(isolate));
} }
......
...@@ -82,6 +82,7 @@ class FixedArrayBase : public HeapObject { ...@@ -82,6 +82,7 @@ class FixedArrayBase : public HeapObject {
inline Object unchecked_synchronized_length() const; inline Object unchecked_synchronized_length() const;
DECL_CAST(FixedArrayBase) DECL_CAST(FixedArrayBase)
DECL_VERIFIER(FixedArrayBase)
static int GetMaxLengthForNewSpaceAllocation(ElementsKind kind); static int GetMaxLengthForNewSpaceAllocation(ElementsKind kind);
......
...@@ -25,6 +25,7 @@ class JSCollectionIterator : public JSObject { ...@@ -25,6 +25,7 @@ class JSCollectionIterator : public JSObject {
DECL_ACCESSORS(index, Object) DECL_ACCESSORS(index, Object)
void JSCollectionIteratorPrint(std::ostream& os, const char* name); void JSCollectionIteratorPrint(std::ostream& os, const char* name);
DECL_VERIFIER(JSCollectionIterator)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
TORQUE_GENERATED_JSCOLLECTION_ITERATOR_FIELDS) TORQUE_GENERATED_JSCOLLECTION_ITERATOR_FIELDS)
......
...@@ -30,6 +30,8 @@ class JSCollection : public JSObject { ...@@ -30,6 +30,8 @@ class JSCollection : public JSObject {
static const int kAddFunctionDescriptorIndex = 3; static const int kAddFunctionDescriptorIndex = 3;
DECL_VERIFIER(JSCollection)
OBJECT_CONSTRUCTORS(JSCollection, JSObject); OBJECT_CONSTRUCTORS(JSCollection, JSObject);
}; };
...@@ -114,6 +116,8 @@ class JSWeakCollection : public JSObject { ...@@ -114,6 +116,8 @@ class JSWeakCollection : public JSObject {
static Handle<JSArray> GetEntries(Handle<JSWeakCollection> holder, static Handle<JSArray> GetEntries(Handle<JSWeakCollection> holder,
int max_entries); int max_entries);
DECL_VERIFIER(JSWeakCollection)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
TORQUE_GENERATED_JSWEAK_COLLECTION_FIELDS) TORQUE_GENERATED_JSWEAK_COLLECTION_FIELDS)
......
...@@ -835,9 +835,17 @@ class JSObject : public JSReceiver { ...@@ -835,9 +835,17 @@ class JSObject : public JSReceiver {
class JSAccessorPropertyDescriptor : public JSObject { class JSAccessorPropertyDescriptor : public JSObject {
public: public:
// Layout description. // Layout description.
DEFINE_FIELD_OFFSET_CONSTANTS( #define JS_ACCESSOR_PROPERTY_DESCRIPTOR_FIELDS(V) \
JSObject::kHeaderSize, V(kGetOffset, kTaggedSize) \
TORQUE_GENERATED_JSACCESSOR_PROPERTY_DESCRIPTOR_FIELDS) V(kSetOffset, kTaggedSize) \
V(kEnumerableOffset, kTaggedSize) \
V(kConfigurableOffset, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
JS_ACCESSOR_PROPERTY_DESCRIPTOR_FIELDS)
#undef JS_ACCESSOR_PROPERTY_DESCRIPTOR_FIELDS
// Indices of in-object properties. // Indices of in-object properties.
static const int kGetIndex = 0; static const int kGetIndex = 0;
...@@ -855,8 +863,18 @@ class JSAccessorPropertyDescriptor : public JSObject { ...@@ -855,8 +863,18 @@ class JSAccessorPropertyDescriptor : public JSObject {
// FromPropertyDescriptor function for regular data properties. // FromPropertyDescriptor function for regular data properties.
class JSDataPropertyDescriptor : public JSObject { class JSDataPropertyDescriptor : public JSObject {
public: public:
DEFINE_FIELD_OFFSET_CONSTANTS( // Layout description.
JSObject::kHeaderSize, TORQUE_GENERATED_JSDATA_PROPERTY_DESCRIPTOR_FIELDS) #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
// Indices of in-object properties. // Indices of in-object properties.
static const int kValueIndex = 0; static const int kValueIndex = 0;
...@@ -870,7 +888,7 @@ class JSDataPropertyDescriptor : public JSObject { ...@@ -870,7 +888,7 @@ class JSDataPropertyDescriptor : public JSObject {
// JSIteratorResult is just a JSObject with a specific initial map. // JSIteratorResult is just a JSObject with a specific initial map.
// This initial map adds in-object properties for "done" and "value", // This initial map adds in-object properties for "done" and "value",
// as specified by ES6 section 25.1.1.3 The IteratorResult Interface // as specified by ES6 section 25.1.1.3 The IteratorResult Interface.
class JSIteratorResult : public JSObject { class JSIteratorResult : public JSObject {
public: public:
DECL_ACCESSORS(value, Object) DECL_ACCESSORS(value, Object)
...@@ -878,8 +896,15 @@ class JSIteratorResult : public JSObject { ...@@ -878,8 +896,15 @@ class JSIteratorResult : public JSObject {
DECL_ACCESSORS(done, Object) DECL_ACCESSORS(done, Object)
// Layout description. // Layout description.
#define JS_ITERATOR_RESULT_FIELDS(V) \
V(kValueOffset, kTaggedSize) \
V(kDoneOffset, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
TORQUE_GENERATED_JSITERATOR_RESULT_FIELDS) JS_ITERATOR_RESULT_FIELDS)
#undef JS_ITERATOR_RESULT_FIELDS
// Indices of in-object properties. // Indices of in-object properties.
static const int kValueIndex = 0; static const int kValueIndex = 0;
......
...@@ -67,6 +67,7 @@ class Name : public HeapObject { ...@@ -67,6 +67,7 @@ class Name : public HeapObject {
DECL_PRINTER(Name) DECL_PRINTER(Name)
void NameShortPrint(); void NameShortPrint();
int NameShortPrint(Vector<char> str); int NameShortPrint(Vector<char> str);
DECL_VERIFIER(Name)
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
TORQUE_GENERATED_NAME_FIELDS) TORQUE_GENERATED_NAME_FIELDS)
......
...@@ -134,6 +134,7 @@ class ZoneForwardList; ...@@ -134,6 +134,7 @@ class ZoneForwardList;
V(JSAsyncGeneratorObject) \ V(JSAsyncGeneratorObject) \
V(JSBoundFunction) \ V(JSBoundFunction) \
V(JSCollection) \ V(JSCollection) \
V(JSCollectionIterator) \
V(JSContextExtensionObject) \ V(JSContextExtensionObject) \
V(JSDataView) \ V(JSDataView) \
V(JSDate) \ V(JSDate) \
......
...@@ -309,6 +309,10 @@ bool HeapObject::IsJSArrayBufferView() const { ...@@ -309,6 +309,10 @@ bool HeapObject::IsJSArrayBufferView() const {
return IsJSDataView() || IsJSTypedArray(); return IsJSDataView() || IsJSTypedArray();
} }
bool HeapObject::IsJSCollectionIterator() const {
return IsJSMapIterator() || IsJSSetIterator();
}
bool HeapObject::IsStringSet() const { return IsHashTable(); } bool HeapObject::IsStringSet() const { return IsHashTable(); }
bool HeapObject::IsObjectHashSet() const { return IsHashTable(); } bool HeapObject::IsObjectHashSet() const { return IsHashTable(); }
......
...@@ -480,6 +480,7 @@ class SubStringRange { ...@@ -480,6 +480,7 @@ class SubStringRange {
class SeqString : public String { class SeqString : public String {
public: public:
DECL_CAST(SeqString) DECL_CAST(SeqString)
DECL_VERIFIER(SeqString)
// Truncate the string in-place if possible and return the result. // Truncate the string in-place if possible and return the result.
// In case of new_length == 0, the empty string is returned without // In case of new_length == 0, the empty string is returned without
...@@ -705,6 +706,7 @@ class SlicedString : public String { ...@@ -705,6 +706,7 @@ class SlicedString : public String {
class ExternalString : public String { class ExternalString : public String {
public: public:
DECL_CAST(ExternalString) DECL_CAST(ExternalString)
DECL_VERIFIER(ExternalString)
DEFINE_FIELD_OFFSET_CONSTANTS(String::kHeaderSize, DEFINE_FIELD_OFFSET_CONSTANTS(String::kHeaderSize,
TORQUE_GENERATED_EXTERNAL_STRING_FIELDS) TORQUE_GENERATED_EXTERNAL_STRING_FIELDS)
......
...@@ -22,6 +22,7 @@ class Struct : public TorqueGeneratedStruct<Struct, HeapObject> { ...@@ -22,6 +22,7 @@ class Struct : public TorqueGeneratedStruct<Struct, HeapObject> {
public: public:
inline void InitializeBody(int object_size); inline void InitializeBody(int object_size);
void BriefPrintDetails(std::ostream& os); void BriefPrintDetails(std::ostream& os);
DECL_VERIFIER(Struct)
TQ_OBJECT_CONSTRUCTORS(Struct) TQ_OBJECT_CONSTRUCTORS(Struct)
}; };
......
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