Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Unified Diff: src/bootstrapper.cc

Issue 1780001: Clean JS function results cache on each major GC. (Closed)
Patch Set: Reoworking the test Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index d0e5e6b84dc5dbcf23e5647b808c7fee6d8e0737..657d0dc3dac7acc3ec7084b22c66aafd583569ba 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1335,14 +1335,12 @@ bool Genesis::InstallNatives() {
static FixedArray* CreateCache(int size, JSFunction* factory) {
// Caches are supposed to live for a long time, allocate in old space.
int array_size = JSFunctionResultCache::kEntriesIndex + 2 * size;
- Handle<FixedArray> cache =
- Factory::NewFixedArrayWithHoles(array_size, TENURED);
+ // Cannot use cast as object is not fully initialized yet.
+ JSFunctionResultCache* cache = reinterpret_cast<JSFunctionResultCache*>(
+ *Factory::NewFixedArrayWithHoles(array_size, TENURED));
cache->set(JSFunctionResultCache::kFactoryIndex, factory);
- cache->set(JSFunctionResultCache::kFingerIndex,
- Smi::FromInt(JSFunctionResultCache::kEntriesIndex));
- cache->set(JSFunctionResultCache::kCacheSizeIndex,
- Smi::FromInt(JSFunctionResultCache::kEntriesIndex));
- return *cache;
+ cache->MakeZeroSize();
+ return cache;
}
« no previous file with comments | « no previous file | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698