V8 Project
v8::internal::AccessorPair Class Reference

#include <objects.h>

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

Public Member Functions

Objectget (AccessorComponent component)
 
void set (AccessorComponent component, Object *value)
 
ObjectGetComponent (AccessorComponent component)
 
void SetComponents (Object *getter, Object *setter)
 
bool ContainsAccessor ()
 
- 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 Handle< AccessorPairCopy (Handle< AccessorPair > pair)
 
- 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 kGetterOffset = HeapObject::kHeaderSize
 
static const int kSetterOffset = kGetterOffset + kPointerSize
 
static const int kSize = kSetterOffset + 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 IsJSAccessor (Object *obj)
 
 DISALLOW_IMPLICIT_CONSTRUCTORS (AccessorPair)
 

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

Member Function Documentation

◆ ContainsAccessor()

bool v8::internal::AccessorPair::ContainsAccessor ( )
inline

Definition at line 10332 of file objects.h.

10332  {
10333  return IsJSAccessor(getter()) || IsJSAccessor(setter());
10334  }
bool IsJSAccessor(Object *obj)
Definition: objects.h:10350

◆ Copy()

Handle< AccessorPair > v8::internal::AccessorPair::Copy ( Handle< AccessorPair pair)
static

Definition at line 7904 of file objects.cc.

7904  {
7905  Handle<AccessorPair> copy = pair->GetIsolate()->factory()->NewAccessorPair();
7906  copy->set_getter(pair->getter());
7907  copy->set_setter(pair->setter());
7908  return copy;
7909 }

Referenced by v8::internal::Map::TransitionToAccessorProperty().

+ Here is the caller graph for this function:

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::AccessorPair::DISALLOW_IMPLICIT_CONSTRUCTORS ( AccessorPair  )
private

◆ get()

Object* v8::internal::AccessorPair::get ( AccessorComponent  component)
inline

Definition at line 10311 of file objects.h.

10311  {
10312  return component == ACCESSOR_GETTER ? getter() : setter();
10313  }
@ ACCESSOR_GETTER
Definition: objects.h:1558

References v8::internal::ACCESSOR_GETTER.

◆ GetComponent()

Object * v8::internal::AccessorPair::GetComponent ( AccessorComponent  component)

Definition at line 7912 of file objects.cc.

7912  {
7913  Object* accessor = get(component);
7914  return accessor->IsTheHole() ? GetHeap()->undefined_value() : accessor;
7915 }
Object * get(AccessorComponent component)
Definition: objects.h:10311
Heap * GetHeap() const
Definition: objects-inl.h:1379
kSerializedDataOffset Object
Definition: objects-inl.h:5322

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

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

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

◆ IsJSAccessor()

bool v8::internal::AccessorPair::IsJSAccessor ( Object obj)
inlineprivate

Definition at line 10350 of file objects.h.

10350  {
10351  return obj->IsSpecFunction() || obj->IsUndefined();
10352  }

◆ set()

void v8::internal::AccessorPair::set ( AccessorComponent  component,
Object value 
)
inline

Definition at line 10315 of file objects.h.

10315  {
10316  if (component == ACCESSOR_GETTER) {
10317  set_getter(value);
10318  } else {
10319  set_setter(value);
10320  }
10321  }

References v8::internal::ACCESSOR_GETTER, and v8::internal::Smi::value().

+ Here is the call graph for this function:

◆ SetComponents()

void v8::internal::AccessorPair::SetComponents ( Object getter,
Object setter 
)
inline

Definition at line 10327 of file objects.h.

10327  {
10328  if (!getter->IsNull()) set_getter(getter);
10329  if (!setter->IsNull()) set_setter(setter);
10330  }

Member Data Documentation

◆ kGetterOffset

const int v8::internal::AccessorPair::kGetterOffset = HeapObject::kHeaderSize
static

◆ kSetterOffset

const int v8::internal::AccessorPair::kSetterOffset = kGetterOffset + kPointerSize
static

◆ kSize

const int v8::internal::AccessorPair::kSize = kSetterOffset + kPointerSize
static

Definition at line 10342 of file objects.h.


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