V8 Project
v8::internal::PolymorphicCodeCache Class Reference

#include <objects.h>

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

Public Member Functions

Handle< ObjectLookup (MapHandleList *maps, Code::Flags flags)
 
- 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 void Update (Handle< PolymorphicCodeCache > cache, MapHandleList *maps, Code::Flags flags, Handle< Code > code)
 
- 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 kCacheOffset = HeapObject::kHeaderSize
 
static const int kSize = kCacheOffset + 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 (PolymorphicCodeCache)
 

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

Member Function Documentation

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::PolymorphicCodeCache::DISALLOW_IMPLICIT_CONSTRUCTORS ( PolymorphicCodeCache  )
private

◆ Lookup()

Handle< Object > v8::internal::PolymorphicCodeCache::Lookup ( MapHandleList maps,
Code::Flags  flags 
)

Definition at line 7562 of file objects.cc.

7563  {
7564  if (!cache()->IsUndefined()) {
7565  PolymorphicCodeCacheHashTable* hash_table =
7566  PolymorphicCodeCacheHashTable::cast(cache());
7567  return Handle<Object>(hash_table->Lookup(maps, flags), GetIsolate());
7568  } else {
7569  return GetIsolate()->factory()->undefined_value();
7570  }
7571 }
Isolate * GetIsolate() const
Definition: objects-inl.h:1387
Factory * factory()
Definition: isolate.h:982

References v8::internal::Isolate::factory(), v8::internal::anonymous_namespace{flags.cc}::flags, v8::internal::HeapObject::GetIsolate(), and v8::internal::PolymorphicCodeCacheHashTable::Lookup().

+ Here is the call graph for this function:

◆ Update()

void v8::internal::PolymorphicCodeCache::Update ( Handle< PolymorphicCodeCache cache,
MapHandleList maps,
Code::Flags  flags,
Handle< Code code 
)
static

Definition at line 7538 of file objects.cc.

7541  {
7542  Isolate* isolate = code_cache->GetIsolate();
7543  if (code_cache->cache()->IsUndefined()) {
7544  Handle<PolymorphicCodeCacheHashTable> result =
7546  isolate,
7548  code_cache->set_cache(*result);
7549  } else {
7550  // This entry shouldn't be contained in the cache yet.
7551  DCHECK(PolymorphicCodeCacheHashTable::cast(code_cache->cache())
7552  ->Lookup(maps, flags)->IsUndefined());
7553  }
7554  Handle<PolymorphicCodeCacheHashTable> hash_table =
7555  handle(PolymorphicCodeCacheHashTable::cast(code_cache->cache()));
7556  Handle<PolymorphicCodeCacheHashTable> new_cache =
7557  PolymorphicCodeCacheHashTable::Put(hash_table, maps, flags, code);
7558  code_cache->set_cache(*new_cache);
7559 }
static MUST_USE_RESULT Handle< PolymorphicCodeCacheHashTable > New(Isolate *isolate, int at_least_space_for, MinimumCapacity capacity_option=USE_DEFAULT_MINIMUM_CAPACITY, PretenureFlag pretenure=NOT_TENURED)
Definition: objects.cc:13756
static Handle< PolymorphicCodeCacheHashTable > Put(Handle< PolymorphicCodeCacheHashTable > hash_table, MapHandleList *maps, int code_kind, Handle< Code > code)
Definition: objects.cc:7672
#define DCHECK(condition)
Definition: logging.h:205
Handle< T > handle(T *t, Isolate *isolate)
Definition: handles.h:146

References DCHECK, v8::internal::anonymous_namespace{flags.cc}::flags, v8::internal::handle(), v8::internal::PolymorphicCodeCacheHashTable::kInitialSize, v8::internal::HashTable< PolymorphicCodeCacheHashTable, CodeCacheHashTableShape, HashTableKey * >::New(), and v8::internal::PolymorphicCodeCacheHashTable::Put().

Referenced by v8::internal::PropertyICCompiler::ComputeKeyedLoadPolymorphic(), and v8::internal::PropertyICCompiler::ComputeKeyedStorePolymorphic().

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

Member Data Documentation

◆ kCacheOffset

const int v8::internal::PolymorphicCodeCache::kCacheOffset = HeapObject::kHeaderSize
static

Definition at line 8005 of file objects.h.

◆ kSize

const int v8::internal::PolymorphicCodeCache::kSize = kCacheOffset + kPointerSize
static

Definition at line 8006 of file objects.h.

Referenced by v8::internal::IncrementalMarking::Hurry().


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