diff --git a/src/objects.cc b/src/objects.cc index 63b7312c51..2b5b567112 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -15014,16 +15014,19 @@ Handle CompilationCacheTable::Put( Handle shared(context->closure()->shared()); StringSharedKey key(src, shared, FLAG_use_strict ? STRICT : SLOPPY, RelocInfo::kNoPosition); - int entry = cache->FindEntry(&key); - if (entry != kNotFound) { + { Handle k = key.AsHandle(isolate); - cache->set(EntryToIndex(entry), *k); - cache->set(EntryToIndex(entry) + 1, *value); - return cache; + DisallowHeapAllocation no_allocation_scope; + int entry = cache->FindEntry(&key); + if (entry != kNotFound) { + cache->set(EntryToIndex(entry), *k); + cache->set(EntryToIndex(entry) + 1, *value); + return cache; + } } cache = EnsureCapacity(cache, 1, &key); - entry = cache->FindInsertionEntry(key.Hash()); + int entry = cache->FindInsertionEntry(key.Hash()); Handle k = isolate->factory()->NewNumber(static_cast(key.Hash())); cache->set(EntryToIndex(entry), *k); @@ -15039,16 +15042,19 @@ Handle CompilationCacheTable::PutEval( int scope_position) { Isolate* isolate = cache->GetIsolate(); StringSharedKey key(src, outer_info, value->strict_mode(), scope_position); - int entry = cache->FindEntry(&key); - if (entry != kNotFound) { + { Handle k = key.AsHandle(isolate); - cache->set(EntryToIndex(entry), *k); - cache->set(EntryToIndex(entry) + 1, *value); - return cache; + DisallowHeapAllocation no_allocation_scope; + int entry = cache->FindEntry(&key); + if (entry != kNotFound) { + cache->set(EntryToIndex(entry), *k); + cache->set(EntryToIndex(entry) + 1, *value); + return cache; + } } cache = EnsureCapacity(cache, 1, &key); - entry = cache->FindInsertionEntry(key.Hash()); + int entry = cache->FindInsertionEntry(key.Hash()); Handle k = isolate->factory()->NewNumber(static_cast(key.Hash())); cache->set(EntryToIndex(entry), *k);