V8 Project
v8::internal::JSReceiver Class Reference

#include <objects.h>

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

Public Types

enum  DeleteMode { NORMAL_DELETION , STRICT_DELETION , FORCE_DELETION }
 
enum  KeyCollectionType { OWN_ONLY , INCLUDE_PROTOS }
 
- Public Types inherited from v8::internal::Object
enum  StoreFromKeyed { MAY_BE_STORE_FROM_KEYED , CERTAINLY_NOT_STORE_FROM_KEYED }
 
enum  StorePropertyMode { NORMAL_PROPERTY , SUPER_PROPERTY }
 

Public Member Functions

bool IsSimpleEnum ()
 
Stringclass_name ()
 
Stringconstructor_name ()
 
ObjectGetConstructor ()
 
ObjectGetIdentityHash ()
 
- Public Member Functions inherited from v8::internal::HeapObject
Mapmap () const
 
void set_map (Map *value)
 
void set_map_no_write_barrier (Map *value)
 
Mapsynchronized_map ()
 
MapWord synchronized_map_word () const
 
void synchronized_set_map (Map *value)
 
void synchronized_set_map_no_write_barrier (Map *value)
 
void synchronized_set_map_word (MapWord map_word)
 
MapWord map_word () const
 
void set_map_word (MapWord map_word)
 
HeapGetHeap () const
 
IsolateGetIsolate () const
 
Address address ()
 
void Iterate (ObjectVisitor *v)
 
void IterateBody (InstanceType type, int object_size, ObjectVisitor *v)
 
int Size ()
 
bool MayContainRawValues ()
 
int SizeFromMap (Map *map)
 
WriteBarrierMode GetWriteBarrierMode (const DisallowHeapAllocation &promise)
 
void HeapObjectShortPrint (OStream &os)
 
 STATIC_ASSERT (kMapOffset==Internals::kHeapObjectMapOffset)
 
- Public Member Functions inherited from v8::internal::Object
bool IsObject () const
 
 INLINE (bool IsFixedArrayBase() const)
 
 INLINE (bool IsExternal() const)
 
 INLINE (bool IsAccessorInfo() const)
 
 INLINE (bool IsStruct() const)
 
 INLINE (bool IsSpecObject()) const
 
 INLINE (bool IsSpecFunction()) const
 
 INLINE (bool IsTemplateInfo()) const
 
 INLINE (bool IsNameDictionary() const)
 
 INLINE (bool IsSeededNumberDictionary() const)
 
 INLINE (bool IsUnseededNumberDictionary() const)
 
 INLINE (bool IsOrderedHashSet() const)
 
 INLINE (bool IsOrderedHashMap() const)
 
bool IsCallable () const
 
 INLINE (bool IsUndefined() const)
 
 INLINE (bool IsNull() const)
 
 INLINE (bool IsTheHole() const)
 
 INLINE (bool IsException() const)
 
 INLINE (bool IsUninitialized() const)
 
 INLINE (bool IsTrue() const)
 
 INLINE (bool IsFalse() const)
 
 INLINE (bool IsArgumentsMarker() const)
 
 INLINE (bool IsFiller() const)
 
double Number ()
 
 INLINE (bool IsNaN() const)
 
 INLINE (bool IsMinusZero() const)
 
bool ToInt32 (int32_t *value)
 
bool ToUint32 (uint32_t *value)
 
Representation OptimalRepresentation ()
 
bool FitsRepresentation (Representation representation)
 
Handle< HeapTypeOptimalType (Isolate *isolate, Representation representation)
 
bool HasValidElements ()
 
bool HasSpecificClassOf (String *name)
 
bool BooleanValue ()
 
ObjectGetHash ()
 
bool SameValue (Object *other)
 
bool SameValueZero (Object *other)
 
bool ToArrayIndex (uint32_t *index)
 
bool IsStringObjectWithCharacterAt (uint32_t index)
 
void VerifyApiCallResultType ()
 
void ShortPrint (FILE *out=stdout)
 
void ShortPrint (StringStream *accumulator)
 

Static Public Member Functions

static MUST_USE_RESULT MaybeHandle< ObjectSetElement (Handle< JSReceiver > object, uint32_t index, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode)
 
static MUST_USE_RESULT Maybe< boolHasProperty (Handle< JSReceiver > object, Handle< Name > name)
 
static MUST_USE_RESULT Maybe< boolHasOwnProperty (Handle< JSReceiver >, Handle< Name > name)
 
static MUST_USE_RESULT Maybe< boolHasElement (Handle< JSReceiver > object, uint32_t index)
 
static MUST_USE_RESULT Maybe< boolHasOwnElement (Handle< JSReceiver > object, uint32_t index)
 
static MUST_USE_RESULT MaybeHandle< ObjectDeleteProperty (Handle< JSReceiver > object, Handle< Name > name, DeleteMode mode=NORMAL_DELETION)
 
static MUST_USE_RESULT MaybeHandle< ObjectDeleteElement (Handle< JSReceiver > object, uint32_t index, DeleteMode mode=NORMAL_DELETION)
 
static MUST_USE_RESULT Maybe< PropertyAttributesGetPropertyAttributes (Handle< JSReceiver > object, Handle< Name > name)
 
static MUST_USE_RESULT Maybe< PropertyAttributesGetPropertyAttributes (LookupIterator *it)
 
static MUST_USE_RESULT Maybe< PropertyAttributesGetOwnPropertyAttributes (Handle< JSReceiver > object, Handle< Name > name)
 
static MUST_USE_RESULT Maybe< PropertyAttributesGetElementAttribute (Handle< JSReceiver > object, uint32_t index)
 
static MUST_USE_RESULT Maybe< PropertyAttributesGetOwnElementAttribute (Handle< JSReceiver > object, uint32_t index)
 
static Handle< SmiGetOrCreateIdentityHash (Handle< JSReceiver > object)
 
static MUST_USE_RESULT MaybeHandle< FixedArrayGetKeys (Handle< JSReceiver > object, KeyCollectionType type)
 
- Static Public Member Functions inherited from v8::internal::HeapObject
static HeapObjectFromAddress (Address address)
 
static Object ** RawField (HeapObject *obj, int offset)
 
static void UpdateMapCodeCache (Handle< HeapObject > object, Handle< Name > name, Handle< Code > code)
 
- Static Public Member Functions inherited from v8::internal::Object
static Handle< ObjectNewStorageFor (Isolate *isolate, Handle< Object > object, Representation representation)
 
static Handle< ObjectWrapForRead (Isolate *isolate, Handle< Object > object, Representation representation)
 
static MaybeHandle< JSReceiverToObject (Isolate *isolate, Handle< Object > object)
 
static MaybeHandle< JSReceiverToObject (Isolate *isolate, Handle< Object > object, Handle< Context > context)
 
static MUST_USE_RESULT MaybeHandle< SmiToSmi (Isolate *isolate, Handle< Object > object)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (LookupIterator *it)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetProperty (Handle< Object > object, Handle< Name > key, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode=MAY_BE_STORE_FROM_KEYED)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode, StorePropertyMode data_store_mode=NORMAL_PROPERTY)
 
static MUST_USE_RESULT MaybeHandle< ObjectWriteToReadOnlyProperty (LookupIterator *it, Handle< Object > value, StrictMode strict_mode)
 
static Handle< ObjectSetDataProperty (LookupIterator *it, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectAddDataProperty (LookupIterator *it, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode, StoreFromKeyed store_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyOrElement (Handle< Object > object, Handle< Name > key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (Isolate *isolate, Handle< Object > object, const char *key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetProperty (Handle< Object > object, Handle< Name > key)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< JSObject > holder, Handle< Object > structure)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithAccessor (Handle< Object > receiver, Handle< Name > name, Handle< Object > value, Handle< JSObject > holder, Handle< Object > structure, StrictMode strict_mode)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetPropertyWithDefinedGetter (Handle< Object > receiver, Handle< JSReceiver > getter)
 
static MUST_USE_RESULT MaybeHandle< ObjectSetPropertyWithDefinedSetter (Handle< Object > receiver, Handle< JSReceiver > setter, Handle< Object > value)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElement (Isolate *isolate, Handle< Object > object, uint32_t index)
 
static MUST_USE_RESULT MaybeHandle< ObjectGetElementWithReceiver (Isolate *isolate, Handle< Object > object, Handle< Object > receiver, uint32_t index)
 
static Handle< SmiGetOrCreateHash (Isolate *isolate, Handle< Object > object)
 

Private Member Functions

 DISALLOW_IMPLICIT_CONSTRUCTORS (JSReceiver)
 

Additional Inherited Members

- Static Public Attributes inherited from v8::internal::HeapObject
static const int kMapOffset = Object::kHeaderSize
 
static const int kHeaderSize = kMapOffset + kPointerSize
 
- Static Public Attributes inherited from v8::internal::Object
static const int kHeaderSize = 0
 
- Protected Member Functions inherited from v8::internal::HeapObject
void IteratePointers (ObjectVisitor *v, int start, int end)
 
void IteratePointer (ObjectVisitor *v, int offset)
 
void IterateNextCodeLink (ObjectVisitor *v, int offset)
 

Detailed Description

Definition at line 1565 of file objects.h.

Member Enumeration Documentation

◆ DeleteMode

Enumerator
NORMAL_DELETION 
STRICT_DELETION 
FORCE_DELETION 

Definition at line 1567 of file objects.h.

◆ KeyCollectionType

Enumerator
OWN_ONLY 
INCLUDE_PROTOS 

Definition at line 1636 of file objects.h.

Member Function Documentation

◆ class_name()

String * v8::internal::JSReceiver::class_name ( )

Definition at line 1676 of file objects.cc.

1676  {
1677  if (IsJSFunction() || IsJSFunctionProxy()) {
1678  return GetHeap()->Function_string();
1679  }
1680  if (map()->constructor()->IsJSFunction()) {
1681  JSFunction* constructor = JSFunction::cast(map()->constructor());
1682  return String::cast(constructor->shared()->instance_class_name());
1683  }
1684  // If the constructor is not present, return "Object".
1685  return GetHeap()->Object_string();
1686 }
Heap * GetHeap() const
Definition: objects-inl.h:1379

Referenced by v8::internal::Logger::ApiIndexedPropertyAccess(), and v8::internal::Logger::ApiNamedPropertyAccess().

+ Here is the caller graph for this function:

◆ constructor_name()

String * v8::internal::JSReceiver::constructor_name ( )

Definition at line 1705 of file objects.cc.

1705  {
1706  return map()->constructor_name();
1707 }
String * constructor_name()
Definition: objects.cc:1689

Referenced by v8::internal::JSObject::JSObjectShortPrint().

+ Here is the caller graph for this function:

◆ DeleteElement()

MaybeHandle< Object > v8::internal::JSReceiver::DeleteElement ( Handle< JSReceiver object,
uint32_t  index,
DeleteMode  mode = NORMAL_DELETION 
)
static

Definition at line 5002 of file objects.cc.

5004  {
5005  if (object->IsJSProxy()) {
5007  Handle<JSProxy>::cast(object), index, mode);
5008  }
5009  return JSObject::DeleteElement(Handle<JSObject>::cast(object), index, mode);
5010 }
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
static MUST_USE_RESULT MaybeHandle< Object > DeleteElement(Handle< JSObject > object, uint32_t index, DeleteMode mode)
Definition: objects.cc:4838
static MUST_USE_RESULT MaybeHandle< Object > DeleteElementWithHandler(Handle< JSProxy > proxy, uint32_t index, DeleteMode mode)
Definition: objects.cc:3564
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::JSObject::DeleteElement(), v8::internal::JSProxy::DeleteElementWithHandler(), and mode().

Referenced by v8::Object::Delete(), and v8::internal::Runtime::DeleteObjectProperty().

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

◆ DeleteProperty()

MaybeHandle< Object > v8::internal::JSReceiver::DeleteProperty ( Handle< JSReceiver object,
Handle< Name name,
DeleteMode  mode = NORMAL_DELETION 
)
static

Definition at line 5013 of file objects.cc.

5015  {
5016  if (object->IsJSProxy()) {
5018  Handle<JSProxy>::cast(object), name, mode);
5019  }
5021 }
static MUST_USE_RESULT MaybeHandle< Object > DeleteProperty(Handle< JSObject > object, Handle< Name > name, DeleteMode mode)
Definition: objects.cc:4912
static MUST_USE_RESULT MaybeHandle< Object > DeletePropertyWithHandler(Handle< JSProxy > proxy, Handle< Name > name, DeleteMode mode)
Definition: objects.cc:3532
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 name

References v8::internal::JSObject::DeleteProperty(), v8::internal::JSProxy::DeletePropertyWithHandler(), mode(), and name.

Referenced by v8::internal::Runtime::DeleteObjectProperty(), and v8::internal::RUNTIME_FUNCTION().

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

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::JSReceiver::DISALLOW_IMPLICIT_CONSTRUCTORS ( JSReceiver  )
private

◆ GetConstructor()

Object * v8::internal::JSReceiver::GetConstructor ( )
inline

Definition at line 6641 of file objects-inl.h.

6641  {
6642  return map()->constructor();
6643 }

References v8::internal::HeapObject::map().

+ Here is the call graph for this function:

◆ GetElementAttribute()

Maybe< PropertyAttributes > v8::internal::JSReceiver::GetElementAttribute ( Handle< JSReceiver object,
uint32_t  index 
)
inlinestatic

Definition at line 6681 of file objects-inl.h.

6682  {
6683  if (object->IsJSProxy()) {
6685  Handle<JSProxy>::cast(object), object, index);
6686  }
6688  Handle<JSObject>::cast(object), object, index, true);
6689 }
static MUST_USE_RESULT Maybe< PropertyAttributes > GetElementAttributeWithReceiver(Handle< JSObject > object, Handle< JSReceiver > receiver, uint32_t index, bool check_prototype)
Definition: objects.cc:4025
static MUST_USE_RESULT Maybe< PropertyAttributes > GetElementAttributeWithHandler(Handle< JSProxy > proxy, Handle< JSReceiver > receiver, uint32_t index)
Definition: objects.cc:3647

References v8::internal::JSProxy::GetElementAttributeWithHandler(), and v8::internal::JSObject::GetElementAttributeWithReceiver().

Referenced by GetPropertyAttributes().

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

◆ GetIdentityHash()

Object * v8::internal::JSReceiver::GetIdentityHash ( )
inline

Definition at line 6711 of file objects-inl.h.

6711  {
6712  return IsJSProxy()
6713  ? JSProxy::cast(this)->GetIdentityHash()
6714  : JSObject::cast(this)->GetIdentityHash();
6715 }

◆ GetKeys()

MaybeHandle< FixedArray > v8::internal::JSReceiver::GetKeys ( Handle< JSReceiver object,
KeyCollectionType  type 
)
static

Definition at line 5797 of file objects.cc.

5798  {
5800  Isolate* isolate = object->GetIsolate();
5801  Handle<FixedArray> content = isolate->factory()->empty_fixed_array();
5802  Handle<JSFunction> arguments_function(
5803  JSFunction::cast(isolate->sloppy_arguments_map()->constructor()));
5804 
5805  // Only collect keys if access is permitted.
5806  for (PrototypeIterator iter(isolate, object,
5808  !iter.IsAtEnd(); iter.Advance()) {
5809  if (PrototypeIterator::GetCurrent(iter)->IsJSProxy()) {
5810  Handle<JSProxy> proxy(JSProxy::cast(*PrototypeIterator::GetCurrent(iter)),
5811  isolate);
5812  Handle<Object> args[] = { proxy };
5813  Handle<Object> names;
5815  isolate, names,
5816  Execution::Call(isolate,
5817  isolate->proxy_enumerate(),
5818  object,
5819  arraysize(args),
5820  args),
5821  FixedArray);
5823  isolate, content,
5825  content, Handle<JSObject>::cast(names)),
5826  FixedArray);
5827  break;
5828  }
5829 
5830  Handle<JSObject> current =
5832 
5833  // Check access rights if required.
5834  if (current->IsAccessCheckNeeded() &&
5835  !isolate->MayNamedAccess(
5836  current, isolate->factory()->undefined_value(), v8::ACCESS_KEYS)) {
5837  isolate->ReportFailedAccessCheck(current, v8::ACCESS_KEYS);
5838  RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, FixedArray);
5839  break;
5840  }
5841 
5842  // Compute the element keys.
5843  Handle<FixedArray> element_keys =
5844  isolate->factory()->NewFixedArray(current->NumberOfEnumElements());
5845  current->GetEnumElementKeys(*element_keys);
5847  isolate, content,
5848  FixedArray::UnionOfKeys(content, element_keys),
5849  FixedArray);
5850  DCHECK(ContainsOnlyValidKeys(content));
5851 
5852  // Add the element keys from the interceptor.
5853  if (current->HasIndexedInterceptor()) {
5854  Handle<JSObject> result;
5856  current, object).ToHandle(&result)) {
5858  isolate, content,
5859  FixedArray::AddKeysFromArrayLike(content, result),
5860  FixedArray);
5861  }
5862  DCHECK(ContainsOnlyValidKeys(content));
5863  }
5864 
5865  // We can cache the computed property keys if access checks are
5866  // not needed and no interceptors are involved.
5867  //
5868  // We do not use the cache if the object has elements and
5869  // therefore it does not make sense to cache the property names
5870  // for arguments objects. Arguments objects will always have
5871  // elements.
5872  // Wrapped strings have elements, but don't have an elements
5873  // array or dictionary. So the fast inline test for whether to
5874  // use the cache says yes, so we should not create a cache.
5875  bool cache_enum_keys =
5876  ((current->map()->constructor() != *arguments_function) &&
5877  !current->IsJSValue() &&
5878  !current->IsAccessCheckNeeded() &&
5879  !current->HasNamedInterceptor() &&
5880  !current->HasIndexedInterceptor());
5881  // Compute the property keys and cache them if possible.
5883  isolate, content,
5885  content, GetEnumPropertyKeys(current, cache_enum_keys)),
5886  FixedArray);
5887  DCHECK(ContainsOnlyValidKeys(content));
5888 
5889  // Add the property keys from the interceptor.
5890  if (current->HasNamedInterceptor()) {
5891  Handle<JSObject> result;
5893  current, object).ToHandle(&result)) {
5895  isolate, content,
5896  FixedArray::AddKeysFromArrayLike(content, result),
5897  FixedArray);
5898  }
5899  DCHECK(ContainsOnlyValidKeys(content));
5900  }
5901 
5902  // If we only want own properties we bail out after the first
5903  // iteration.
5904  if (type == OWN_ONLY) break;
5905  }
5906  return content;
5907 }
static MUST_USE_RESULT MaybeHandle< FixedArray > AddKeysFromArrayLike(Handle< FixedArray > content, Handle< JSObject > array)
Definition: objects.cc:7699
static MUST_USE_RESULT MaybeHandle< FixedArray > UnionOfKeys(Handle< FixedArray > first, Handle< FixedArray > second)
Definition: objects.cc:7723
static MUST_USE_RESULT MaybeHandle< JSObject > GetKeysForIndexedInterceptor(Handle< JSObject > object, Handle< JSReceiver > receiver)
Definition: objects.cc:13181
static MUST_USE_RESULT MaybeHandle< JSObject > GetKeysForNamedInterceptor(Handle< JSObject > object, Handle< JSReceiver > receiver)
Definition: objects.cc:13156
friend class PrototypeIterator
Definition: objects.h:1227
Object * GetCurrent() const
Definition: prototype.h:62
#define ASSIGN_RETURN_ON_EXCEPTION(isolate, dst, call, T)
Definition: isolate.h:135
#define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, T)
Definition: isolate.h:120
#define DCHECK(condition)
Definition: logging.h:205
void USE(T)
Definition: macros.h:322
#define arraysize(array)
Definition: macros.h:86
static Handle< FixedArray > GetEnumPropertyKeys(Handle< JSObject > object, bool cache_result)
Definition: objects.cc:5699
static bool ContainsOnlyValidKeys(Handle< FixedArray > array)
Definition: objects.cc:5677
@ ACCESS_KEYS
Definition: v8.h:3524

References v8::ACCESS_KEYS, v8::internal::FixedArray::AddKeysFromArrayLike(), arraysize, ASSIGN_RETURN_ON_EXCEPTION, v8::internal::Handle< T >::cast(), v8::internal::ContainsOnlyValidKeys(), DCHECK, v8::internal::Isolate::factory(), v8::internal::PrototypeIterator::GetCurrent(), v8::internal::GetEnumPropertyKeys(), v8::internal::JSObject::GetKeysForIndexedInterceptor(), v8::internal::JSObject::GetKeysForNamedInterceptor(), v8::internal::PrototypeIterator::IsAtEnd(), v8::internal::Isolate::MayNamedAccess(), v8::internal::Isolate::ReportFailedAccessCheck(), RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION, v8::internal::PrototypeIterator::START_AT_RECEIVER, v8::internal::FixedArray::UnionOfKeys(), and USE().

Referenced by v8::Object::GetOwnPropertyNames(), v8::Object::GetPropertyNames(), v8::internal::MaterializeClosure(), v8::internal::MaterializeLocalContext(), and v8::internal::RUNTIME_FUNCTION().

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

◆ GetOrCreateIdentityHash()

Handle< Smi > v8::internal::JSReceiver::GetOrCreateIdentityHash ( Handle< JSReceiver object)
inlinestatic

Definition at line 6704 of file objects-inl.h.

6704  {
6705  return object->IsJSProxy()
6707  : JSObject::GetOrCreateIdentityHash(Handle<JSObject>::cast(object));
6708 }
static Handle< Smi > GetOrCreateIdentityHash(Handle< JSProxy > proxy)
Definition: objects.cc:4589
static Handle< Smi > GetOrCreateIdentityHash(Handle< JSReceiver > object)
Definition: objects-inl.h:6704

References v8::internal::JSObject::GetOrCreateIdentityHash(), and v8::internal::JSProxy::GetOrCreateIdentityHash().

Referenced by v8::Object::GetIdentityHash(), and v8::internal::Object::GetOrCreateHash().

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

◆ GetOwnElementAttribute()

Maybe< PropertyAttributes > v8::internal::JSReceiver::GetOwnElementAttribute ( Handle< JSReceiver object,
uint32_t  index 
)
inlinestatic

Definition at line 6743 of file objects-inl.h.

6744  {
6745  if (object->IsJSProxy()) {
6747  Handle<JSProxy>::cast(object), object, index);
6748  }
6750  Handle<JSObject>::cast(object), object, index, false);
6751 }

References v8::internal::JSProxy::GetElementAttributeWithHandler(), and v8::internal::JSObject::GetElementAttributeWithReceiver().

Referenced by v8::internal::GetOldValue(), v8::internal::GetOwnProperty(), and v8::internal::JSObject::SetElement().

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

◆ GetOwnPropertyAttributes()

Maybe< PropertyAttributes > v8::internal::JSReceiver::GetOwnPropertyAttributes ( Handle< JSReceiver object,
Handle< Name name 
)
static

Definition at line 3983 of file objects.cc.

3984  {
3985  // Check whether the name is an array index.
3986  uint32_t index = 0;
3987  if (object->IsJSObject() && name->AsArrayIndex(&index)) {
3988  return GetOwnElementAttribute(object, index);
3989  }
3990  LookupIterator it(object, name, LookupIterator::HIDDEN);
3991  return GetPropertyAttributes(&it);
3992 }
static MUST_USE_RESULT Maybe< PropertyAttributes > GetPropertyAttributes(Handle< JSReceiver > object, Handle< Name > name)
Definition: objects-inl.h:6670
static MUST_USE_RESULT Maybe< PropertyAttributes > GetOwnElementAttribute(Handle< JSReceiver > object, uint32_t index)
Definition: objects-inl.h:6743
friend class LookupIterator
Definition: objects.h:1226

References v8::internal::Object::LookupIterator, and name.

Referenced by HasOwnProperty(), v8::internal::Context::Lookup(), v8::internal::RUNTIME_FUNCTION(), and v8::internal::JSObjectWalkVisitor< ContextObject >::StructureWalk().

+ Here is the caller graph for this function:

◆ GetPropertyAttributes() [1/2]

Maybe< PropertyAttributes > v8::internal::JSReceiver::GetPropertyAttributes ( Handle< JSReceiver object,
Handle< Name name 
)
inlinestatic

Definition at line 6670 of file objects-inl.h.

6671  {
6672  uint32_t index;
6673  if (object->IsJSObject() && key->AsArrayIndex(&index)) {
6674  return GetElementAttribute(object, index);
6675  }
6676  LookupIterator it(object, key);
6677  return GetPropertyAttributes(&it);
6678 }
static MUST_USE_RESULT Maybe< PropertyAttributes > GetElementAttribute(Handle< JSReceiver > object, uint32_t index)
Definition: objects-inl.h:6681

References GetElementAttribute(), and v8::internal::Object::LookupIterator.

Referenced by v8::internal::DeclareGlobals(), v8::internal::GetOwnProperty(), v8::Object::GetPropertyAttributes(), HasProperty(), v8::internal::Context::Lookup(), v8::internal::RUNTIME_FUNCTION(), and v8::internal::UnscopableLookup().

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

◆ GetPropertyAttributes() [2/2]

Maybe< PropertyAttributes > v8::internal::JSReceiver::GetPropertyAttributes ( LookupIterator it)
static

Definition at line 3995 of file objects.cc.

3996  {
3997  for (; it->IsFound(); it->Next()) {
3998  switch (it->state()) {
3999  case LookupIterator::NOT_FOUND:
4000  case LookupIterator::TRANSITION:
4001  UNREACHABLE();
4002  case LookupIterator::JSPROXY:
4004  it->GetHolder<JSProxy>(), it->GetReceiver(), it->name());
4005  case LookupIterator::INTERCEPTOR: {
4006  Maybe<PropertyAttributes> result =
4008  it->GetHolder<JSObject>(), it->GetReceiver(), it->name());
4009  if (!result.has_value) return result;
4010  if (result.value != ABSENT) return result;
4011  break;
4012  }
4013  case LookupIterator::ACCESS_CHECK:
4014  if (it->HasAccess(v8::ACCESS_HAS)) break;
4017  case LookupIterator::DATA:
4018  return maybe(it->property_details().attributes());
4019  }
4020  }
4021  return maybe(ABSENT);
4022 }
static MUST_USE_RESULT Maybe< PropertyAttributes > GetPropertyAttributesWithInterceptor(Handle< JSObject > holder, Handle< Object > receiver, Handle< Name > name)
Definition: objects.cc:3940
static MUST_USE_RESULT Maybe< PropertyAttributes > GetPropertyAttributesWithFailedAccessCheck(LookupIterator *it)
Definition: objects.cc:601
static MUST_USE_RESULT Maybe< PropertyAttributes > GetPropertyAttributesWithHandler(Handle< JSProxy > proxy, Handle< Object > receiver, Handle< Name > name)
Definition: objects.cc:3572
#define UNREACHABLE()
Definition: logging.h:30
Maybe< T > maybe(T t)
Definition: v8.h:902
@ ACCESS_HAS
Definition: v8.h:3522
@ ABSENT

References ABSENT, v8::ACCESS_HAS, v8::internal::ACCESSOR, v8::internal::JSObject::GetPropertyAttributesWithFailedAccessCheck(), v8::internal::JSProxy::GetPropertyAttributesWithHandler(), v8::internal::JSObject::GetPropertyAttributesWithInterceptor(), v8::Maybe< T >::has_value, v8::maybe(), UNREACHABLE, and v8::Maybe< T >::value.

+ Here is the call graph for this function:

◆ HasElement()

Maybe< bool > v8::internal::JSReceiver::HasElement ( Handle< JSReceiver object,
uint32_t  index 
)
inlinestatic

Definition at line 6718 of file objects-inl.h.

6718  {
6719  if (object->IsJSProxy()) {
6720  Handle<JSProxy> proxy = Handle<JSProxy>::cast(object);
6721  return JSProxy::HasElementWithHandler(proxy, index);
6722  }
6723  Maybe<PropertyAttributes> result = JSObject::GetElementAttributeWithReceiver(
6724  Handle<JSObject>::cast(object), object, index, true);
6725  if (!result.has_value) return Maybe<bool>();
6726  return maybe(result.value != ABSENT);
6727 }
static MUST_USE_RESULT Maybe< bool > HasElementWithHandler(Handle< JSProxy > proxy, uint32_t index)
Definition: objects-inl.h:1165

References ABSENT, v8::internal::Handle< T >::cast(), v8::internal::JSObject::GetElementAttributeWithReceiver(), v8::Maybe< T >::has_value, v8::internal::JSProxy::HasElementWithHandler(), v8::maybe(), and v8::Maybe< T >::value.

Referenced by v8::Object::Has(), v8::internal::Runtime::HasObjectProperty(), v8::internal::IterateElements(), and v8::internal::RUNTIME_FUNCTION().

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

◆ HasOwnElement()

Maybe< bool > v8::internal::JSReceiver::HasOwnElement ( Handle< JSReceiver object,
uint32_t  index 
)
inlinestatic

Definition at line 6730 of file objects-inl.h.

6731  {
6732  if (object->IsJSProxy()) {
6733  Handle<JSProxy> proxy = Handle<JSProxy>::cast(object);
6734  return JSProxy::HasElementWithHandler(proxy, index);
6735  }
6736  Maybe<PropertyAttributes> result = JSObject::GetElementAttributeWithReceiver(
6737  Handle<JSObject>::cast(object), object, index, false);
6738  if (!result.has_value) return Maybe<bool>();
6739  return maybe(result.value != ABSENT);
6740 }

References ABSENT, v8::internal::Handle< T >::cast(), v8::internal::JSObject::GetElementAttributeWithReceiver(), v8::Maybe< T >::has_value, v8::internal::JSProxy::HasElementWithHandler(), v8::maybe(), and v8::Maybe< T >::value.

Referenced by v8::internal::RUNTIME_FUNCTION().

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

◆ HasOwnProperty()

Maybe< bool > v8::internal::JSReceiver::HasOwnProperty ( Handle< JSReceiver object,
Handle< Name name 
)
inlinestatic

Definition at line 6658 of file objects-inl.h.

6659  {
6660  if (object->IsJSProxy()) {
6661  Handle<JSProxy> proxy = Handle<JSProxy>::cast(object);
6662  return JSProxy::HasPropertyWithHandler(proxy, name);
6663  }
6664  Maybe<PropertyAttributes> result = GetOwnPropertyAttributes(object, name);
6665  if (!result.has_value) return Maybe<bool>();
6666  return maybe(result.value != ABSENT);
6667 }
static MUST_USE_RESULT Maybe< bool > HasPropertyWithHandler(Handle< JSProxy > proxy, Handle< Name > name)
Definition: objects.cc:3392
static MUST_USE_RESULT Maybe< PropertyAttributes > GetOwnPropertyAttributes(Handle< JSReceiver > object, Handle< Name > name)
Definition: objects.cc:3983

References ABSENT, v8::internal::Handle< T >::cast(), GetOwnPropertyAttributes(), v8::Maybe< T >::has_value, v8::internal::JSProxy::HasPropertyWithHandler(), v8::maybe(), name, and v8::Maybe< T >::value.

Referenced by v8::Object::HasOwnProperty(), v8::internal::HasOwnPropertyImplementation(), v8::internal::MaterializeArgumentsObject(), v8::internal::anonymous_namespace{i18n.cc}::SetResolvedNumberSettings(), v8::internal::BreakIterator::UnpackBreakIterator(), v8::internal::Collator::UnpackCollator(), v8::internal::DateFormat::UnpackDateFormat(), and v8::internal::NumberFormat::UnpackNumberFormat().

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

◆ HasProperty()

Maybe< bool > v8::internal::JSReceiver::HasProperty ( Handle< JSReceiver object,
Handle< Name name 
)
inlinestatic

Definition at line 6646 of file objects-inl.h.

6647  {
6648  if (object->IsJSProxy()) {
6649  Handle<JSProxy> proxy = Handle<JSProxy>::cast(object);
6650  return JSProxy::HasPropertyWithHandler(proxy, name);
6651  }
6652  Maybe<PropertyAttributes> result = GetPropertyAttributes(object, name);
6653  if (!result.has_value) return Maybe<bool>();
6654  return maybe(result.value != ABSENT);
6655 }

References ABSENT, v8::internal::Handle< T >::cast(), GetPropertyAttributes(), v8::Maybe< T >::has_value, v8::internal::JSProxy::HasPropertyWithHandler(), v8::maybe(), name, and v8::Maybe< T >::value.

Referenced by v8::internal::Runtime::HasObjectProperty(), v8::internal::LoadLookupSlotHelper(), v8::internal::RUNTIME_FUNCTION(), v8::internal::SetClosureVariableValue(), v8::internal::SetLocalVariableValue(), v8::TryCatch::StackTrace(), and v8::internal::UnscopableLookup().

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

◆ IsSimpleEnum()

bool v8::internal::JSReceiver::IsSimpleEnum ( )

Definition at line 5610 of file objects.cc.

5610  {
5611  for (PrototypeIterator iter(GetIsolate(), this,
5613  !iter.IsAtEnd(); iter.Advance()) {
5614  if (!iter.GetCurrent()->IsJSObject()) return false;
5615  JSObject* curr = JSObject::cast(iter.GetCurrent());
5616  int enum_length = curr->map()->EnumLength();
5617  if (enum_length == kInvalidEnumCacheSentinel) return false;
5618  if (curr->IsAccessCheckNeeded()) return false;
5619  DCHECK(!curr->HasNamedInterceptor());
5620  DCHECK(!curr->HasIndexedInterceptor());
5621  if (curr->NumberOfEnumElements() > 0) return false;
5622  if (curr != this && enum_length != 0) return false;
5623  }
5624  return true;
5625 }
Isolate * GetIsolate() const
Definition: objects-inl.h:1387
static const int kInvalidEnumCacheSentinel

References DCHECK, v8::internal::Map::EnumLength(), v8::internal::HeapObject::GetIsolate(), v8::internal::JSObject::HasIndexedInterceptor(), v8::internal::JSObject::HasNamedInterceptor(), v8::internal::PrototypeIterator::IsAtEnd(), v8::internal::kInvalidEnumCacheSentinel, v8::internal::HeapObject::map(), v8::internal::JSObject::NumberOfEnumElements(), and v8::internal::PrototypeIterator::START_AT_RECEIVER.

+ Here is the call graph for this function:

◆ SetElement()

MaybeHandle< Object > v8::internal::JSReceiver::SetElement ( Handle< JSReceiver object,
uint32_t  index,
Handle< Object value,
PropertyAttributes  attributes,
StrictMode  strict_mode 
)
static

Definition at line 12313 of file objects.cc.

12317  {
12318  if (object->IsJSProxy()) {
12320  Handle<JSProxy>::cast(object), object, index, value, strict_mode);
12321  }
12322  return JSObject::SetElement(
12323  Handle<JSObject>::cast(object), index, value, attributes, strict_mode);
12324 }
static MUST_USE_RESULT MaybeHandle< Object > SetElement(Handle< JSObject > object, uint32_t index, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode, bool check_prototype=true, SetPropertyMode set_mode=SET_PROPERTY)
Definition: objects.cc:12336
static MUST_USE_RESULT MaybeHandle< Object > SetElementWithHandler(Handle< JSProxy > proxy, Handle< JSReceiver > receiver, uint32_t index, Handle< Object > value, StrictMode strict_mode)
Definition: objects-inl.h:1154

References v8::internal::JSObject::SetElement(), and v8::internal::JSProxy::SetElementWithHandler().

+ Here is the call graph for this function:

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