V8 Project
v8::internal::SloppyArgumentsElementsAccessor Class Reference
+ Inheritance diagram for v8::internal::SloppyArgumentsElementsAccessor:
+ Collaboration diagram for v8::internal::SloppyArgumentsElementsAccessor:

Public Member Functions

 SloppyArgumentsElementsAccessor (const char *name)
 
- Public Member Functions inherited from v8::internal::ElementsAccessor
 ElementsAccessor (const char *name)
 
virtual ~ElementsAccessor ()
 
const char * name () const
 
bool HasElement (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key)
 
MUST_USE_RESULT MaybeHandle< ObjectGet (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key)
 
MUST_USE_RESULT PropertyAttributes GetAttributes (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key)
 
MUST_USE_RESULT MaybeHandle< AccessorPairGetAccessorPair (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key)
 
void CopyElements (Handle< JSObject > from_holder, Handle< FixedArrayBase > to, ElementsKind from_kind)
 
MUST_USE_RESULT MaybeHandle< FixedArrayAddElementsToFixedArray (Handle< Object > receiver, Handle< JSObject > holder, Handle< FixedArray > to)
 

Protected Member Functions

virtual MUST_USE_RESULT MaybeHandle< ObjectDelete (Handle< JSObject > obj, uint32_t key, JSReceiver::DeleteMode mode) FINAL OVERRIDE
 
- Protected Member Functions inherited from v8::internal::ElementsAccessorBase< SloppyArgumentsElementsAccessor, ElementsKindTraits< SLOPPY_ARGUMENTS_ELEMENTS > >
 ElementsAccessorBase (const char *name)
 
virtual ElementsKind kind () const FINAL OVERRIDE
 
virtual void Validate (Handle< JSObject > holder) FINAL OVERRIDE
 
virtual bool HasElement (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store) FINAL OVERRIDE
 
virtual MUST_USE_RESULT MaybeHandle< ObjectGet (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store) FINAL OVERRIDE
 
virtual MUST_USE_RESULT PropertyAttributes GetAttributes (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store) FINAL OVERRIDE
 
virtual MUST_USE_RESULT MaybeHandle< AccessorPairGetAccessorPair (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store) FINAL OVERRIDE
 
virtual MUST_USE_RESULT MaybeHandle< ObjectSetLength (Handle< JSArray > array, Handle< Object > length) FINAL OVERRIDE
 
virtual void SetCapacityAndLength (Handle< JSArray > array, int capacity, int length) FINAL OVERRIDE
 
virtual void CopyElements (Handle< FixedArrayBase > from, uint32_t from_start, ElementsKind from_kind, Handle< FixedArrayBase > to, uint32_t to_start, int copy_size) FINAL OVERRIDE
 
virtual void CopyElements (JSObject *from_holder, uint32_t from_start, ElementsKind from_kind, Handle< FixedArrayBase > to, uint32_t to_start, int copy_size) FINAL OVERRIDE
 
virtual MaybeHandle< FixedArrayAddElementsToFixedArray (Handle< Object > receiver, Handle< JSObject > holder, Handle< FixedArray > to, Handle< FixedArrayBase > from) FINAL OVERRIDE
 
virtual uint32_t GetCapacity (Handle< FixedArrayBase > backing_store) FINAL OVERRIDE
 
virtual uint32_t GetKeyForIndex (Handle< FixedArrayBase > backing_store, uint32_t index) FINAL OVERRIDE
 

Static Protected Member Functions

static MUST_USE_RESULT MaybeHandle< ObjectGetImpl (Handle< Object > receiver, Handle< JSObject > obj, uint32_t key, Handle< FixedArrayBase > parameters)
 
static MUST_USE_RESULT PropertyAttributes GetAttributesImpl (Handle< Object > receiver, Handle< JSObject > obj, uint32_t key, Handle< FixedArrayBase > backing_store)
 
static MUST_USE_RESULT MaybeHandle< AccessorPairGetAccessorPairImpl (Handle< Object > receiver, Handle< JSObject > obj, uint32_t key, Handle< FixedArrayBase > parameters)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetLengthImpl (Handle< JSObject > obj, Handle< Object > length, Handle< FixedArrayBase > parameter_map)
 
static void CopyElementsImpl (FixedArrayBase *from, uint32_t from_start, FixedArrayBase *to, ElementsKind from_kind, uint32_t to_start, int packed_size, int copy_size)
 
static uint32_t GetCapacityImpl (Handle< FixedArrayBase > backing_store)
 
static uint32_t GetKeyForIndexImpl (Handle< FixedArrayBase > dict, uint32_t index)
 
static bool HasElementImpl (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > parameters)
 
- Static Protected Member Functions inherited from v8::internal::ElementsAccessorBase< SloppyArgumentsElementsAccessor, ElementsKindTraits< SLOPPY_ARGUMENTS_ELEMENTS > >
static void ValidateContents (Handle< JSObject > holder, int length)
 
static void ValidateImpl (Handle< JSObject > holder)
 
static bool HasElementImpl (Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetImpl (Handle< Object > receiver, Handle< JSObject > obj, uint32_t key, Handle< FixedArrayBase > backing_store)
 
static MUST_USE_RESULT PropertyAttributes GetAttributesImpl (Handle< Object > receiver, Handle< JSObject > obj, uint32_t key, Handle< FixedArrayBase > backing_store)
 
static MUST_USE_RESULT MaybeHandle< AccessorPairGetAccessorPairImpl (Handle< Object > receiver, Handle< JSObject > obj, uint32_t key, Handle< FixedArrayBase > backing_store)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetLengthImpl (Handle< JSObject > obj, Handle< Object > length, Handle< FixedArrayBase > backing_store)
 
static void SetFastElementsCapacityAndLength (Handle< JSObject > obj, int capacity, int length)
 
static void CopyElementsImpl (FixedArrayBase *from, uint32_t from_start, FixedArrayBase *to, ElementsKind from_kind, uint32_t to_start, int packed_size, int copy_size)
 
static uint32_t GetCapacityImpl (Handle< FixedArrayBase > backing_store)
 
static uint32_t GetKeyForIndexImpl (Handle< FixedArrayBase > backing_store, uint32_t index)
 

Static Private Member Functions

static Handle< ObjectGetParameterMapArg (Handle< JSObject > holder, Handle< FixedArray > parameter_map, uint32_t key)
 

Friends

class ElementsAccessorBase< SloppyArgumentsElementsAccessor, ElementsKindTraits< SLOPPY_ARGUMENTS_ELEMENTS > >
 

Additional Inherited Members

- Static Public Member Functions inherited from v8::internal::ElementsAccessor
static ElementsAccessorForKind (ElementsKind elements_kind)
 
static ElementsAccessorForArray (Handle< FixedArrayBase > array)
 
static void InitializeOncePerProcess ()
 
static void TearDown ()
 
- Static Public Attributes inherited from v8::internal::ElementsAccessor
static const int kCopyToEnd = -1
 
static const int kCopyToEndAndInitializeToHole = -2
 
- Protected Types inherited from v8::internal::ElementsAccessorBase< SloppyArgumentsElementsAccessor, ElementsKindTraits< SLOPPY_ARGUMENTS_ELEMENTS > >
typedef ElementsKindTraits< SLOPPY_ARGUMENTS_ELEMENTS > ElementsTraits
 
typedef ElementsTraitsParam::BackingStore BackingStore
 

Detailed Description

Definition at line 1553 of file elements.cc.

Constructor & Destructor Documentation

◆ SloppyArgumentsElementsAccessor()

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

Definition at line 1557 of file elements.cc.

1560  ElementsKindTraits<SLOPPY_ARGUMENTS_ELEMENTS> >(name) {}
const char * name() const
Definition: elements.h:24
friend class SloppyArgumentsElementsAccessor
Definition: elements.h:195

Member Function Documentation

◆ CopyElementsImpl()

static void v8::internal::SloppyArgumentsElementsAccessor::CopyElementsImpl ( FixedArrayBase from,
uint32_t  from_start,
FixedArrayBase to,
ElementsKind  from_kind,
uint32_t  to_start,
int  packed_size,
int  copy_size 
)
inlinestaticprotected

Definition at line 1674 of file elements.cc.

1677  {
1678  UNREACHABLE();
1679  }
#define UNREACHABLE()
Definition: logging.h:30

References UNREACHABLE.

◆ Delete()

virtual MUST_USE_RESULT MaybeHandle<Object> v8::internal::SloppyArgumentsElementsAccessor::Delete ( Handle< JSObject obj,
uint32_t  key,
JSReceiver::DeleteMode  mode 
)
inlineprotectedvirtual

Implements v8::internal::ElementsAccessorBase< SloppyArgumentsElementsAccessor, ElementsKindTraits< SLOPPY_ARGUMENTS_ELEMENTS > >.

Definition at line 1648 of file elements.cc.

1651  {
1652  Isolate* isolate = obj->GetIsolate();
1653  Handle<FixedArray> parameter_map(FixedArray::cast(obj->elements()));
1654  Handle<Object> probe = GetParameterMapArg(obj, parameter_map, key);
1655  if (!probe->IsTheHole()) {
1656  // TODO(kmillikin): We could check if this was the last aliased
1657  // parameter, and revert to normal elements in that case. That
1658  // would enable GC of the context.
1659  parameter_map->set_the_hole(key + 2);
1660  } else {
1661  Handle<FixedArray> arguments(FixedArray::cast(parameter_map->get(1)));
1662  if (arguments->IsDictionary()) {
1664  } else {
1665  // It's difficult to access the version of DeleteCommon that is declared
1666  // in the templatized super class, call the concrete implementation in
1667  // the class for the most generalized ElementsKind subclass.
1669  }
1670  }
1671  return isolate->factory()->true_value();
1672  }
static MUST_USE_RESULT MaybeHandle< Object > DeleteCommon(Handle< JSObject > obj, uint32_t key, JSReceiver::DeleteMode mode)
Definition: elements.cc:1421
static Handle< Object > DeleteCommon(Handle< JSObject > obj, uint32_t key, JSReceiver::DeleteMode mode)
Definition: elements.cc:936
static Handle< Object > GetParameterMapArg(Handle< JSObject > holder, Handle< FixedArray > parameter_map, uint32_t key)
Definition: elements.cc:1717
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 mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp

References v8::internal::FastElementsAccessor< FastElementsAccessorSubclass, KindTraits >::DeleteCommon(), v8::internal::DictionaryElementsAccessor::DeleteCommon(), v8::internal::Isolate::factory(), GetParameterMapArg(), and mode().

+ Here is the call graph for this function:

◆ GetAccessorPairImpl()

static MUST_USE_RESULT MaybeHandle<AccessorPair> v8::internal::SloppyArgumentsElementsAccessor::GetAccessorPairImpl ( Handle< Object receiver,
Handle< JSObject obj,
uint32_t  key,
Handle< FixedArrayBase parameters 
)
inlinestaticprotected

Definition at line 1621 of file elements.cc.

1625  {
1626  Handle<FixedArray> parameter_map = Handle<FixedArray>::cast(parameters);
1627  Handle<Object> probe = GetParameterMapArg(obj, parameter_map, key);
1628  if (!probe->IsTheHole()) {
1629  return MaybeHandle<AccessorPair>();
1630  } else {
1631  // If not aliased, check the arguments.
1632  Handle<FixedArray> arguments(FixedArray::cast(parameter_map->get(1)));
1633  return ElementsAccessor::ForArray(arguments)->GetAccessorPair(
1634  receiver, obj, key, arguments);
1635  }
1636  }
static ElementsAccessor * ForArray(Handle< FixedArrayBase > array)
Definition: elements.cc:1731
virtual MUST_USE_RESULT MaybeHandle< AccessorPair > GetAccessorPair(Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store)=0
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116

References v8::internal::Handle< T >::cast(), v8::internal::ElementsAccessor::ForArray(), v8::internal::ElementsAccessor::GetAccessorPair(), and GetParameterMapArg().

+ Here is the call graph for this function:

◆ GetAttributesImpl()

static MUST_USE_RESULT PropertyAttributes v8::internal::SloppyArgumentsElementsAccessor::GetAttributesImpl ( Handle< Object receiver,
Handle< JSObject obj,
uint32_t  key,
Handle< FixedArrayBase backing_store 
)
inlinestaticprotected

Definition at line 1604 of file elements.cc.

1608  {
1609  Handle<FixedArray> parameter_map = Handle<FixedArray>::cast(backing_store);
1610  Handle<Object> probe = GetParameterMapArg(obj, parameter_map, key);
1611  if (!probe->IsTheHole()) {
1612  return NONE;
1613  } else {
1614  // If not aliased, check the arguments.
1615  Handle<FixedArray> arguments(FixedArray::cast(parameter_map->get(1)));
1616  return ElementsAccessor::ForArray(arguments)->GetAttributes(
1617  receiver, obj, key, arguments);
1618  }
1619  }
virtual MUST_USE_RESULT PropertyAttributes GetAttributes(Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store)=0
@ NONE

References v8::internal::Handle< T >::cast(), v8::internal::ElementsAccessor::ForArray(), v8::internal::ElementsAccessor::GetAttributes(), GetParameterMapArg(), and NONE.

+ Here is the call graph for this function:

◆ GetCapacityImpl()

static uint32_t v8::internal::SloppyArgumentsElementsAccessor::GetCapacityImpl ( Handle< FixedArrayBase backing_store)
inlinestaticprotected

Definition at line 1681 of file elements.cc.

1681  {
1682  Handle<FixedArray> parameter_map = Handle<FixedArray>::cast(backing_store);
1683  Handle<FixedArrayBase> arguments(
1684  FixedArrayBase::cast(parameter_map->get(1)));
1685  return Max(static_cast<uint32_t>(parameter_map->length() - 2),
1686  ForArray(arguments)->GetCapacity(arguments));
1687  }
static LifetimePosition Max(LifetimePosition a, LifetimePosition b)

References v8::internal::Handle< T >::cast(), v8::internal::ElementsAccessor::ForArray(), v8::internal::ElementsAccessorBase< SloppyArgumentsElementsAccessor, ElementsKindTraits< SLOPPY_ARGUMENTS_ELEMENTS > >::GetCapacity(), and v8::internal::Max().

+ Here is the call graph for this function:

◆ GetImpl()

static MUST_USE_RESULT MaybeHandle<Object> v8::internal::SloppyArgumentsElementsAccessor::GetImpl ( Handle< Object receiver,
Handle< JSObject obj,
uint32_t  key,
Handle< FixedArrayBase parameters 
)
inlinestaticprotected

Definition at line 1566 of file elements.cc.

1570  {
1571  Isolate* isolate = obj->GetIsolate();
1572  Handle<FixedArray> parameter_map = Handle<FixedArray>::cast(parameters);
1573  Handle<Object> probe = GetParameterMapArg(obj, parameter_map, key);
1574  if (!probe->IsTheHole()) {
1575  DisallowHeapAllocation no_gc;
1576  Context* context = Context::cast(parameter_map->get(0));
1577  int context_index = Handle<Smi>::cast(probe)->value();
1578  DCHECK(!context->get(context_index)->IsTheHole());
1579  return handle(context->get(context_index), isolate);
1580  } else {
1581  // Object is not mapped, defer to the arguments.
1582  Handle<FixedArray> arguments(FixedArray::cast(parameter_map->get(1)),
1583  isolate);
1584  Handle<Object> result;
1586  isolate, result,
1587  ElementsAccessor::ForArray(arguments)->Get(
1588  receiver, obj, key, arguments),
1589  Object);
1590  // Elements of the arguments object in slow mode might be slow aliases.
1591  if (result->IsAliasedArgumentsEntry()) {
1592  DisallowHeapAllocation no_gc;
1593  AliasedArgumentsEntry* entry = AliasedArgumentsEntry::cast(*result);
1594  Context* context = Context::cast(parameter_map->get(0));
1595  int context_index = entry->aliased_context_slot();
1596  DCHECK(!context->get(context_index)->IsTheHole());
1597  return handle(context->get(context_index), isolate);
1598  } else {
1599  return result;
1600  }
1601  }
1602  }
static Context * cast(Object *context)
Definition: contexts.h:255
virtual MUST_USE_RESULT MaybeHandle< Object > Get(Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store) FINAL OVERRIDE
Definition: elements.cc:609
#define ASSIGN_RETURN_ON_EXCEPTION(isolate, dst, call, T)
Definition: isolate.h:135
#define DCHECK(condition)
Definition: logging.h:205
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110
kSerializedDataOffset Object
Definition: objects-inl.h:5322
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References v8::internal::AliasedArgumentsEntry::aliased_context_slot(), ASSIGN_RETURN_ON_EXCEPTION, v8::internal::Handle< T >::cast(), v8::internal::Context::cast(), DCHECK, v8::internal::ElementsAccessor::ForArray(), v8::internal::ElementsAccessorBase< SloppyArgumentsElementsAccessor, ElementsKindTraits< SLOPPY_ARGUMENTS_ELEMENTS > >::Get(), v8::internal::FixedArray::get(), GetParameterMapArg(), and v8::internal::handle().

+ Here is the call graph for this function:

◆ GetKeyForIndexImpl()

static uint32_t v8::internal::SloppyArgumentsElementsAccessor::GetKeyForIndexImpl ( Handle< FixedArrayBase dict,
uint32_t  index 
)
inlinestaticprotected

Definition at line 1689 of file elements.cc.

1690  {
1691  return index;
1692  }

◆ GetParameterMapArg()

static Handle<Object> v8::internal::SloppyArgumentsElementsAccessor::GetParameterMapArg ( Handle< JSObject holder,
Handle< FixedArray parameter_map,
uint32_t  key 
)
inlinestaticprivate

Definition at line 1717 of file elements.cc.

1719  {
1720  Isolate* isolate = holder->GetIsolate();
1721  uint32_t length = holder->IsJSArray()
1722  ? Smi::cast(Handle<JSArray>::cast(holder)->length())->value()
1723  : parameter_map->length();
1724  return key < (length - 2)
1725  ? handle(parameter_map->get(key + 2), isolate)
1726  : Handle<Object>::cast(isolate->factory()->the_hole_value());
1727  }

References v8::internal::Isolate::factory(), and v8::internal::handle().

Referenced by Delete(), GetAccessorPairImpl(), GetAttributesImpl(), GetImpl(), and HasElementImpl().

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

◆ HasElementImpl()

static bool v8::internal::SloppyArgumentsElementsAccessor::HasElementImpl ( Handle< Object receiver,
Handle< JSObject holder,
uint32_t  key,
Handle< FixedArrayBase parameters 
)
inlinestaticprotected

Definition at line 1694 of file elements.cc.

1697  {
1698  Handle<FixedArray> parameter_map = Handle<FixedArray>::cast(parameters);
1699  Handle<Object> probe = GetParameterMapArg(holder, parameter_map, key);
1700  if (!probe->IsTheHole()) {
1701  return true;
1702  } else {
1703  Isolate* isolate = holder->GetIsolate();
1704  Handle<FixedArrayBase> arguments(FixedArrayBase::cast(
1705  Handle<FixedArray>::cast(parameter_map)->get(1)), isolate);
1706  ElementsAccessor* accessor = ElementsAccessor::ForArray(arguments);
1707  Handle<Object> value;
1709  isolate, value,
1710  accessor->Get(receiver, holder, key, arguments),
1711  false);
1712  return !value->IsTheHole();
1713  }
1714  }
ElementsAccessor(const char *name)
Definition: elements.h:20
#define ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value)
Definition: isolate.h:123

References ASSIGN_RETURN_ON_EXCEPTION_VALUE, v8::internal::Handle< T >::cast(), v8::internal::ElementsAccessor::ForArray(), v8::internal::ElementsAccessor::Get(), and GetParameterMapArg().

+ Here is the call graph for this function:

◆ SetLengthImpl()

static MUST_USE_RESULT MaybeHandle<Object> v8::internal::SloppyArgumentsElementsAccessor::SetLengthImpl ( Handle< JSObject obj,
Handle< Object length,
Handle< FixedArrayBase parameter_map 
)
inlinestaticprotected

Definition at line 1638 of file elements.cc.

1641  {
1642  // TODO(mstarzinger): This was never implemented but will be used once we
1643  // correctly implement [[DefineOwnProperty]] on arrays.
1644  UNIMPLEMENTED();
1645  return obj;
1646  }
#define UNIMPLEMENTED()
Definition: logging.h:28

References UNIMPLEMENTED.

Friends And Related Function Documentation

◆ ElementsAccessorBase< SloppyArgumentsElementsAccessor, ElementsKindTraits< SLOPPY_ARGUMENTS_ELEMENTS > >


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