Lines Matching defs:cache
4790 // If the source descriptors had an enum cache we copy it. This ensures
4792 // on a cache always being available once it is set. If the map has more
4793 // enumerated descriptors than available in the original cache, the cache
4794 // will be lazily replaced by the extended cache when needed.
8608 Handle<NormalizedMapCache> cache;
8609 if (use_cache) cache = Handle<NormalizedMapCache>::cast(maybe_cache);
8612 if (use_cache && cache->Get(fast_map, mode).ToHandle(&new_map)) {
8619 // except for the code cache, which can contain some ics which can be
8620 // applied to the shared map, dependent code and weak cell cache.
8650 cache->Set(fast_map, new_map);
9537 // Helper class to manage a Map's code cache. The layout depends on the number
9552 // Returns the new cache, to be stored on the map.
9553 static Handle<FixedArray> Put(Isolate* isolate, Handle<FixedArray> cache,
9555 int length = cache->length();
9558 return PutSecondElement(isolate, cache, name, code);
9561 Handle<FixedArray> result = PutLinearElement(isolate, cache, name, code);
9565 return PutHashTableElement(isolate, cache, name, code);
9568 static Code* Lookup(FixedArray* cache, Name* name, Code::Flags flags) {
9569 int length = cache->length();
9571 if (length == kEntrySize) return OneElementLookup(cache, name, flags);
9572 if (!cache->IsCodeCacheHashTable()) {
9573 return LinearLookup(cache, name, flags);
9575 return CodeCacheHashTable::cast(cache)->Lookup(name, flags);
9600 static Code* OneElementLookup(FixedArray* cache, Name* name,
9602 DCHECK_EQ(cache->length(), kEntrySize);
9603 if (cache->get(kNameIndex) != name) return nullptr;
9604 Code* maybe_code = Code::cast(cache->get(kCodeIndex));
9609 static Code* LinearLookup(FixedArray* cache, Name* name, Code::Flags flags) {
9610 DCHECK_GE(cache->length(), kEntrySize);
9611 DCHECK(!cache->IsCodeCacheHashTable());
9612 int usage = GetLinearUsage(cache);
9614 if (cache->get(i + kNameIndex) != name) continue;
9615 Code* code = Code::cast(cache->get(i + kCodeIndex));
9623 Handle<FixedArray> cache = isolate->factory()->NewFixedArray(kEntrySize);
9624 cache->set(kNameIndex, *name);
9625 cache->set(kCodeIndex, *code);
9626 return cache;
9630 Handle<FixedArray> cache,
9633 DCHECK_EQ(cache->length(), kEntrySize);
9636 new_cache->set(kLinearReservedSlots + kNameIndex, cache->get(kNameIndex));
9637 new_cache->set(kLinearReservedSlots + kCodeIndex, cache->get(kCodeIndex));
9645 Handle<FixedArray> cache,
9648 int length = cache->length();
9649 int usage = GetLinearUsage(*cache);
9658 new_cache->set(i, cache->get(i));
9660 cache = new_cache;
9663 DCHECK_GE(cache->length(), usage + kEntrySize);
9664 cache->set(usage + kNameIndex, *name);
9665 cache->set(usage + kCodeIndex, *code);
9666 cache->set(kLinearUsageIndex, Smi::FromInt(usage + kEntrySize));
9667 return cache;
9671 Handle<FixedArray> cache,
9675 if (!cache->IsCodeCacheHashTable()) {
9680 int length = cache->length();
9682 DCHECK_EQ(length, GetLinearUsage(*cache));
9688 Handle<Name> old_name(Name::cast(cache->get(i + kNameIndex)), isolate);
9689 Handle<Code> old_code(Code::cast(cache->get(i + kCodeIndex)), isolate);
9692 cache = table;
9695 DCHECK(cache->IsCodeCacheHashTable());
9696 return CodeCacheHashTable::Put(Handle<CodeCacheHashTable>::cast(cache),
9710 Handle<FixedArray> cache(map->code_cache(), isolate);
9711 Handle<FixedArray> new_cache = CodeCache::Put(isolate, cache, name, code);
9720 // The key in the code cache hash table consists of the property name and the
9776 Handle<CodeCacheHashTable> cache, Handle<Name> name, Handle<Code> code) {
9779 Handle<CodeCacheHashTable> new_cache = EnsureCapacity(cache, 1, &key);
9782 Handle<Object> k = key.AsHandle(cache->GetIsolate());
10897 UnicodeCache* cache = isolate->unicode_cache();
10901 if (cache->IsLineTerminatorSequence(current, next)) line_ends->Add(i);
10904 if (src_len > 0 && cache->IsLineTerminatorSequence(src[src_len - 1], 0)) {
12249 // If the function is used as the global Array function, cache the
12525 // Slow path, new.target is either a proxy or can't cache the map.
12919 // Return a handle for the existing script wrapper from the cache.
13570 // rewrite code handles in inline cache targets to direct
15787 // StringSharedKeys are used as keys in the eval cache.
15826 // We do this to ensure that the cache entries can survive garbage
17108 // Cache key is the tuple (source, outer shared function info, scope position)
17131 Handle<CompilationCacheTable> cache, Handle<String> src,
17133 Isolate* isolate = cache->GetIsolate();
17137 cache = EnsureCapacity(cache, 1, &key);
17138 int entry = cache->FindInsertionEntry(key.Hash());
17139 cache->set(EntryToIndex(entry), *k);
17140 cache->set(EntryToIndex(entry) + 1, *value);
17141 cache->ElementAdded();
17142 return cache;
17147 Handle<CompilationCacheTable> cache, Handle<String> src,
17150 Isolate* isolate = cache->GetIsolate();
17155 int entry = cache->FindEntry(&key);
17157 cache->set(EntryToIndex(entry), *k);
17158 cache->set(EntryToIndex(entry) + 1, *value);
17159 return cache;
17163 cache = EnsureCapacity(cache, 1, &key);
17164 int entry = cache->FindInsertionEntry(key.Hash());
17167 cache->set(EntryToIndex(entry), *k);
17168 cache->set(EntryToIndex(entry) + 1, Smi::FromInt(kHashGenerations));
17169 cache->ElementAdded();
17170 return cache;
17175 Handle<CompilationCacheTable> cache, Handle<String> src,
17178 cache = EnsureCapacity(cache, 1, &key);
17179 int entry = cache->FindInsertionEntry(key.Hash());
17182 cache->set(EntryToIndex(entry), *value);
17183 cache->set(EntryToIndex(entry) + 1, *value);
17184 cache->ElementAdded();
17185 return cache;