V8 Project
v8::internal::AccessorInfo Class Reference

#include <objects.h>

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

Classes

class  AttributesField
 

Public Member Functions

bool all_can_read ()
 
void set_all_can_read (bool value)
 
bool all_can_write ()
 
void set_all_can_write (bool value)
 
PropertyAttributes property_attributes ()
 
void set_property_attributes (PropertyAttributes attributes)
 
bool IsCompatibleReceiver (Object *receiver)
 
- Public Member Functions inherited from v8::internal::Struct
void InitializeBody (int object_size)
 
- 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 bool IsCompatibleReceiverType (Isolate *isolate, Handle< AccessorInfo > info, Handle< HeapType > type)
 
static int AppendUnique (Handle< Object > descriptors, Handle< FixedArray > array, int valid_descriptors)
 
- 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)
 

Static Public Attributes

static const int kNameOffset = HeapObject::kHeaderSize
 
static const int kFlagOffset = kNameOffset + kPointerSize
 
static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize
 
static const int kSize = kExpectedReceiverTypeOffset + kPointerSize
 
- 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
 

Private Member Functions

bool HasExpectedReceiverType ()
 
 DISALLOW_IMPLICIT_CONSTRUCTORS (AccessorInfo)
 

Static Private Attributes

static const int kAllCanReadBit = 0
 
static const int kAllCanWriteBit = 1
 

Additional Inherited Members

- 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 }
 
- 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 10104 of file objects.h.

Member Function Documentation

◆ all_can_read()

bool v8::internal::AccessorInfo::all_can_read ( )
inline

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

6754  {
6755  return BooleanBit::get(flag(), kAllCanReadBit);
6756 }
static const int kAllCanReadBit
Definition: objects.h:10146
static bool get(Smi *smi, int bit_position)
Definition: objects.h:10791
kFeedbackVectorOffset flag
Definition: objects-inl.h:5418

References v8::internal::flag, v8::internal::BooleanBit::get(), and kAllCanReadBit.

+ Here is the call graph for this function:

◆ all_can_write()

bool v8::internal::AccessorInfo::all_can_write ( )
inline

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

6764  {
6766 }
static const int kAllCanWriteBit
Definition: objects.h:10147

References v8::internal::flag, v8::internal::BooleanBit::get(), and kAllCanWriteBit.

+ Here is the call graph for this function:

◆ AppendUnique()

int v8::internal::AccessorInfo::AppendUnique ( Handle< Object descriptors,
Handle< FixedArray array,
int  valid_descriptors 
)
static

Definition at line 3185 of file objects.cc.

3187  {
3188  NeanderArray callbacks(descriptors);
3189  DCHECK(array->length() >= callbacks.length() + valid_descriptors);
3190  return AppendUniqueCallbacks<FixedArrayAppender>(&callbacks,
3191  array,
3192  valid_descriptors);
3193 }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, and v8::NeanderArray::length().

+ Here is the call graph for this function:

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::AccessorInfo::DISALLOW_IMPLICIT_CONSTRUCTORS ( AccessorInfo  )
private

◆ HasExpectedReceiverType()

bool v8::internal::AccessorInfo::HasExpectedReceiverType ( )
inlineprivate

Definition at line 10142 of file objects.h.

10142  {
10143  return expected_receiver_type()->IsFunctionTemplateInfo();
10144  }

Referenced by IsCompatibleReceiver().

+ Here is the caller graph for this function:

◆ IsCompatibleReceiver()

bool v8::internal::AccessorInfo::IsCompatibleReceiver ( Object receiver)
inline

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

6784  {
6785  if (!HasExpectedReceiverType()) return true;
6786  if (!receiver->IsJSObject()) return false;
6787  return FunctionTemplateInfo::cast(expected_receiver_type())
6788  ->IsTemplateFor(JSObject::cast(receiver)->map());
6789 }

References HasExpectedReceiverType(), and v8::internal::HeapObject::map().

Referenced by v8::internal::Object::SetPropertyWithAccessor().

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

◆ IsCompatibleReceiverType()

bool v8::internal::AccessorInfo::IsCompatibleReceiverType ( Isolate isolate,
Handle< AccessorInfo info,
Handle< HeapType type 
)
static

Definition at line 467 of file objects.cc.

469  {
470  if (!info->HasExpectedReceiverType()) return true;
471  Handle<Map> map = IC::TypeToMap(*type, isolate);
472  if (!map->IsJSObjectMap()) return false;
473  return FunctionTemplateInfo::cast(info->expected_receiver_type())
474  ->IsTemplateFor(*map);
475 }
static Handle< Map > TypeToMap(HeapType *type, Isolate *isolate)
Definition: ic.cc:719
bool IsJSObjectMap()
Definition: objects.h:6125

References v8::internal::Map::IsJSObjectMap(), v8::internal::HeapObject::map(), and v8::internal::IC::TypeToMap().

Referenced by v8::internal::LoadIC::CompileHandler(), v8::internal::StoreIC::CompileHandler(), and v8::internal::NamedLoadHandlerCompiler::CompileLoadInterceptor().

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

◆ property_attributes()

PropertyAttributes v8::internal::AccessorInfo::property_attributes ( )
inline

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

6774  {
6775  return AttributesField::decode(static_cast<uint32_t>(flag()->value()));
6776 }
static T decode(U value)
Definition: utils.h:228

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), and v8::internal::flag.

+ Here is the call graph for this function:

◆ set_all_can_read()

void v8::internal::AccessorInfo::set_all_can_read ( bool  value)
inline

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

6759  {
6760  set_flag(BooleanBit::set(flag(), kAllCanReadBit, value));
6761 }
static Smi * set(Smi *smi, int bit_position, bool v)
Definition: objects.h:10799

References v8::internal::flag, kAllCanReadBit, and v8::internal::BooleanBit::set().

+ Here is the call graph for this function:

◆ set_all_can_write()

void v8::internal::AccessorInfo::set_all_can_write ( bool  value)
inline

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

6769  {
6770  set_flag(BooleanBit::set(flag(), kAllCanWriteBit, value));
6771 }

References v8::internal::flag, kAllCanWriteBit, and v8::internal::BooleanBit::set().

+ Here is the call graph for this function:

◆ set_property_attributes()

void v8::internal::AccessorInfo::set_property_attributes ( PropertyAttributes  attributes)
inline

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

6779  {
6780  set_flag(Smi::FromInt(AttributesField::update(flag()->value(), attributes)));
6781 }
static U update(U previous, T value)
Definition: utils.h:223
static Smi * FromInt(int value)
Definition: objects-inl.h:1321

References v8::internal::flag, v8::internal::Smi::FromInt(), and v8::internal::BitFieldBase< T, shift, size, U >::update().

+ Here is the call graph for this function:

Member Data Documentation

◆ kAllCanReadBit

const int v8::internal::AccessorInfo::kAllCanReadBit = 0
staticprivate

Definition at line 10146 of file objects.h.

Referenced by all_can_read(), and set_all_can_read().

◆ kAllCanWriteBit

const int v8::internal::AccessorInfo::kAllCanWriteBit = 1
staticprivate

Definition at line 10147 of file objects.h.

Referenced by all_can_write(), and set_all_can_write().

◆ kExpectedReceiverTypeOffset

const int v8::internal::AccessorInfo::kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize
static

◆ kFlagOffset

const int v8::internal::AccessorInfo::kFlagOffset = kNameOffset + kPointerSize
static

Definition at line 10137 of file objects.h.

◆ kNameOffset

const int v8::internal::AccessorInfo::kNameOffset = HeapObject::kHeaderSize
static

◆ kSize

const int v8::internal::AccessorInfo::kSize = kExpectedReceiverTypeOffset + kPointerSize
static

Definition at line 10139 of file objects.h.


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