v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::TaggedArrayBase< Derived, ShapeT, Super > Class Template Reference

#include <fixed-array.h>

Inheritance diagram for v8::internal::TaggedArrayBase< Derived, ShapeT, Super >:
Collaboration diagram for v8::internal::TaggedArrayBase< Derived, ShapeT, Super >:

Public Types

using Header = detail::TaggedArrayHeader<ShapeT, Super>
 
using Shape = ShapeT
 

Public Member Functions

Tagged< ElementTget (int index) const
 
Tagged< ElementTget (int index, RelaxedLoadTag) const
 
Tagged< ElementTget (int index, AcquireLoadTag) const
 
Tagged< ElementTget (int index, SeqCstAccessTag) const
 
void set (int index, Tagged< ElementT > value, WriteBarrierMode mode=kDefaultMode)
 
template<typename T = ElementT, typename = std::enable_if<kSupportsSmiElements<T>>>
void set (int index, Tagged< Smi > value)
 
void set (int index, Tagged< ElementT > value, RelaxedStoreTag, WriteBarrierMode mode=kDefaultMode)
 
template<typename T = ElementT, typename = std::enable_if<kSupportsSmiElements<T>>>
void set (int index, Tagged< Smi > value, RelaxedStoreTag)
 
void set (int index, Tagged< ElementT > value, ReleaseStoreTag, WriteBarrierMode mode=kDefaultMode)
 
template<typename T = ElementT, typename = std::enable_if<kSupportsSmiElements<T>>>
void set (int index, Tagged< Smi > value, ReleaseStoreTag)
 
void set (int index, Tagged< ElementT > value, SeqCstAccessTag, WriteBarrierMode mode=kDefaultMode)
 
template<typename T = ElementT, typename = std::enable_if<kSupportsSmiElements<T>>>
void set (int index, Tagged< Smi > value, SeqCstAccessTag)
 
Tagged< ElementTswap (int index, Tagged< ElementT > value, SeqCstAccessTag, WriteBarrierMode mode=kDefaultMode)
 
Tagged< ElementTcompare_and_swap (int index, Tagged< ElementT > expected, Tagged< ElementT > value, SeqCstAccessTag, WriteBarrierMode mode=kDefaultMode)
 
void RightTrim (Isolate *isolate, int new_capacity)
 
int AllocatedSize () const
 
SlotType RawFieldOfFirstElement () const
 
SlotType RawFieldOfElementAt (int index) const
 
template<class IsolateT >
Handle< DAllocate (IsolateT *isolate, int capacity, std::optional< DisallowGarbageCollection > *no_gc_out, AllocationType allocation)
 

Static Public Member Functions

static void MoveElements (Isolate *isolate, Tagged< Derived > dst, int dst_index, Tagged< Derived > src, int src_index, int len, WriteBarrierMode mode=kDefaultMode)
 
static void CopyElements (Isolate *isolate, Tagged< Derived > dst, int dst_index, Tagged< Derived > src, int src_index, int len, WriteBarrierMode mode=kDefaultMode)
 
static constexpr int SizeFor (int capacity)
 
static constexpr int OffsetOfElementAt (int index)
 

Static Public Attributes

static constexpr bool kElementsAreMaybeObject = is_maybe_weak_v<ElementT>
 
static constexpr int kElementSize = kTaggedSize
 
static constexpr int kMaxCapacity = kMaxFixedArrayCapacity
 
static constexpr int kMaxRegularCapacity
 

Protected Member Functions

bool IsInBounds (int index) const
 
bool IsCowArray () const
 
 FLEXIBLE_ARRAY_MEMBER (ElementMemberT, objects)
 

Static Protected Member Functions

template<class IsolateT >
static Handle< Derived > Allocate (IsolateT *isolate, int capacity, std::optional< DisallowGarbageCollection > *no_gc_out, AllocationType allocation=AllocationType::kYoung)
 
static constexpr int NewCapacityForIndex (int index, int old_capacity)
 

Private Types

using ElementT = typename ShapeT::ElementT
 
using ElementMemberT
 
using SlotType
 

Static Private Attributes

template<typename ElementT >
static constexpr bool kSupportsSmiElements
 
static constexpr WriteBarrierMode kDefaultMode
 

Detailed Description

template<class Derived, class ShapeT, class Super = HeapObjectLayout>
class v8::internal::TaggedArrayBase< Derived, ShapeT, Super >

Definition at line 92 of file fixed-array.h.

Member Typedef Documentation

◆ ElementMemberT

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
using v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::ElementMemberT
private
Initial value:
TaggedMember<ElementT, typename ShapeT::CompressionScheme>

Definition at line 99 of file fixed-array.h.

◆ ElementT

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
using v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::ElementT = typename ShapeT::ElementT
private

Definition at line 94 of file fixed-array.h.

◆ Header

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
using v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::Header = detail::TaggedArrayHeader<ShapeT, Super>

Definition at line 110 of file fixed-array.h.

◆ Shape

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
using v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::Shape = ShapeT

Definition at line 119 of file fixed-array.h.

◆ SlotType

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
using v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::SlotType
private
Initial value:
std::conditional_t<kElementsAreMaybeObject, MaybeObjectSlot, ObjectSlot>

Definition at line 115 of file fixed-array.h.

Member Function Documentation

◆ Allocate() [1/2]

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
template<class IsolateT >
Handle< D > v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::Allocate ( IsolateT * isolate,
int capacity,
std::optional< DisallowGarbageCollection > * no_gc_out,
AllocationType allocation )

Definition at line 355 of file fixed-array-inl.h.

Here is the call graph for this function:

◆ Allocate() [2/2]

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
template<class IsolateT >
static Handle< Derived > v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::Allocate ( IsolateT * isolate,
int capacity,
std::optional< DisallowGarbageCollection > * no_gc_out,
AllocationType allocation = AllocationType::kYoung )
staticprotected

◆ AllocatedSize()

template<class D , class S , class P >
int v8::internal::TaggedArrayBase< D, S, P >::AllocatedSize ( ) const
inline

Definition at line 273 of file fixed-array-inl.h.

◆ compare_and_swap()

template<class D , class S , class P >
Tagged< typename TaggedArrayBase< D, S, P >::ElementT > v8::internal::TaggedArrayBase< D, S, P >::compare_and_swap ( int index,
Tagged< ElementT > expected,
Tagged< ElementT > value,
SeqCstAccessTag ,
WriteBarrierMode mode = kDefaultMode )
inline

Definition at line 213 of file fixed-array-inl.h.

◆ CopyElements()

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
void v8::internal::TaggedArrayBase< D, S, P >::CopyElements ( Isolate * isolate,
Tagged< Derived > dst,
int dst_index,
Tagged< Derived > src,
int src_index,
int len,
WriteBarrierMode mode = kDefaultMode )
inlinestatic

Definition at line 242 of file fixed-array-inl.h.

◆ FLEXIBLE_ARRAY_MEMBER()

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::FLEXIBLE_ARRAY_MEMBER ( ElementMemberT ,
objects  )
protected

◆ get() [1/4]

template<class D , class S , class P >
Tagged< typename TaggedArrayBase< D, S, P >::ElementT > v8::internal::TaggedArrayBase< D, S, P >::get ( int index) const
inline

Definition at line 115 of file fixed-array-inl.h.

◆ get() [2/4]

template<class D , class S , class P >
Tagged< typename TaggedArrayBase< D, S, P >::ElementT > v8::internal::TaggedArrayBase< D, S, P >::get ( int index,
AcquireLoadTag  ) const
inline

Definition at line 130 of file fixed-array-inl.h.

◆ get() [3/4]

template<class D , class S , class P >
Tagged< typename TaggedArrayBase< D, S, P >::ElementT > v8::internal::TaggedArrayBase< D, S, P >::get ( int index,
RelaxedLoadTag  ) const
inline

Definition at line 123 of file fixed-array-inl.h.

◆ get() [4/4]

template<class D , class S , class P >
Tagged< typename TaggedArrayBase< D, S, P >::ElementT > v8::internal::TaggedArrayBase< D, S, P >::get ( int index,
SeqCstAccessTag  ) const
inline

Definition at line 137 of file fixed-array-inl.h.

◆ IsCowArray()

template<class D , class S , class P >
bool v8::internal::TaggedArrayBase< D, S, P >::IsCowArray ( ) const
inlineprotected

Definition at line 108 of file fixed-array-inl.h.

◆ IsInBounds()

template<class D , class S , class P >
bool v8::internal::TaggedArrayBase< D, S, P >::IsInBounds ( int index) const
inlineprotected

Definition at line 103 of file fixed-array-inl.h.

◆ MoveElements()

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
void v8::internal::TaggedArrayBase< D, S, P >::MoveElements ( Isolate * isolate,
Tagged< Derived > dst,
int dst_index,
Tagged< Derived > src,
int src_index,
int len,
WriteBarrierMode mode = kDefaultMode )
inlinestatic

Definition at line 223 of file fixed-array-inl.h.

◆ NewCapacityForIndex()

template<class D , class S , class P >
int v8::internal::TaggedArrayBase< D, S, P >::NewCapacityForIndex ( int index,
int old_capacity )
staticconstexprprotected

Definition at line 381 of file fixed-array-inl.h.

◆ OffsetOfElementAt()

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
static constexpr int v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::OffsetOfElementAt ( int index)
inlinestaticconstexpr

Definition at line 173 of file fixed-array.h.

Here is the call graph for this function:

◆ RawFieldOfElementAt()

template<class D , class S , class P >
TaggedArrayBase< D, S, P >::SlotType v8::internal::TaggedArrayBase< D, S, P >::RawFieldOfElementAt ( int index) const
inline

Definition at line 285 of file fixed-array-inl.h.

◆ RawFieldOfFirstElement()

template<class D , class S , class P >
TaggedArrayBase< D, S, P >::SlotType v8::internal::TaggedArrayBase< D, S, P >::RawFieldOfFirstElement ( ) const
inline

Definition at line 279 of file fixed-array-inl.h.

◆ RightTrim()

template<class D , class S , class P >
void v8::internal::TaggedArrayBase< D, S, P >::RightTrim ( Isolate * isolate,
int new_capacity )
inline

Definition at line 261 of file fixed-array-inl.h.

Here is the call graph for this function:

◆ set() [1/8]

template<class D , class S , class P >
void v8::internal::TaggedArrayBase< D, S, P >::set ( int index,
Tagged< ElementT > value,
RelaxedStoreTag tag,
WriteBarrierMode mode = kDefaultMode )
inline

Definition at line 158 of file fixed-array-inl.h.

◆ set() [2/8]

template<class D , class S , class P >
void v8::internal::TaggedArrayBase< D, S, P >::set ( int index,
Tagged< ElementT > value,
ReleaseStoreTag tag,
WriteBarrierMode mode = kDefaultMode )
inline

Definition at line 173 of file fixed-array-inl.h.

◆ set() [3/8]

template<class D , class S , class P >
void v8::internal::TaggedArrayBase< D, S, P >::set ( int index,
Tagged< ElementT > value,
SeqCstAccessTag tag,
WriteBarrierMode mode = kDefaultMode )
inline

Definition at line 188 of file fixed-array-inl.h.

◆ set() [4/8]

template<class D , class S , class P >
void v8::internal::TaggedArrayBase< D, S, P >::set ( int index,
Tagged< ElementT > value,
WriteBarrierMode mode = kDefaultMode )
inline

Definition at line 143 of file fixed-array-inl.h.

◆ set() [5/8]

template<class D , class S , class P >
template<typename , typename >
void v8::internal::TaggedArrayBase< D, S, P >::set ( int index,
Tagged< Smi > value )
inline

Definition at line 153 of file fixed-array-inl.h.

◆ set() [6/8]

template<class D , class S , class P >
template<typename , typename >
void v8::internal::TaggedArrayBase< D, S, P >::set ( int index,
Tagged< Smi > value,
RelaxedStoreTag tag )
inline

Definition at line 167 of file fixed-array-inl.h.

◆ set() [7/8]

template<class D , class S , class P >
template<typename , typename >
void v8::internal::TaggedArrayBase< D, S, P >::set ( int index,
Tagged< Smi > value,
ReleaseStoreTag tag )
inline

Definition at line 182 of file fixed-array-inl.h.

◆ set() [8/8]

template<class D , class S , class P >
template<typename , typename >
void v8::internal::TaggedArrayBase< D, S, P >::set ( int index,
Tagged< Smi > value,
SeqCstAccessTag tag )
inline

Definition at line 197 of file fixed-array-inl.h.

◆ SizeFor()

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
static constexpr int v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::SizeFor ( int capacity)
inlinestaticconstexpr

Definition at line 170 of file fixed-array.h.

Here is the caller graph for this function:

◆ swap()

template<class D , class S , class P >
Tagged< typename TaggedArrayBase< D, S, P >::ElementT > v8::internal::TaggedArrayBase< D, S, P >::swap ( int index,
Tagged< ElementT > value,
SeqCstAccessTag ,
WriteBarrierMode mode = kDefaultMode )
inline

Definition at line 204 of file fixed-array-inl.h.

Member Data Documentation

◆ kDefaultMode

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
WriteBarrierMode v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::kDefaultMode
staticconstexprprivate
Initial value:
=
std::is_same_v<ElementT, Smi> ? SKIP_WRITE_BARRIER : UPDATE_WRITE_BARRIER
@ SKIP_WRITE_BARRIER
Definition objects.h:52
@ UPDATE_WRITE_BARRIER
Definition objects.h:55

Definition at line 106 of file fixed-array.h.

◆ kElementsAreMaybeObject

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
bool v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::kElementsAreMaybeObject = is_maybe_weak_v<ElementT>
staticconstexpr

Definition at line 111 of file fixed-array.h.

◆ kElementSize

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
int v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::kElementSize = kTaggedSize
staticconstexpr

Definition at line 112 of file fixed-array.h.

◆ kMaxCapacity

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
int v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::kMaxCapacity = kMaxFixedArrayCapacity
staticconstexpr

Definition at line 187 of file fixed-array.h.

◆ kMaxRegularCapacity

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
int v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::kMaxRegularCapacity
staticconstexpr
Initial value:
=
detail::TaggedArrayHeader< ShapeT, Super > Header
static constexpr int kElementSize
constexpr int kMaxRegularHeapObjectSize
Definition globals.h:680

Definition at line 191 of file fixed-array.h.

◆ kSupportsSmiElements

template<class Derived , class ShapeT , class Super = HeapObjectLayout>
template<typename ElementT >
bool v8::internal::TaggedArrayBase< Derived, ShapeT, Super >::kSupportsSmiElements
staticconstexprprivate
Initial value:
=
std::is_convertible_v<Smi, ElementT>

Definition at line 103 of file fixed-array.h.


The documentation for this class was generated from the following files: