5 #ifndef V8_OBJECTS_EMBEDDER_DATA_ARRAY_H_ 6 #define V8_OBJECTS_EMBEDDER_DATA_ARRAY_H_ 8 #include "src/globals.h" 9 #include "src/maybe-handles.h" 10 #include "src/objects.h" 13 #include "src/objects/object-macros.h" 25 V8_INLINE
int length()
const;
26 V8_INLINE
void set_length(
int value);
31 #define EMBEDDER_DATA_ARRAY_FIELDS(V) \ 32 V(kLengthOffset, kTaggedSize) \ 35 DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
36 EMBEDDER_DATA_ARRAY_FIELDS)
37 #undef EMBEDDER_DATA_ARRAY_FIELDS 40 static constexpr
int SizeFor(
int length) {
41 return kHeaderSize + length * kEmbedderDataSlotSize;
49 static constexpr
int OffsetOfElementAt(
int index) {
return SizeFor(index); }
52 V8_INLINE
Address slots_start();
63 static const int kMaxSize = kMaxRegularHeapObjectSize;
64 static constexpr
int kMaxLength =
65 (kMaxSize - kHeaderSize) / kEmbedderDataSlotSize;
68 STATIC_ASSERT(kHeaderSize == Internals::kFixedArrayHeaderSize);
76 #include "src/objects/object-macros-undef.h" 78 #endif // V8_OBJECTS_EMBEDDER_DATA_ARRAY_H_