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; |
} |