V8 Project
v8::internal::TypeFeedbackInfo Class Reference

#include <objects.h>

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

Classes

class  ICsWithTypeInfoCountField
 
class  ICTotalCountField
 
class  InlinedTypeChangeChecksum
 
class  OwnTypeChangeChecksum
 

Public Member Functions

int ic_total_count ()
 
void set_ic_total_count (int count)
 
int ic_with_type_info_count ()
 
void change_ic_with_type_info_count (int delta)
 
int ic_generic_count ()
 
void change_ic_generic_count (int delta)
 
void initialize_storage ()
 
void change_own_type_change_checksum ()
 
int own_type_change_checksum ()
 
void set_inlined_type_change_checksum (int checksum)
 
bool matches_inlined_type_change_checksum (int checksum)
 
- 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 Attributes

static const int kStorage1Offset = HeapObject::kHeaderSize
 
static const int kStorage2Offset = kStorage1Offset + kPointerSize
 
static const int kStorage3Offset = kStorage2Offset + kPointerSize
 
static const int kSize = kStorage3Offset + 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 (TypeFeedbackInfo)
 

Static Private Attributes

static const int kTypeChangeChecksumBits = 7
 

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

Member Function Documentation

◆ change_ic_generic_count()

void v8::internal::TypeFeedbackInfo::change_ic_generic_count ( int  delta)
inline

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

7044  {
7045  if (delta == 0) return;
7046  int new_count = ic_generic_count() + delta;
7047  if (new_count >= 0) {
7048  new_count &= ~Smi::kMinValue;
7049  WRITE_FIELD(this, kStorage3Offset, Smi::FromInt(new_count));
7050  }
7051 }
static Smi * FromInt(int value)
Definition: objects-inl.h:1321
static const int kStorage3Offset
Definition: objects.h:8062
#define WRITE_FIELD(p, offset, value)
Definition: objects-inl.h:1190

References v8::internal::Smi::FromInt(), ic_generic_count(), kStorage3Offset, and WRITE_FIELD.

Referenced by v8::internal::IC::OnTypeFeedbackChanged().

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

◆ change_ic_with_type_info_count()

void v8::internal::TypeFeedbackInfo::change_ic_with_type_info_count ( int  delta)
inline

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

7022  {
7023  if (delta == 0) return;
7024  int value = Smi::cast(READ_FIELD(this, kStorage2Offset))->value();
7025  int new_count = ICsWithTypeInfoCountField::decode(value) + delta;
7026  // We can get negative count here when the type-feedback info is
7027  // shared between two code objects. The can only happen when
7028  // the debugger made a shallow copy of code object (see Heap::CopyCode).
7029  // Since we do not optimize when the debugger is active, we can skip
7030  // this counter update.
7031  if (new_count >= 0) {
7032  new_count &= ICsWithTypeInfoCountField::kMask;
7033  value = ICsWithTypeInfoCountField::update(value, new_count);
7034  WRITE_FIELD(this, kStorage2Offset, Smi::FromInt(value));
7035  }
7036 }
static U update(U previous, T value)
Definition: utils.h:223
static const U kMask
Definition: utils.h:203
static T decode(U value)
Definition: utils.h:228
static const int kStorage2Offset
Definition: objects.h:8061
#define READ_FIELD(p, offset)
Definition: objects-inl.h:1179

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), v8::internal::Smi::FromInt(), v8::internal::BitFieldBase< T, shift, size, U >::kMask, kStorage2Offset, READ_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_FIELD.

Referenced by v8::internal::IC::OnTypeFeedbackChanged().

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

◆ change_own_type_change_checksum()

void v8::internal::TypeFeedbackInfo::change_own_type_change_checksum ( )
inline

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

7061  {
7062  int value = Smi::cast(READ_FIELD(this, kStorage1Offset))->value();
7063  int checksum = OwnTypeChangeChecksum::decode(value);
7064  checksum = (checksum + 1) % (1 << kTypeChangeChecksumBits);
7065  value = OwnTypeChangeChecksum::update(value, checksum);
7066  // Ensure packed bit field is in Smi range.
7067  if (value > Smi::kMaxValue) value |= Smi::kMinValue;
7068  if (value < Smi::kMinValue) value &= ~Smi::kMinValue;
7069  WRITE_FIELD(this, kStorage1Offset, Smi::FromInt(value));
7070 }
static const int kMaxValue
Definition: objects.h:1272
static const int kMinValue
Definition: objects.h:1270
static const int kStorage1Offset
Definition: objects.h:8060
static const int kTypeChangeChecksumBits
Definition: objects.h:8066

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), v8::internal::Smi::FromInt(), v8::internal::Smi::kMaxValue, v8::internal::Smi::kMinValue, kStorage1Offset, kTypeChangeChecksumBits, READ_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_FIELD.

Referenced by v8::internal::IC::OnTypeFeedbackChanged().

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

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::TypeFeedbackInfo::DISALLOW_IMPLICIT_CONSTRUCTORS ( TypeFeedbackInfo  )
private

◆ ic_generic_count()

int v8::internal::TypeFeedbackInfo::ic_generic_count ( )
inline

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

7039  {
7040  return Smi::cast(READ_FIELD(this, kStorage3Offset))->value();
7041 }

References kStorage3Offset, and READ_FIELD.

Referenced by change_ic_generic_count(), and v8::internal::GetICCounts().

+ Here is the caller graph for this function:

◆ ic_total_count()

int v8::internal::TypeFeedbackInfo::ic_total_count ( )
inline

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

7002  {
7003  int current = Smi::cast(READ_FIELD(this, kStorage1Offset))->value();
7004  return ICTotalCountField::decode(current);
7005 }

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

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

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

◆ ic_with_type_info_count()

int v8::internal::TypeFeedbackInfo::ic_with_type_info_count ( )
inline

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

7016  {
7017  int current = Smi::cast(READ_FIELD(this, kStorage2Offset))->value();
7018  return ICsWithTypeInfoCountField::decode(current);
7019 }

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

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

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

◆ initialize_storage()

void v8::internal::TypeFeedbackInfo::initialize_storage ( )
inline

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

7054  {
7058 }

References v8::internal::Smi::FromInt(), kStorage1Offset, kStorage2Offset, kStorage3Offset, and WRITE_FIELD.

+ Here is the call graph for this function:

◆ matches_inlined_type_change_checksum()

bool v8::internal::TypeFeedbackInfo::matches_inlined_type_change_checksum ( int  checksum)
inline

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

7090  {
7091  int value = Smi::cast(READ_FIELD(this, kStorage2Offset))->value();
7092  int mask = (1 << kTypeChangeChecksumBits) - 1;
7093  return InlinedTypeChangeChecksum::decode(value) == (checksum & mask);
7094 }

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

+ Here is the call graph for this function:

◆ own_type_change_checksum()

int v8::internal::TypeFeedbackInfo::own_type_change_checksum ( )
inline

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

7084  {
7085  int value = Smi::cast(READ_FIELD(this, kStorage1Offset))->value();
7086  return OwnTypeChangeChecksum::decode(value);
7087 }

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

+ Here is the call graph for this function:

◆ set_ic_total_count()

void v8::internal::TypeFeedbackInfo::set_ic_total_count ( int  count)
inline

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

7008  {
7009  int value = Smi::cast(READ_FIELD(this, kStorage1Offset))->value();
7010  value = ICTotalCountField::update(value,
7011  ICTotalCountField::decode(count));
7012  WRITE_FIELD(this, kStorage1Offset, Smi::FromInt(value));
7013 }

References v8::internal::BitFieldBase< T, shift, size, U >::decode(), v8::internal::Smi::FromInt(), kStorage1Offset, READ_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_FIELD.

+ Here is the call graph for this function:

◆ set_inlined_type_change_checksum()

void v8::internal::TypeFeedbackInfo::set_inlined_type_change_checksum ( int  checksum)
inline

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

7073  {
7074  int value = Smi::cast(READ_FIELD(this, kStorage2Offset))->value();
7075  int mask = (1 << kTypeChangeChecksumBits) - 1;
7076  value = InlinedTypeChangeChecksum::update(value, checksum & mask);
7077  // Ensure packed bit field is in Smi range.
7078  if (value > Smi::kMaxValue) value |= Smi::kMinValue;
7079  if (value < Smi::kMinValue) value &= ~Smi::kMinValue;
7080  WRITE_FIELD(this, kStorage2Offset, Smi::FromInt(value));
7081 }

References v8::internal::Smi::FromInt(), v8::internal::Smi::kMaxValue, v8::internal::Smi::kMinValue, kStorage2Offset, kTypeChangeChecksumBits, READ_FIELD, v8::internal::BitFieldBase< T, shift, size, U >::update(), and WRITE_FIELD.

+ Here is the call graph for this function:

Member Data Documentation

◆ kSize

const int v8::internal::TypeFeedbackInfo::kSize = kStorage3Offset + kPointerSize
static

Definition at line 8063 of file objects.h.

◆ kStorage1Offset

const int v8::internal::TypeFeedbackInfo::kStorage1Offset = HeapObject::kHeaderSize
static

◆ kStorage2Offset

◆ kStorage3Offset

const int v8::internal::TypeFeedbackInfo::kStorage3Offset = kStorage2Offset + kPointerSize
static

Definition at line 8062 of file objects.h.

Referenced by change_ic_generic_count(), ic_generic_count(), and initialize_storage().

◆ kTypeChangeChecksumBits

const int v8::internal::TypeFeedbackInfo::kTypeChangeChecksumBits = 7
staticprivate

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