V8 Project
v8::internal::PropertyCell Class Reference

#include <objects.h>

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

Public Types

typedef FixedBodyDescriptor< kValueOffset, kSize, kSizeBodyDescriptor
 
- Public Types inherited from v8::internal::Cell
typedef FixedBodyDescriptor< kValueOffset, kValueOffset+kPointerSize, kSizeBodyDescriptor
 
- 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

HeapTypetype ()
 
void set_type (HeapType *value, WriteBarrierMode mode=UPDATE_WRITE_BARRIER)
 
Address TypeAddress ()
 
- Public Member Functions inherited from v8::internal::Cell
Address ValueAddress ()
 
- 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 void SetValueInferType (Handle< PropertyCell > cell, Handle< Object > value)
 
static Handle< HeapTypeUpdatedType (Handle< PropertyCell > cell, Handle< Object > value)
 
static void AddDependentCompilationInfo (Handle< PropertyCell > cell, CompilationInfo *info)
 
- Static Public Member Functions inherited from v8::internal::Cell
static CellFromValueAddress (Address value)
 
- 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 kTypeOffset = kValueOffset + kPointerSize
 
static const int kDependentCodeOffset = kTypeOffset + kPointerSize
 
static const int kSize = kDependentCodeOffset + kPointerSize
 
static const int kPointerFieldsBeginOffset = kValueOffset
 
static const int kPointerFieldsEndOffset = kDependentCodeOffset
 
- Static Public Attributes inherited from v8::internal::Cell
static const int kValueOffset = HeapObject::kHeaderSize
 
static const int kSize = kValueOffset + 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

 DISALLOW_IMPLICIT_CONSTRUCTORS (PropertyCell)
 

Additional Inherited Members

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

Member Typedef Documentation

◆ BodyDescriptor

Member Function Documentation

◆ AddDependentCompilationInfo()

void v8::internal::PropertyCell::AddDependentCompilationInfo ( Handle< PropertyCell cell,
CompilationInfo info 
)
static

Definition at line 16378 of file objects.cc.

16379  {
16380  Handle<DependentCode> codes =
16381  DependentCode::Insert(handle(cell->dependent_code(), info->isolate()),
16383  info->object_wrapper());
16384  if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
16385  info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
16386  cell, info->zone());
16387 }
static Handle< DependentCode > Insert(Handle< DependentCode > entries, DependencyGroup group, Handle< Object > object)
Definition: objects.cc:11410
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References v8::internal::CompilationInfo::dependencies(), v8::internal::handle(), v8::internal::DependentCode::Insert(), v8::internal::CompilationInfo::isolate(), v8::internal::DependentCode::kPropertyCellChangedGroup, v8::internal::CompilationInfo::object_wrapper(), and v8::internal::CompilationInfo::zone().

+ Here is the call graph for this function:

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::PropertyCell::DISALLOW_IMPLICIT_CONSTRUCTORS ( PropertyCell  )
private

◆ set_type()

void v8::internal::PropertyCell::set_type ( HeapType value,
WriteBarrierMode  mode = UPDATE_WRITE_BARRIER 
)

Definition at line 16342 of file objects.cc.

16342  {
16343  DCHECK(IsPropertyCell());
16344  set_type_raw(type, ignored);
16345 }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, and type().

Referenced by v8::internal::Heap::AllocatePropertyCell().

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

◆ SetValueInferType()

void v8::internal::PropertyCell::SetValueInferType ( Handle< PropertyCell cell,
Handle< Object value 
)
static

Definition at line 16367 of file objects.cc.

16368  {
16369  cell->set_value(*value);
16370  if (!HeapType::Any()->Is(cell->type())) {
16371  Handle<HeapType> new_type = UpdatedType(cell, value);
16372  cell->set_type(*new_type);
16373  }
16374 }
static Handle< HeapType > UpdatedType(Handle< PropertyCell > cell, Handle< Object > value)
Definition: objects.cc:16348
bool Is(Object *obj)

References v8::internal::Is(), and UpdatedType().

Referenced by v8::internal::JSObject::DeleteNormalizedProperty(), and v8::internal::JSObject::SetNormalizedProperty().

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

◆ type()

HeapType * v8::internal::PropertyCell::type ( )

Definition at line 16337 of file objects.cc.

16337  {
16338  return static_cast<HeapType*>(type_raw());
16339 }
TypeImpl< HeapTypeConfig > HeapType
Definition: list.h:191

Referenced by v8::internal::V8HeapExplorer::ExtractPropertyCellReferences(), and set_type().

+ Here is the caller graph for this function:

◆ TypeAddress()

Address v8::internal::PropertyCell::TypeAddress ( )
inline

Definition at line 9485 of file objects.h.

9485  {
9486  return address() + kTypeOffset;
9487  }
static const int kTypeOffset
Definition: objects.h:9494

Referenced by v8::internal::Heap::Scavenge().

+ Here is the caller graph for this function:

◆ UpdatedType()

Handle< HeapType > v8::internal::PropertyCell::UpdatedType ( Handle< PropertyCell cell,
Handle< Object value 
)
static

Definition at line 16348 of file objects.cc.

16349  {
16350  Isolate* isolate = cell->GetIsolate();
16351  Handle<HeapType> old_type(cell->type(), isolate);
16352  Handle<HeapType> new_type = HeapType::Constant(value, isolate);
16353 
16354  if (new_type->Is(old_type)) return old_type;
16355 
16356  cell->dependent_code()->DeoptimizeDependentCodeGroup(
16358 
16359  if (old_type->Is(HeapType::None()) || old_type->Is(HeapType::Undefined())) {
16360  return new_type;
16361  }
16362 
16363  return HeapType::Any(isolate);
16364 }
static TypeHandle Constant(i::Handle< i::Object > value, Region *region)
Definition: types.h:330
@ None
Definition: v8.h:2211
Handle< Primitive > Undefined(Isolate *isolate)
Definition: v8.h:6836

References v8::internal::TypeImpl< Config >::Constant(), v8::internal::DependentCode::kPropertyCellChangedGroup, v8::None, and v8::Undefined().

Referenced by v8::internal::StoreIC::CompileHandler(), and SetValueInferType().

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

Member Data Documentation

◆ kDependentCodeOffset

const int v8::internal::PropertyCell::kDependentCodeOffset = kTypeOffset + kPointerSize
static

◆ kPointerFieldsBeginOffset

const int v8::internal::PropertyCell::kPointerFieldsBeginOffset = kValueOffset
static

Definition at line 9498 of file objects.h.

◆ kPointerFieldsEndOffset

const int v8::internal::PropertyCell::kPointerFieldsEndOffset = kDependentCodeOffset
static

Definition at line 9499 of file objects.h.

◆ kSize

◆ kTypeOffset

const int v8::internal::PropertyCell::kTypeOffset = kValueOffset + kPointerSize
static

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