V8 Project
v8::internal::CompilationCacheTable Class Reference

#include <objects.h>

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

Public Member Functions

Handle< ObjectLookup (Handle< String > src, Handle< Context > context)
 
Handle< ObjectLookupEval (Handle< String > src, Handle< Context > context, StrictMode strict_mode, int scope_position)
 
Handle< ObjectLookupRegExp (Handle< String > source, JSRegExp::Flags flags)
 
void Remove (Object *value)
 
- Public Member Functions inherited from v8::internal::HashTable< CompilationCacheTable, CompilationCacheShape, HashTableKey * >
uint32_t Hash (HashTableKey * key)
 
uint32_t HashForObject (HashTableKey * key, Object *object)
 
int NumberOfElements ()
 
int NumberOfDeletedElements ()
 
int Capacity ()
 
void ElementAdded ()
 
void ElementRemoved ()
 
void ElementsRemoved (int n)
 
ObjectKeyAt (int entry)
 
bool IsKey (Object *k)
 
void IteratePrefix (ObjectVisitor *visitor)
 
void IterateElements (ObjectVisitor *visitor)
 
 INLINE (static uint32_t GetProbeOffset(uint32_t n))
 
int FindEntry (HashTableKey * key)
 
int FindEntry (Isolate *isolate, HashTableKey * key)
 
void Rehash (HashTableKey * key)
 
- Public Member Functions inherited from v8::internal::FixedArray
Objectget (int index)
 
void set (int index, Object *value)
 
bool is_the_hole (int index)
 
void set (int index, Smi *value)
 
void set (int index, Object *value, WriteBarrierMode mode)
 
void set_undefined (int index)
 
void set_null (int index)
 
void set_the_hole (int index)
 
Object ** GetFirstElementAddress ()
 
bool ContainsOnlySmisOrHoles ()
 
Object ** data_start ()
 
void FillWithHoles (int from, int to)
 
void Shrink (int length)
 
void CopyTo (int pos, FixedArray *dest, int dest_pos, int len)
 
Object ** RawFieldOfElementAt (int index)
 
void SwapPairs (FixedArray *numbers, int i, int j)
 
void SortPairs (FixedArray *numbers, uint32_t len)
 
- Public Member Functions inherited from v8::internal::FixedArrayBase
int length () const
 
void set_length (int value)
 
int synchronized_length () const
 
void synchronized_set_length (int value)
 
- 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< CompilationCacheTablePut (Handle< CompilationCacheTable > cache, Handle< String > src, Handle< Context > context, Handle< Object > value)
 
static Handle< CompilationCacheTablePutEval (Handle< CompilationCacheTable > cache, Handle< String > src, Handle< Context > context, Handle< SharedFunctionInfo > value, int scope_position)
 
static Handle< CompilationCacheTablePutRegExp (Handle< CompilationCacheTable > cache, Handle< String > src, JSRegExp::Flags flags, Handle< FixedArray > value)
 
- Static Public Member Functions inherited from v8::internal::HashTable< CompilationCacheTable, CompilationCacheShape, HashTableKey * >
static MUST_USE_RESULT Handle< CompilationCacheTableNew (Isolate *isolate, int at_least_space_for, MinimumCapacity capacity_option=USE_DEFAULT_MINIMUM_CAPACITY, PretenureFlag pretenure=NOT_TENURED)
 
static int ComputeCapacity (int at_least_space_for)
 
- Static Public Member Functions inherited from v8::internal::FixedArray
static Handle< Objectget (Handle< FixedArray > array, int index)
 
static Handle< FixedArrayCopySize (Handle< FixedArray > array, int new_length, PretenureFlag pretenure=NOT_TENURED)
 
static MUST_USE_RESULT MaybeHandle< FixedArrayAddKeysFromArrayLike (Handle< FixedArray > content, Handle< JSObject > array)
 
static MUST_USE_RESULT MaybeHandle< FixedArrayUnionOfKeys (Handle< FixedArray > first, Handle< FixedArray > second)
 
static int SizeFor (int length)
 
static int OffsetOfElementAt (int index)
 
- 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)
 

Private Member Functions

 DISALLOW_IMPLICIT_CONSTRUCTORS (CompilationCacheTable)
 

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 Attributes inherited from v8::internal::HashTable< CompilationCacheTable, CompilationCacheShape, HashTableKey * >
static const int kNumberOfElementsIndex
 
static const int kNumberOfDeletedElementsIndex
 
static const int kCapacityIndex
 
static const int kPrefixStartIndex
 
static const int kElementsStartIndex
 
static const int kEntrySize
 
static const int kElementsStartOffset
 
static const int kCapacityOffset
 
static const int kNotFound
 
static const int kMaxCapacity
 
- Static Public Attributes inherited from v8::internal::FixedArray
static const int kMaxSize = 128 * MB * kPointerSize
 
static const int kMaxLength = (kMaxSize - kHeaderSize) / kPointerSize
 
- Static Public Attributes inherited from v8::internal::FixedArrayBase
static const int kLengthOffset = HeapObject::kHeaderSize
 
static const int kHeaderSize = kLengthOffset + 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
 
- Protected Member Functions inherited from v8::internal::HashTable< CompilationCacheTable, CompilationCacheShape, HashTableKey * >
uint32_t FindInsertionEntry (uint32_t hash)
 
void SetNumberOfElements (int nof)
 
void SetNumberOfDeletedElements (int nod)
 
void SetCapacity (int capacity)
 
- 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)
 
- Static Protected Member Functions inherited from v8::internal::HashTable< CompilationCacheTable, CompilationCacheShape, HashTableKey * >
static int EntryToIndex (int entry)
 
static uint32_t GetProbe (uint32_t hash, uint32_t number, uint32_t size)
 
static uint32_t FirstProbe (uint32_t hash, uint32_t size)
 
static uint32_t NextProbe (uint32_t last, uint32_t number, uint32_t size)
 
static MUST_USE_RESULT Handle< CompilationCacheTableShrink (Handle< CompilationCacheTable > table, HashTableKey * key)
 
static MUST_USE_RESULT Handle< CompilationCacheTableEnsureCapacity (Handle< CompilationCacheTable > table, int n, HashTableKey * key, PretenureFlag pretenure=NOT_TENURED)
 
- Static Protected Member Functions inherited from v8::internal::FixedArray
static void NoWriteBarrierSet (FixedArray *array, int index, Object *value)
 
static void NoIncrementalWriteBarrierSet (FixedArray *array, int index, Object *value)
 

Detailed Description

Definition at line 7863 of file objects.h.

Member Function Documentation

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::CompilationCacheTable::DISALLOW_IMPLICIT_CONSTRUCTORS ( CompilationCacheTable  )
private

◆ Lookup()

Handle< Object > v8::internal::CompilationCacheTable::Lookup ( Handle< String src,
Handle< Context context 
)

Definition at line 14741 of file objects.cc.

14742  {
14743  Isolate* isolate = GetIsolate();
14744  Handle<SharedFunctionInfo> shared(context->closure()->shared());
14745  StringSharedKey key(src, shared, FLAG_use_strict ? STRICT : SLOPPY,
14747  int entry = FindEntry(&key);
14748  if (entry == kNotFound) return isolate->factory()->undefined_value();
14749  return Handle<Object>(get(EntryToIndex(entry) + 1), isolate);
14750 }
Object * get(int index)
Definition: objects-inl.h:2165
Isolate * GetIsolate() const
Definition: objects-inl.h:1387
static const int kNoPosition
Definition: assembler.h:317

References v8::internal::Isolate::factory(), v8::internal::FixedArray::get(), v8::internal::HeapObject::GetIsolate(), v8::internal::RelocInfo::kNoPosition, v8::internal::SLOPPY, and v8::internal::STRICT.

+ Here is the call graph for this function:

◆ LookupEval()

Handle< Object > v8::internal::CompilationCacheTable::LookupEval ( Handle< String src,
Handle< Context context,
StrictMode  strict_mode,
int  scope_position 
)

Definition at line 14753 of file objects.cc.

14756  {
14757  Isolate* isolate = GetIsolate();
14758  Handle<SharedFunctionInfo> shared(context->closure()->shared());
14759  StringSharedKey key(src, shared, strict_mode, scope_position);
14760  int entry = FindEntry(&key);
14761  if (entry == kNotFound) return isolate->factory()->undefined_value();
14762  return Handle<Object>(get(EntryToIndex(entry) + 1), isolate);
14763 }

References v8::internal::Isolate::factory(), v8::internal::FixedArray::get(), and v8::internal::HeapObject::GetIsolate().

+ Here is the call graph for this function:

◆ LookupRegExp()

Handle< Object > v8::internal::CompilationCacheTable::LookupRegExp ( Handle< String source,
JSRegExp::Flags  flags 
)

Definition at line 14766 of file objects.cc.

14767  {
14768  Isolate* isolate = GetIsolate();
14769  DisallowHeapAllocation no_allocation;
14770  RegExpKey key(src, flags);
14771  int entry = FindEntry(&key);
14772  if (entry == kNotFound) return isolate->factory()->undefined_value();
14773  return Handle<Object>(get(EntryToIndex(entry) + 1), isolate);
14774 }
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110

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

+ Here is the call graph for this function:

◆ Put()

Handle< CompilationCacheTable > v8::internal::CompilationCacheTable::Put ( Handle< CompilationCacheTable cache,
Handle< String src,
Handle< Context context,
Handle< Object value 
)
static

Definition at line 14777 of file objects.cc.

14779  {
14780  Isolate* isolate = cache->GetIsolate();
14781  Handle<SharedFunctionInfo> shared(context->closure()->shared());
14782  StringSharedKey key(src, shared, FLAG_use_strict ? STRICT : SLOPPY,
14784  cache = EnsureCapacity(cache, 1, &key);
14785  Handle<Object> k = key.AsHandle(isolate);
14786  int entry = cache->FindInsertionEntry(key.Hash());
14787  cache->set(EntryToIndex(entry), *k);
14788  cache->set(EntryToIndex(entry) + 1, *value);
14789  cache->ElementAdded();
14790  return cache;
14791 }
static MUST_USE_RESULT Handle< CompilationCacheTable > EnsureCapacity(Handle< CompilationCacheTable > table, int n, HashTableKey * key, PretenureFlag pretenure=NOT_TENURED)
Definition: objects.cc:13928

References v8::internal::StringSharedKey::AsHandle(), v8::internal::StringSharedKey::Hash(), v8::internal::RelocInfo::kNoPosition, v8::internal::SLOPPY, and v8::internal::STRICT.

Referenced by v8::internal::CompilationCacheScript::Put().

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

◆ PutEval()

Handle< CompilationCacheTable > v8::internal::CompilationCacheTable::PutEval ( Handle< CompilationCacheTable cache,
Handle< String src,
Handle< Context context,
Handle< SharedFunctionInfo value,
int  scope_position 
)
static

Definition at line 14794 of file objects.cc.

14797  {
14798  Isolate* isolate = cache->GetIsolate();
14799  Handle<SharedFunctionInfo> shared(context->closure()->shared());
14800  StringSharedKey key(src, shared, value->strict_mode(), scope_position);
14801  cache = EnsureCapacity(cache, 1, &key);
14802  Handle<Object> k = key.AsHandle(isolate);
14803  int entry = cache->FindInsertionEntry(key.Hash());
14804  cache->set(EntryToIndex(entry), *k);
14805  cache->set(EntryToIndex(entry) + 1, *value);
14806  cache->ElementAdded();
14807  return cache;
14808 }

References v8::internal::StringSharedKey::AsHandle(), and v8::internal::StringSharedKey::Hash().

Referenced by v8::internal::CompilationCacheEval::Put().

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

◆ PutRegExp()

Handle< CompilationCacheTable > v8::internal::CompilationCacheTable::PutRegExp ( Handle< CompilationCacheTable cache,
Handle< String src,
JSRegExp::Flags  flags,
Handle< FixedArray value 
)
static

Definition at line 14811 of file objects.cc.

14813  {
14814  RegExpKey key(src, flags);
14815  cache = EnsureCapacity(cache, 1, &key);
14816  int entry = cache->FindInsertionEntry(key.Hash());
14817  // We store the value in the key slot, and compare the search key
14818  // to the stored value with a custon IsMatch function during lookups.
14819  cache->set(EntryToIndex(entry), *value);
14820  cache->set(EntryToIndex(entry) + 1, *value);
14821  cache->ElementAdded();
14822  return cache;
14823 }

References v8::internal::anonymous_namespace{flags.cc}::flags, and v8::internal::RegExpKey::Hash().

Referenced by v8::internal::CompilationCacheRegExp::Put().

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

◆ Remove()

void v8::internal::CompilationCacheTable::Remove ( Object value)

Definition at line 14826 of file objects.cc.

14826  {
14827  DisallowHeapAllocation no_allocation;
14828  Object* the_hole_value = GetHeap()->the_hole_value();
14829  for (int entry = 0, size = Capacity(); entry < size; entry++) {
14830  int entry_index = EntryToIndex(entry);
14831  int value_index = entry_index + 1;
14832  if (get(value_index) == value) {
14833  NoWriteBarrierSet(this, entry_index, the_hole_value);
14834  NoWriteBarrierSet(this, value_index, the_hole_value);
14835  ElementRemoved();
14836  }
14837  }
14838  return;
14839 }
static void NoWriteBarrierSet(FixedArray *array, int index, Object *value)
Definition: objects-inl.h:2694
Heap * GetHeap() const
Definition: objects-inl.h:1379
enable harmony numeric enable harmony object literal extensions Optimize object size
kSerializedDataOffset Object
Definition: objects-inl.h:5322

References v8::internal::FixedArray::get(), v8::internal::HeapObject::GetHeap(), v8::internal::FixedArray::NoWriteBarrierSet(), and size.

+ Here is the call graph for this function:

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