1// Copyright 2019 the V8 project authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5@abstract 6extern class TemplateInfo extends Struct { 7 tag: Smi; 8 serial_number: Smi; 9 number_of_properties: Smi; 10 property_list: TemplateList|Undefined; 11 property_accessors: TemplateList|Undefined; 12} 13 14extern class FunctionTemplateRareData extends Struct { 15 // See DECL_RARE_ACCESSORS in FunctionTemplateInfo. 16 prototype_template: ObjectTemplateInfo|Undefined; 17 prototype_provider_template: FunctionTemplateInfo|Undefined; 18 parent_template: FunctionTemplateInfo|Undefined; 19 named_property_handler: InterceptorInfo|Undefined; 20 indexed_property_handler: InterceptorInfo|Undefined; 21 instance_template: ObjectTemplateInfo|Undefined; 22 instance_call_handler: CallHandlerInfo|Undefined; 23 access_check_info: AccessCheckInfo|Undefined; 24 c_function_overloads: FixedArray; 25} 26 27bitfield struct FunctionTemplateInfoFlags extends uint31 { 28 undetectable: bool: 1 bit; 29 needs_access_check: bool: 1 bit; 30 read_only_prototype: bool: 1 bit; 31 remove_prototype: bool: 1 bit; 32 accept_any_receiver: bool: 1 bit; 33 published: bool: 1 bit; 34 // Allowed receiver ranges are used for instance type checking to check 35 // whether the receiver calling the associated JSFunction is a compatible 36 // receiver. 37 allowed_receiver_instance_type_range_start: int16: 12 bit; 38 allowed_receiver_instance_type_range_end: int16: 12 bit; 39} 40 41extern class FunctionTemplateInfo extends TemplateInfo { 42 // Handler invoked when calling an instance of this FunctionTemplateInfo. 43 // Either CallHandlerInfo or Undefined. 44 @cppAcquireLoad @cppReleaseStore call_code: CallHandlerInfo|Undefined; 45 class_name: String|Undefined; 46 // If the signature is a FunctionTemplateInfo it is used to check whether the 47 // receiver calling the associated JSFunction is a compatible receiver, i.e. 48 // it is an instance of the signature FunctionTemplateInfo or any of the 49 // receiver's prototypes are. 50 signature: FunctionTemplateInfo|Undefined; 51 // If any of the setters declared by DECL_RARE_ACCESSORS are used then a 52 // FunctionTemplateRareData will be stored here. Until then this contains 53 // undefined. 54 @cppAcquireLoad 55 @cppReleaseStore 56 rare_data: FunctionTemplateRareData|Undefined; 57 shared_function_info: SharedFunctionInfo|Undefined; 58 // Internal field to store a flag bitfield. 59 flag: SmiTagged<FunctionTemplateInfoFlags>; 60 // "length" property of the final JSFunction. 61 length: Smi; 62 // Either the_hole or a private symbol. Used to cache the result on 63 // the receiver under the the cached_property_name when this 64 // FunctionTemplateInfo is used as a getter. 65 cached_property_name: Object; 66 // This will be set as the instance type of the objects that are created from 67 // this FunctionTemplateInfo. 68 instance_type: Smi; 69} 70 71bitfield struct ObjectTemplateInfoFlags extends uint31 { 72 is_immutable_prototype: bool: 1 bit; 73 is_code_kind: bool: 1 bit; 74 embedder_field_count: int32: 28 bit; 75} 76 77extern class ObjectTemplateInfo extends TemplateInfo { 78 constructor: FunctionTemplateInfo|Undefined; 79 data: SmiTagged<ObjectTemplateInfoFlags>; 80} 81