Commit e2c3db17 authored by Z Duong Nguyen-Huu's avatar Z Duong Nguyen-Huu Committed by Commit Bot

Torquefy some simple types

Script, PrototypeInfo, JSCollectionIterator, JSWeakCollection, JSSloppyArgumentsObject, JSArgumentsObject

Bug: v8:8952
Change-Id: Id0d7049f3d5971a0fd4af56dd4850ad3b44c22e9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1506198
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60133}
parent b0ebd51e
......@@ -138,7 +138,13 @@ extern class JSGlobalProxy extends JSObject { native_context: Object; }
extern class JSValue extends JSObject { value: Object; }
extern class JSArgumentsObjectWithLength extends JSObject { length: Object; }
extern class JSArgumentsObject extends JSObject {}
extern class JSArgumentsObjectWithLength extends JSArgumentsObject {
length: Object;
}
extern class JSSloppyArgumentsObject extends JSArgumentsObjectWithLength {
callee: Object;
}
extern class JSArray extends JSObject {
IsEmpty(): bool {
......@@ -172,7 +178,43 @@ transient type FastJSArrayForCopy extends FastJSArray;
transient type FastJSArrayWithNoCustomIteration extends FastJSArray;
type NoSharedNameSentinel extends Smi;
type Script extends HeapObject;
type JSModuleNamespace extends JSObject;
type WeakArrayList extends HeapObject;
extern class JSWeakCollection extends JSObject { table: Object; }
extern class JSCollectionIterator extends JSObject {
table: Object;
index: Object;
}
extern class PrototypeInfo extends Struct {
js_module_namespace: JSModuleNamespace | Undefined;
prototype_users: WeakArrayList | Zero;
registry_slot: Smi;
validity_cell: Object;
object_create_map: Smi | WeakArrayList;
bit_field: Smi;
}
extern class Script extends Struct {
source: Object;
name: Object;
line_offset: Smi;
column_offset: Smi;
context: Object;
script_type: Smi;
line_ends: Object;
id: Smi;
eval_from_shared_or_wrapped_arguments: Object;
eval_from_position: Smi;
shared_function_infos: Object;
flags: Smi;
source_url: Object;
source_mapping_url: Object;
host_defined_options: Object;
}
type DebugInfo extends HeapObject;
type ScopeInfo extends Object generates 'TNode<ScopeInfo>';
......
......@@ -2040,6 +2040,12 @@ void Script::ScriptVerify(Isolate* isolate) {
(maybe_object->GetHeapObjectIfStrong(&heap_object) &&
heap_object->IsUndefined(isolate)));
}
VerifySmiField(kIdOffset);
VerifySmiField(kLineOffsetOffset);
VerifySmiField(kColumnOffsetOffset);
VerifySmiField(kScriptTypeOffset);
VerifySmiField(kEvalFromPositionOffset);
VerifySmiField(kFlagsOffset);
}
void NormalizedMapCache::NormalizedMapCacheVerify(Isolate* isolate) {
......
......@@ -48,14 +48,9 @@ class JSArgumentsObjectWithLength : public JSArgumentsObject {
// This initial map adds in-object properties for "length" and "callee".
class JSSloppyArgumentsObject : public JSArgumentsObjectWithLength {
public:
// Layout description.
#define JS_SLOPPY_ARGUMENTS_OBJECT_FIELDS(V) \
V(kCalleeOffset, kTaggedSize) \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSArgumentsObjectWithLength::kSize,
JS_SLOPPY_ARGUMENTS_OBJECT_FIELDS)
#undef JS_SLOPPY_ARGUMENTS_OBJECT_FIELDS
DEFINE_FIELD_OFFSET_CONSTANTS(
JSArgumentsObjectWithLength::kSize,
TORQUE_GENERATED_JSSLOPPY_ARGUMENTS_OBJECT_FIELDS)
// Indices of in-object properties.
static const int kCalleeIndex = kLengthIndex + 1;
......
......@@ -104,15 +104,8 @@ class JSWeakCollection : public JSObject {
static Handle<JSArray> GetEntries(Handle<JSWeakCollection> holder,
int max_entries);
// Layout description.
#define JS_WEAK_COLLECTION_FIELDS(V) \
V(kTableOffset, kTaggedSize) \
/* Header size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
JS_WEAK_COLLECTION_FIELDS)
#undef JS_WEAK_COLLECTION_FIELDS
TORQUE_GENERATED_JSWEAK_COLLECTION_FIELDS)
static const int kAddFunctionDescriptorIndex = 3;
......
......@@ -811,16 +811,8 @@ class JSCollectionIterator : public JSObject {
void JSCollectionIteratorPrint(std::ostream& os, const char* name);
// Layout description.
#define JS_COLLECTION_ITERATOR_FIELDS(V) \
V(kTableOffset, kTaggedSize) \
V(kIndexOffset, kTaggedSize) \
/* Header size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize,
JS_COLLECTION_ITERATOR_FIELDS)
#undef JS_COLLECTION_ITERATOR_FIELDS
TORQUE_GENERATED_JSCOLLECTION_ITERATOR_FIELDS)
OBJECT_CONSTRUCTORS(JSCollectionIterator, JSObject);
};
......
......@@ -39,7 +39,7 @@ bool PrototypeInfo::HasObjectCreateMap() {
return cache->IsWeak();
}
ACCESSORS(PrototypeInfo, module_namespace, Object, kJSModuleNamespaceOffset)
ACCESSORS(PrototypeInfo, module_namespace, Object, kJsModuleNamespaceOffset)
ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset)
WEAK_ACCESSORS(PrototypeInfo, object_create_map, kObjectCreateMapOffset)
SMI_ACCESSORS(PrototypeInfo, registry_slot, kRegistrySlotOffset)
......
......@@ -53,19 +53,8 @@ class PrototypeInfo : public Struct {
DECL_PRINTER(PrototypeInfo)
DECL_VERIFIER(PrototypeInfo)
// Layout description.
#define PROTOTYPE_INFO_FIELDS(V) \
V(kJSModuleNamespaceOffset, kTaggedSize) \
V(kPrototypeUsersOffset, kTaggedSize) \
V(kRegistrySlotOffset, kTaggedSize) \
V(kValidityCellOffset, kTaggedSize) \
V(kObjectCreateMapOffset, kTaggedSize) \
V(kBitFieldOffset, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, PROTOTYPE_INFO_FIELDS)
#undef PROTOTYPE_INFO_FIELDS
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
TORQUE_GENERATED_PROTOTYPE_INFO_FIELDS)
// Bit field usage.
static const int kShouldBeFastBit = 0;
......
......@@ -29,7 +29,7 @@ SMI_ACCESSORS(Script, id, kIdOffset)
SMI_ACCESSORS(Script, line_offset, kLineOffsetOffset)
SMI_ACCESSORS(Script, column_offset, kColumnOffsetOffset)
ACCESSORS(Script, context_data, Object, kContextOffset)
SMI_ACCESSORS(Script, type, kTypeOffset)
SMI_ACCESSORS(Script, type, kScriptTypeOffset)
ACCESSORS(Script, line_ends, Object, kLineEndsOffset)
ACCESSORS_CHECKED(Script, eval_from_shared_or_wrapped_arguments, Object,
kEvalFromSharedOrWrappedArgumentsOffset,
......
......@@ -189,28 +189,8 @@ class Script : public Struct {
DECL_PRINTER(Script)
DECL_VERIFIER(Script)
// Layout description.
#define SCRIPTS_FIELDS(V) \
V(kSourceOffset, kTaggedSize) \
V(kNameOffset, kTaggedSize) \
V(kLineOffsetOffset, kTaggedSize) \
V(kColumnOffsetOffset, kTaggedSize) \
V(kContextOffset, kTaggedSize) \
V(kTypeOffset, kTaggedSize) \
V(kLineEndsOffset, kTaggedSize) \
V(kIdOffset, kTaggedSize) \
V(kEvalFromSharedOrWrappedArgumentsOffset, kTaggedSize) \
V(kEvalFromPositionOffset, kTaggedSize) \
V(kSharedFunctionInfosOffset, kTaggedSize) \
V(kFlagsOffset, kTaggedSize) \
V(kSourceUrlOffset, kTaggedSize) \
V(kSourceMappingUrlOffset, kTaggedSize) \
V(kHostDefinedOptionsOffset, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, SCRIPTS_FIELDS)
#undef SCRIPTS_FIELDS
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
TORQUE_GENERATED_SCRIPT_FIELDS)
private:
// Bit positions in the flags field.
......
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