v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
embedder-data-array.h
Go to the documentation of this file.
1// Copyright 2018 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_EMBEDDER_DATA_ARRAY_H_
6#define V8_OBJECTS_EMBEDDER_DATA_ARRAY_H_
7
11
12// Has to be the last include (doesn't have include guards):
14
15namespace v8 {
16namespace internal {
17
18#include "torque-generated/src/objects/embedder-data-array-tq.inc"
19
20// This is a storage array for embedder data fields stored in native context.
21// It's basically an "array of EmbedderDataSlots".
22// Note, if the pointer compression is enabled the embedder data slot also
23// contains a raw data part in addition to tagged part.
25 : public TorqueGeneratedEmbedderDataArray<EmbedderDataArray, HeapObject> {
26 public:
27 // TODO(v8:8989): [torque] Support marker constants.
28 static const int kHeaderSize = kSize;
29
30 // Garbage collection support.
31 static constexpr int SizeFor(int length) {
32 return kHeaderSize + length * kEmbedderDataSlotSize;
33 }
34
35 // Returns a grown copy if the index is bigger than the array's length.
37 Isolate* isolate, DirectHandle<EmbedderDataArray> array, int index);
38
39 // Code Generation support.
40 static constexpr int OffsetOfElementAt(int index) { return SizeFor(index); }
41
42 // Address of the first slot.
44
45 // Address of the one past last slot.
47
48 // Dispatched behavior.
51
52 class BodyDescriptor;
53
55 static constexpr int kMaxLength =
57
58 private:
60
62};
63
64} // namespace internal
65} // namespace v8
66
68
69#endif // V8_OBJECTS_EMBEDDER_DATA_ARRAY_H_
static constexpr int OffsetOfElementAt(int index)
static DirectHandle< EmbedderDataArray > EnsureCapacity(Isolate *isolate, DirectHandle< EmbedderDataArray > array, int index)
static constexpr int SizeFor(int length)
static const int kFixedArrayHeaderSize
constexpr int kMaxRegularHeapObjectSize
Definition globals.h:680
constexpr int kEmbedderDataSlotSize
Definition globals.h:664
#define DECL_VERIFIER(Name)
#define DECL_PRINTER(Name)
#define TQ_OBJECT_CONSTRUCTORS(Type)
#define V8_INLINE
Definition v8config.h:500