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

Torquefy some simple types

TemplateInfo, FunctionTemplateRareData, FunctionTemplateInfo, ObjectTemplateInfo

Bug: v8:8952
Change-Id: Ib355cf825ca8c57be45d3a55ff595d356c8737ce
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1504774Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#60130}
parent 4706fa71
......@@ -331,6 +331,41 @@ extern class JSDataPropertyDescriptor extends JSObject {
configurable: Object;
}
extern class TemplateInfo extends Struct {
tag: Object;
serial_number: Object;
number_of_properties: Smi;
property_list: Object;
property_accessors: Object;
}
extern class FunctionTemplateRareData extends Struct {
prototype_template: Object;
prototype_provider_template: Object;
parent_template: Object;
named_property_handler: Object;
indexed_property_handler: Object;
instance_template: Object;
instance_call_handler: Object;
access_check_info: Object;
}
extern class FunctionTemplateInfo extends TemplateInfo {
call_code: Object;
class_name: Object;
signature: Object;
function_template_rare_data: Object;
shared_function_info: Object;
flag: Smi;
length: Smi;
cached_property_name: Object;
}
extern class ObjectTemplateInfo extends TemplateInfo {
constructor: Object;
data: Object;
}
type JSDataView extends JSArrayBufferView generates 'TNode<JSDataView>';
type InstanceType generates 'TNode<Int32T>' constexpr 'InstanceType';
......
......@@ -26,7 +26,7 @@ NEVER_READ_ONLY_SPACE_IMPL(TemplateInfo)
ACCESSORS(TemplateInfo, tag, Object, kTagOffset)
ACCESSORS(TemplateInfo, serial_number, Object, kSerialNumberOffset)
SMI_ACCESSORS(TemplateInfo, number_of_properties, kNumberOfProperties)
SMI_ACCESSORS(TemplateInfo, number_of_properties, kNumberOfPropertiesOffset)
ACCESSORS(TemplateInfo, property_list, Object, kPropertyListOffset)
ACCESSORS(TemplateInfo, property_accessors, Object, kPropertyAccessorsOffset)
......
......@@ -26,18 +26,8 @@ class TemplateInfo : public Struct {
DECL_CAST(TemplateInfo)
// Layout description.
#define TEMPLATE_INFO_FIELDS(V) \
V(kTagOffset, kTaggedSize) \
V(kSerialNumberOffset, kTaggedSize) \
V(kNumberOfProperties, kTaggedSize) \
V(kPropertyListOffset, kTaggedSize) \
V(kPropertyAccessorsOffset, kTaggedSize) \
/* Header size. */ \
V(kHeaderSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, TEMPLATE_INFO_FIELDS)
#undef TEMPLATE_INFO_FIELDS
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
TORQUE_GENERATED_TEMPLATE_INFO_FIELDS)
static const int kFastTemplateInstantiationsCacheSize = 1 * KB;
......@@ -68,21 +58,9 @@ class FunctionTemplateRareData : public Struct {
DECL_PRINTER(FunctionTemplateRareData)
DECL_VERIFIER(FunctionTemplateRareData)
// Layout description.
#define SYMBOL_FIELDS(V) \
V(kPrototypeTemplateOffset, kTaggedSize) \
V(kPrototypeProviderTemplateOffset, kTaggedSize) \
V(kParentTemplateOffset, kTaggedSize) \
V(kNamedPropertyHandlerOffset, kTaggedSize) \
V(kIndexedPropertyHandlerOffset, kTaggedSize) \
V(kInstanceTemplateOffset, kTaggedSize) \
V(kInstanceCallHandlerOffset, kTaggedSize) \
V(kAccessCheckInfoOffset, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, SYMBOL_FIELDS)
#undef SYMBOL_FIELDS
DEFINE_FIELD_OFFSET_CONSTANTS(
HeapObject::kHeaderSize,
TORQUE_GENERATED_FUNCTION_TEMPLATE_RARE_DATA_FIELDS)
OBJECT_CONSTRUCTORS(FunctionTemplateRareData, Struct);
};
......@@ -191,22 +169,8 @@ class FunctionTemplateInfo : public TemplateInfo {
static const int kInvalidSerialNumber = 0;
// Layout description.
#define FUNCTION_TEMPLATE_INFO_FIELDS(V) \
V(kCallCodeOffset, kTaggedSize) \
V(kClassNameOffset, kTaggedSize) \
V(kSignatureOffset, kTaggedSize) \
V(kFunctionTemplateRareDataOffset, kTaggedSize) \
V(kSharedFunctionInfoOffset, kTaggedSize) \
V(kFlagOffset, kTaggedSize) \
V(kLengthOffset, kTaggedSize) \
V(kCachedPropertyNameOffset, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(TemplateInfo::kHeaderSize,
FUNCTION_TEMPLATE_INFO_FIELDS)
#undef FUNCTION_TEMPLATE_INFO_FIELDS
DEFINE_FIELD_OFFSET_CONSTANTS(TemplateInfo::kSize,
TORQUE_GENERATED_FUNCTION_TEMPLATE_INFO_FIELDS)
static Handle<SharedFunctionInfo> GetOrCreateSharedFunctionInfo(
Isolate* isolate, Handle<FunctionTemplateInfo> info,
......@@ -257,16 +221,8 @@ class ObjectTemplateInfo : public TemplateInfo {
DECL_VERIFIER(ObjectTemplateInfo)
// Layout description.
#define OBJECT_TEMPLATE_INFO_FIELDS(V) \
V(kConstructorOffset, kTaggedSize) \
/* LSB is for immutable_proto, higher bits for embedder_field_count */ \
V(kDataOffset, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(TemplateInfo::kHeaderSize,
OBJECT_TEMPLATE_INFO_FIELDS)
#undef OBJECT_TEMPLATE_INFO_FIELDS
DEFINE_FIELD_OFFSET_CONSTANTS(TemplateInfo::kSize,
TORQUE_GENERATED_OBJECT_TEMPLATE_INFO_FIELDS)
// Starting from given object template's constructor walk up the inheritance
// chain till a function template that has an instance template is found.
......
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