• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
6@generateCppClass
7extern class TemplateInfo extends Struct {
8  tag: Smi;
9  serial_number: Smi;
10  number_of_properties: Smi;
11  property_list: TemplateList|Undefined;
12  property_accessors: TemplateList|Undefined;
13}
14
15@generateCppClass
16@generatePrint
17extern class FunctionTemplateRareData extends Struct {
18  // See DECL_RARE_ACCESSORS in FunctionTemplateInfo.
19  prototype_template: ObjectTemplateInfo|Undefined;
20  prototype_provider_template: FunctionTemplateInfo|Undefined;
21  parent_template: FunctionTemplateInfo|Undefined;
22  named_property_handler: InterceptorInfo|Undefined;
23  indexed_property_handler: InterceptorInfo|Undefined;
24  instance_template: ObjectTemplateInfo|Undefined;
25  instance_call_handler: CallHandlerInfo|Undefined;
26  access_check_info: AccessCheckInfo|Undefined;
27  c_function: Foreign|Zero;
28  c_signature: Foreign|Zero;
29}
30
31bitfield struct FunctionTemplateInfoFlags extends uint31 {
32  undetectable: bool: 1 bit;
33  needs_access_check: bool: 1 bit;
34  read_only_prototype: bool: 1 bit;
35  remove_prototype: bool: 1 bit;
36  do_not_cache: bool: 1 bit;
37  accept_any_receiver: bool: 1 bit;
38}
39
40@generateCppClass
41extern class FunctionTemplateInfo extends TemplateInfo {
42  // Handler invoked when calling an instance of this FunctionTemplateInfo.
43  // Either CallHandlerInfo or Undefined.
44  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  rare_data: FunctionTemplateRareData|Undefined;
55  shared_function_info: SharedFunctionInfo|Undefined;
56  // Internal field to store a flag bitfield.
57  flag: SmiTagged<FunctionTemplateInfoFlags>;
58  // "length" property of the final JSFunction.
59  length: Smi;
60  // Either the_hole or a private symbol. Used to cache the result on
61  // the receiver under the the cached_property_name when this
62  // FunctionTemplateInfo is used as a getter.
63  cached_property_name: Object;
64}
65
66bitfield struct ObjectTemplateInfoFlags extends uint31 {
67  is_immutable_prototype: bool: 1 bit;
68  is_code_kind: bool: 1 bit;
69  embedder_field_count: int32: 28 bit;
70}
71
72@generateCppClass
73extern class ObjectTemplateInfo extends TemplateInfo {
74  constructor: FunctionTemplateInfo|Undefined;
75  data: SmiTagged<ObjectTemplateInfoFlags>;
76}
77