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 2428110 : OBJECT_CONSTRUCTORS_IMPL(ObjectBoilerplateDescription, FixedArray)
19 :
20 478800 : SMI_ACCESSORS(ObjectBoilerplateDescription, flags,
21 : FixedArray::OffsetOfElementAt(kLiteralTypeOffset));
22 :
23 181454 : OBJECT_CONSTRUCTORS_IMPL(ClassBoilerplate, FixedArray)
24 90727 : CAST_ACCESSOR(ClassBoilerplate)
25 :
26 163456 : BIT_FIELD_ACCESSORS(ClassBoilerplate, flags, install_class_name_accessor,
27 : ClassBoilerplate::Flags::InstallClassNameAccessorBit)
28 :
29 155344 : BIT_FIELD_ACCESSORS(ClassBoilerplate, flags, arguments_count,
30 : ClassBoilerplate::Flags::ArgumentsCountBits)
31 :
32 277260 : SMI_ACCESSORS(ClassBoilerplate, flags,
33 : FixedArray::OffsetOfElementAt(kFlagsIndex));
34 :
35 349124 : ACCESSORS(ClassBoilerplate, static_properties_template, Object,
36 : FixedArray::OffsetOfElementAt(kClassPropertiesTemplateIndex));
37 :
38 349124 : ACCESSORS(ClassBoilerplate, static_elements_template, Object,
39 : FixedArray::OffsetOfElementAt(kClassElementsTemplateIndex));
40 :
41 349124 : ACCESSORS(ClassBoilerplate, static_computed_properties, FixedArray,
42 : FixedArray::OffsetOfElementAt(kClassComputedPropertiesIndex));
43 :
44 349124 : ACCESSORS(ClassBoilerplate, instance_properties_template, Object,
45 : FixedArray::OffsetOfElementAt(kPrototypePropertiesTemplateIndex));
46 :
47 349124 : ACCESSORS(ClassBoilerplate, instance_elements_template, Object,
48 : FixedArray::OffsetOfElementAt(kPrototypeElementsTemplateIndex));
49 :
50 349124 : ACCESSORS(ClassBoilerplate, instance_computed_properties, FixedArray,
51 : FixedArray::OffsetOfElementAt(kPrototypeComputedPropertiesIndex));
52 :
53 3010822 : OBJECT_CONSTRUCTORS_IMPL(ArrayBoilerplateDescription, Struct)
54 :
55 1505413 : CAST_ACCESSOR(ArrayBoilerplateDescription)
56 :
57 1132945 : SMI_ACCESSORS(ArrayBoilerplateDescription, flags, kFlagsOffset);
58 :
59 2226916 : ACCESSORS(ArrayBoilerplateDescription, constant_elements, FixedArrayBase,
60 : kConstantElementsOffset);
61 :
62 : ElementsKind ArrayBoilerplateDescription::elements_kind() const {
63 434232 : return static_cast<ElementsKind>(flags());
64 : }
65 :
66 : void ArrayBoilerplateDescription::set_elements_kind(ElementsKind kind) {
67 : set_flags(kind);
68 : }
69 :
70 : bool ArrayBoilerplateDescription::is_empty() const {
71 : return constant_elements()->length() == 0;
72 : }
73 :
74 : } // namespace internal
75 : } // namespace v8
76 :
77 : #include "src/objects/object-macros-undef.h"
78 :
79 : #endif // V8_OBJECTS_LITERAL_OBJECTS_INL_H_
|