V8 Project
v8::internal::ElementsAccessor Class Referenceabstract

#include <elements.h>

+ Inheritance diagram for v8::internal::ElementsAccessor:
+ Collaboration diagram for v8::internal::ElementsAccessor:

Public Member Functions

 ElementsAccessor (const char *name)
 
virtual ~ElementsAccessor ()
 
virtual ElementsKind kind () const =0
 
const char * name () const
 
virtual void Validate (Handle< JSObject > obj)=0
 
virtual bool HasElement (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store)=0
 
bool HasElement (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key)
 
virtual MUST_USE_RESULT MaybeHandle< ObjectGet (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store)=0
 
MUST_USE_RESULT MaybeHandle< ObjectGet (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key)
 
virtual MUST_USE_RESULT PropertyAttributes GetAttributes (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store)=0
 
MUST_USE_RESULT PropertyAttributes GetAttributes (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key)
 
virtual MUST_USE_RESULT MaybeHandle< AccessorPairGetAccessorPair (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store)=0
 
MUST_USE_RESULT MaybeHandle< AccessorPairGetAccessorPair (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key)
 
virtual MUST_USE_RESULT MaybeHandle< ObjectSetLength (Handle< JSArray > holder, Handle< Object > new_length)=0
 
virtual void SetCapacityAndLength (Handle< JSArray > array, int capacity, int length)=0
 
virtual MUST_USE_RESULT MaybeHandle< ObjectDelete (Handle< JSObject > holder, uint32_t key, JSReceiver::DeleteMode mode)=0
 
virtual void CopyElements (Handle< FixedArrayBase > source, uint32_t source_start, ElementsKind source_kind, Handle< FixedArrayBase > destination, uint32_t destination_start, int copy_size)=0
 
virtual void CopyElements (JSObject *source_holder, uint32_t source_start, ElementsKind source_kind, Handle< FixedArrayBase > destination, uint32_t destination_start, int copy_size)=0
 
void CopyElements (Handle< JSObject > from_holder, Handle< FixedArrayBase > to, ElementsKind from_kind)
 
virtual MUST_USE_RESULT MaybeHandle< FixedArrayAddElementsToFixedArray (Handle< Object > receiver, Handle< JSObject > holder, Handle< FixedArray > to, Handle< FixedArrayBase > from)=0
 
MUST_USE_RESULT MaybeHandle< FixedArrayAddElementsToFixedArray (Handle< Object > receiver, Handle< JSObject > holder, Handle< FixedArray > to)
 

Static Public Member Functions

static ElementsAccessorForKind (ElementsKind elements_kind)
 
static ElementsAccessorForArray (Handle< FixedArrayBase > array)
 
static void InitializeOncePerProcess ()
 
static void TearDown ()
 

Static Public Attributes

static const int kCopyToEnd = -1
 
static const int kCopyToEndAndInitializeToHole = -2
 

Protected Member Functions

virtual uint32_t GetCapacity (Handle< FixedArrayBase > backing_store)=0
 
virtual uint32_t GetKeyForIndex (Handle< FixedArrayBase > backing_store, uint32_t index)=0
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (ElementsAccessor)
 

Private Attributes

const char * name_
 

Static Private Attributes

static ElementsAccessor ** elements_accessors_ = NULL
 

Friends

class SloppyArgumentsElementsAccessor
 

Detailed Description

Definition at line 18 of file elements.h.

Constructor & Destructor Documentation

◆ ElementsAccessor()

v8::internal::ElementsAccessor::ElementsAccessor ( const char *  name)
inlineexplicit

Definition at line 20 of file elements.h.

20 : name_(name) { }
const char * name() const
Definition: elements.h:24

◆ ~ElementsAccessor()

virtual v8::internal::ElementsAccessor::~ElementsAccessor ( )
inlinevirtual

Definition at line 21 of file elements.h.

21 { }

Member Function Documentation

◆ AddElementsToFixedArray() [1/2]

MUST_USE_RESULT MaybeHandle<FixedArray> v8::internal::ElementsAccessor::AddElementsToFixedArray ( Handle< Object receiver,
Handle< JSObject holder,
Handle< FixedArray to 
)
inline

Definition at line 175 of file elements.h.

178  {
180  receiver, holder, to, handle(holder->elements()));
181  }
virtual MUST_USE_RESULT MaybeHandle< FixedArray > AddElementsToFixedArray(Handle< Object > receiver, Handle< JSObject > holder, Handle< FixedArray > to, Handle< FixedArrayBase > from)=0
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes to(mksnapshot only)") DEFINE_STRING(raw_context_file
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References AddElementsToFixedArray(), v8::internal::handle(), and to().

+ Here is the call graph for this function:

◆ AddElementsToFixedArray() [2/2]

◆ CopyElements() [1/3]

◆ CopyElements() [2/3]

void v8::internal::ElementsAccessor::CopyElements ( Handle< JSObject from_holder,
Handle< FixedArrayBase to,
ElementsKind  from_kind 
)
inline

Definition at line 161 of file elements.h.

164  {
165  CopyElements(
166  *from_holder, 0, from_kind, to, 0, kCopyToEndAndInitializeToHole);
167  }
virtual void CopyElements(Handle< FixedArrayBase > source, uint32_t source_start, ElementsKind source_kind, Handle< FixedArrayBase > destination, uint32_t destination_start, int copy_size)=0
static const int kCopyToEndAndInitializeToHole
Definition: elements.h:135

References CopyElements(), kCopyToEndAndInitializeToHole, and to().

+ Here is the call graph for this function:

◆ CopyElements() [3/3]

◆ Delete()

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::ElementsAccessor::DISALLOW_COPY_AND_ASSIGN ( ElementsAccessor  )
private

◆ ForArray()

ElementsAccessor * v8::internal::ElementsAccessor::ForArray ( Handle< FixedArrayBase array)
static

Definition at line 1731 of file elements.cc.

1731  {
1732  return elements_accessors_[ElementsKindForArray(*array)];
1733 }
static ElementsAccessor ** elements_accessors_
Definition: elements.h:211
static ElementsKind ElementsKindForArray(FixedArrayBase *array)
Definition: elements.cc:1039

References elements_accessors_, and v8::internal::ElementsKindForArray().

Referenced by v8::internal::SloppyArgumentsElementsAccessor::GetAccessorPairImpl(), v8::internal::SloppyArgumentsElementsAccessor::GetAttributesImpl(), v8::internal::SloppyArgumentsElementsAccessor::GetCapacityImpl(), v8::internal::SloppyArgumentsElementsAccessor::GetImpl(), v8::internal::SloppyArgumentsElementsAccessor::HasElementImpl(), and v8::internal::FixedArray::UnionOfKeys().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ForKind()

static ElementsAccessor* v8::internal::ElementsAccessor::ForKind ( ElementsKind  elements_kind)
inlinestatic

Definition at line 184 of file elements.h.

184  {
185  DCHECK(elements_kind < kElementsKindCount);
186  return elements_accessors_[elements_kind];
187  }
#define DCHECK(condition)
Definition: logging.h:205
const int kElementsKindCount
Definition: elements-kind.h:66

References DCHECK, elements_accessors_, and v8::internal::kElementsKindCount.

Referenced by v8::internal::BUILTIN(), v8::internal::ElementsKindToString(), v8::internal::JSObject::GetElementsAccessor(), v8::internal::JSObject::SetFastDoubleElementsCapacityAndLength(), and v8::internal::JSObject::SetFastElementsCapacityAndLength().

+ Here is the caller graph for this function:

◆ Get() [1/2]

MUST_USE_RESULT MaybeHandle<Object> v8::internal::ElementsAccessor::Get ( Handle< Object receiver,
Handle< JSObject holder,
uint32_t  key 
)
inline

Definition at line 59 of file elements.h.

62  {
63  return Get(receiver, holder, key, handle(holder->elements()));
64  }
virtual MUST_USE_RESULT MaybeHandle< Object > Get(Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store)=0

References Get(), and v8::internal::handle().

+ Here is the call graph for this function:

◆ Get() [2/2]

◆ GetAccessorPair() [1/2]

MUST_USE_RESULT MaybeHandle<AccessorPair> v8::internal::ElementsAccessor::GetAccessorPair ( Handle< Object receiver,
Handle< JSObject holder,
uint32_t  key 
)
inline

Definition at line 95 of file elements.h.

98  {
99  return GetAccessorPair(receiver, holder, key, handle(holder->elements()));
100  }
virtual MUST_USE_RESULT MaybeHandle< AccessorPair > GetAccessorPair(Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store)=0

References GetAccessorPair(), and v8::internal::handle().

+ Here is the call graph for this function:

◆ GetAccessorPair() [2/2]

◆ GetAttributes() [1/2]

MUST_USE_RESULT PropertyAttributes v8::internal::ElementsAccessor::GetAttributes ( Handle< Object receiver,
Handle< JSObject holder,
uint32_t  key 
)
inline

Definition at line 77 of file elements.h.

80  {
81  return GetAttributes(receiver, holder, key, handle(holder->elements()));
82  }
virtual MUST_USE_RESULT PropertyAttributes GetAttributes(Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store)=0

References GetAttributes(), and v8::internal::handle().

+ Here is the call graph for this function:

◆ GetAttributes() [2/2]

◆ GetCapacity()

◆ GetKeyForIndex()

◆ HasElement() [1/2]

bool v8::internal::ElementsAccessor::HasElement ( Handle< Object receiver,
Handle< JSObject holder,
uint32_t  key 
)
inline

Definition at line 41 of file elements.h.

44  {
45  return HasElement(receiver, holder, key, handle(holder->elements()));
46  }
virtual bool HasElement(Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store)=0

References v8::internal::handle(), and HasElement().

+ Here is the call graph for this function:

◆ HasElement() [2/2]

◆ InitializeOncePerProcess()

void v8::internal::ElementsAccessor::InitializeOncePerProcess ( )
static

Definition at line 1736 of file elements.cc.

1736  {
1737  static ElementsAccessor* accessor_array[] = {
1738 #define ACCESSOR_ARRAY(Class, Kind, Store) new Class(#Kind),
1740 #undef ACCESSOR_ARRAY
1741  };
1742 
1743  STATIC_ASSERT((sizeof(accessor_array) / sizeof(*accessor_array)) ==
1745 
1746  elements_accessors_ = accessor_array;
1747 }
ElementsAccessor(const char *name)
Definition: elements.h:20
#define ACCESSOR_ARRAY(Class, Kind, Store)
#define ELEMENTS_LIST(V)
Definition: elements.cc:63
STATIC_ASSERT(sizeof(CPURegister)==sizeof(Register))

References ACCESSOR_ARRAY, elements_accessors_, ELEMENTS_LIST, v8::internal::kElementsKindCount, and v8::internal::STATIC_ASSERT().

Referenced by v8::internal::V8::InitializeOncePerProcessImpl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ kind()

◆ name()

const char* v8::internal::ElementsAccessor::name ( ) const
inline

Definition at line 24 of file elements.h.

24 { return name_; }

References name_.

Referenced by v8::internal::DictionaryElementsAccessor::DeleteCommon(), and v8::internal::ElementsKindToString().

+ Here is the caller graph for this function:

◆ SetCapacityAndLength()

◆ SetLength()

◆ TearDown()

void v8::internal::ElementsAccessor::TearDown ( )
static

Definition at line 1750 of file elements.cc.

1750  {
1751  if (elements_accessors_ == NULL) return;
1752 #define ACCESSOR_DELETE(Class, Kind, Store) delete elements_accessors_[Kind];
1754 #undef ACCESSOR_DELETE
1756 }
#define ACCESSOR_DELETE(Class, Kind, Store)
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL

References ACCESSOR_DELETE, elements_accessors_, ELEMENTS_LIST, and NULL.

Referenced by v8::internal::V8::TearDown().

+ Here is the caller graph for this function:

◆ Validate()

Friends And Related Function Documentation

◆ SloppyArgumentsElementsAccessor

friend class SloppyArgumentsElementsAccessor
friend

Definition at line 195 of file elements.h.

Member Data Documentation

◆ elements_accessors_

ElementsAccessor ** v8::internal::ElementsAccessor::elements_accessors_ = NULL
staticprivate

Definition at line 211 of file elements.h.

Referenced by ForArray(), ForKind(), InitializeOncePerProcess(), and TearDown().

◆ kCopyToEnd

◆ kCopyToEndAndInitializeToHole

◆ name_

const char* v8::internal::ElementsAccessor::name_
private

Definition at line 212 of file elements.h.

Referenced by name().


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