V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
literal-objects-inl.h
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 SMI_ACCESSORS(ObjectBoilerplateDescription, flags,
21  FixedArray::OffsetOfElementAt(kLiteralTypeOffset));
22 
23 OBJECT_CONSTRUCTORS_IMPL(ClassBoilerplate, FixedArray)
24 CAST_ACCESSOR2(ClassBoilerplate)
25 
26 BIT_FIELD_ACCESSORS(ClassBoilerplate, flags, install_class_name_accessor,
27  ClassBoilerplate::Flags::InstallClassNameAccessorBit)
28 
29 BIT_FIELD_ACCESSORS(ClassBoilerplate, flags, arguments_count,
30  ClassBoilerplate::Flags::ArgumentsCountBits)
31 
32 SMI_ACCESSORS(ClassBoilerplate, flags,
33  FixedArray::OffsetOfElementAt(kFlagsIndex));
34 
35 ACCESSORS(ClassBoilerplate, static_properties_template, Object,
36  FixedArray::OffsetOfElementAt(kClassPropertiesTemplateIndex));
37 
38 ACCESSORS(ClassBoilerplate, static_elements_template, Object,
39  FixedArray::OffsetOfElementAt(kClassElementsTemplateIndex));
40 
41 ACCESSORS2(ClassBoilerplate, static_computed_properties, FixedArray,
42  FixedArray::OffsetOfElementAt(kClassComputedPropertiesIndex));
43 
44 ACCESSORS(ClassBoilerplate, instance_properties_template, Object,
45  FixedArray::OffsetOfElementAt(kPrototypePropertiesTemplateIndex));
46 
47 ACCESSORS(ClassBoilerplate, instance_elements_template, Object,
48  FixedArray::OffsetOfElementAt(kPrototypeElementsTemplateIndex));
49 
50 ACCESSORS2(ClassBoilerplate, instance_computed_properties, FixedArray,
51  FixedArray::OffsetOfElementAt(kPrototypeComputedPropertiesIndex));
52 
53 SMI_ACCESSORS(ArrayBoilerplateDescription, flags, kFlagsOffset);
54 
55 ACCESSORS2(ArrayBoilerplateDescription, constant_elements, FixedArrayBase,
56  kConstantElementsOffset);
57 
58 ElementsKind ArrayBoilerplateDescription::elements_kind() const {
59  return static_cast<ElementsKind>(flags());
60 }
61 
62 void ArrayBoilerplateDescription::set_elements_kind(ElementsKind kind) {
63  set_flags(kind);
64 }
65 
66 bool ArrayBoilerplateDescription::is_empty() const {
67  return constant_elements()->length() == 0;
68 }
69 
70 } // namespace internal
71 } // namespace v8
72 
73 #include "src/objects/object-macros-undef.h"
74 
75 #endif // V8_OBJECTS_LITERAL_OBJECTS_INL_H_
Definition: libplatform.h:13