5 #ifndef V8_OBJECTS_LITERAL_OBJECTS_H_ 6 #define V8_OBJECTS_LITERAL_OBJECTS_H_ 8 #include "src/objects.h" 9 #include "src/objects/fixed-array.h" 12 #include "src/objects/object-macros.h" 26 Object* name(
int index)
const;
27 Object* value(
int index)
const;
29 void set_key_value(
int index,
Object* key,
Object* value);
35 int backing_store_size()
const;
37 void set_backing_store_size(
Isolate* isolate,
int backing_store_size);
41 DECL_INT_ACCESSORS(flags)
42 static const int kLiteralTypeOffset = 0;
43 static const int kDescriptionStartIndex = 1;
50 bool has_number_of_properties()
const;
60 inline ElementsKind elements_kind()
const;
61 inline void set_elements_kind(ElementsKind kind);
63 inline bool is_empty()
const;
69 void BriefPrintDetails(std::ostream& os);
71 #define ARRAY_BOILERPLATE_DESCRIPTION_FIELDS(V) \ 72 V(kFlagsOffset, kTaggedSize) \ 73 V(kConstantElementsOffset, kTaggedSize) \ 77 DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
78 ARRAY_BOILERPLATE_DESCRIPTION_FIELDS)
79 #undef ARRAY_BOILERPLATE_DESCRIPTION_FIELDS 82 DECL_INT_ACCESSORS(flags)
88 enum ValueKind { kData, kGetter, kSetter };
91 #define FLAGS_BIT_FIELDS(V, _) \ 92 V(InstallClassNameAccessorBit, bool, 1, _) \ 93 V(ArgumentsCountBits, int, 30, _) 94 DEFINE_BIT_FIELDS(FLAGS_BIT_FIELDS)
95 #undef FLAGS_BIT_FIELDS 99 #define COMPUTED_ENTRY_BIT_FIELDS(V, _) \ 100 V(ValueKindBits, ValueKind, 2, _) \ 101 V(KeyIndexBits, unsigned, 29, _) 102 DEFINE_BIT_FIELDS(COMPUTED_ENTRY_BIT_FIELDS)
103 #undef COMPUTED_ENTRY_BIT_FIELDS 106 enum DefineClassArgumentsIndices {
107 kConstructorArgumentIndex = 1,
108 kPrototypeArgumentIndex = 2,
112 kFirstDynamicArgumentIndex = 3,
115 static const int kMinimumClassPropertiesCount = 6;
116 static const int kMinimumPrototypePropertiesCount = 1;
120 DECL_BOOLEAN_ACCESSORS(install_class_name_accessor)
121 DECL_INT_ACCESSORS(arguments_count)
122 DECL_ACCESSORS(static_properties_template,
Object)
123 DECL_ACCESSORS(static_elements_template,
Object)
124 DECL_ACCESSORS2(static_computed_properties,
FixedArray)
125 DECL_ACCESSORS(instance_properties_template,
Object)
126 DECL_ACCESSORS(instance_elements_template,
Object)
127 DECL_ACCESSORS2(instance_computed_properties,
FixedArray)
129 static void AddToPropertiesTemplate(
Isolate* isolate,
132 ValueKind value_kind,
Object* value);
134 static void AddToElementsTemplate(
Isolate* isolate,
137 ValueKind value_kind,
Object* value);
144 kClassPropertiesTemplateIndex,
145 kClassElementsTemplateIndex,
146 kClassComputedPropertiesIndex,
147 kPrototypePropertiesTemplateIndex,
148 kPrototypeElementsTemplateIndex,
149 kPrototypeComputedPropertiesIndex,
153 static const int kFullComputedEntrySize = 2;
156 DECL_INT_ACCESSORS(flags)
158 OBJECT_CONSTRUCTORS(ClassBoilerplate, FixedArray)
164 #include "src/objects/object-macros-undef.h" 166 #endif // V8_OBJECTS_LITERAL_OBJECTS_H_