Line data Source code
1 : // Copyright 2017 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 : #ifndef V8_OBJECTS_LITERAL_OBJECTS_INL_H_
6 : #define V8_OBJECTS_LITERAL_OBJECTS_INL_H_
7 :
8 : #include "src/objects/literal-objects.h"
9 :
10 : #include "src/objects-inl.h"
11 :
12 : // Has to be the last include (doesn't have include guards):
13 : #include "src/objects/object-macros.h"
14 :
15 : namespace v8 {
16 : namespace internal {
17 :
18 : OBJECT_CONSTRUCTORS_IMPL(ObjectBoilerplateDescription, FixedArray)
19 :
20 : CAST_ACCESSOR(ObjectBoilerplateDescription)
21 :
22 445688 : SMI_ACCESSORS(ObjectBoilerplateDescription, flags,
23 : FixedArray::OffsetOfElementAt(kLiteralTypeOffset))
24 :
25 : OBJECT_CONSTRUCTORS_IMPL(ClassBoilerplate, FixedArray)
26 : CAST_ACCESSOR(ClassBoilerplate)
27 :
28 164304 : BIT_FIELD_ACCESSORS(ClassBoilerplate, flags, install_class_name_accessor,
29 : ClassBoilerplate::Flags::InstallClassNameAccessorBit)
30 :
31 161556 : BIT_FIELD_ACCESSORS(ClassBoilerplate, flags, arguments_count,
32 : ClassBoilerplate::Flags::ArgumentsCountBits)
33 :
34 123915 : SMI_ACCESSORS(ClassBoilerplate, flags,
35 : FixedArray::OffsetOfElementAt(kFlagsIndex))
36 :
37 256878 : ACCESSORS(ClassBoilerplate, static_properties_template, Object,
38 : FixedArray::OffsetOfElementAt(kClassPropertiesTemplateIndex))
39 :
40 256878 : ACCESSORS(ClassBoilerplate, static_elements_template, Object,
41 : FixedArray::OffsetOfElementAt(kClassElementsTemplateIndex))
42 :
43 256878 : ACCESSORS(ClassBoilerplate, static_computed_properties, FixedArray,
44 : FixedArray::OffsetOfElementAt(kClassComputedPropertiesIndex))
45 :
46 256878 : ACCESSORS(ClassBoilerplate, instance_properties_template, Object,
47 : FixedArray::OffsetOfElementAt(kPrototypePropertiesTemplateIndex))
48 :
49 256878 : ACCESSORS(ClassBoilerplate, instance_elements_template, Object,
50 : FixedArray::OffsetOfElementAt(kPrototypeElementsTemplateIndex))
51 :
52 256878 : ACCESSORS(ClassBoilerplate, instance_computed_properties, FixedArray,
53 : FixedArray::OffsetOfElementAt(kPrototypeComputedPropertiesIndex))
54 :
55 : OBJECT_CONSTRUCTORS_IMPL(ArrayBoilerplateDescription, Struct)
56 :
57 : CAST_ACCESSOR(ArrayBoilerplateDescription)
58 :
59 643027 : SMI_ACCESSORS(ArrayBoilerplateDescription, flags, kFlagsOffset)
60 :
61 1375291 : ACCESSORS(ArrayBoilerplateDescription, constant_elements, FixedArrayBase,
62 : kConstantElementsOffset)
63 :
64 : ElementsKind ArrayBoilerplateDescription::elements_kind() const {
65 462334 : return static_cast<ElementsKind>(flags());
66 : }
67 :
68 : void ArrayBoilerplateDescription::set_elements_kind(ElementsKind kind) {
69 : set_flags(kind);
70 : }
71 :
72 : bool ArrayBoilerplateDescription::is_empty() const {
73 : return constant_elements()->length() == 0;
74 : }
75 :
76 : } // namespace internal
77 : } // namespace v8
78 :
79 : #include "src/objects/object-macros-undef.h"
80 :
81 : #endif // V8_OBJECTS_LITERAL_OBJECTS_INL_H_
|