Index: src/heap-inl.h |
diff --git a/src/heap-inl.h b/src/heap-inl.h |
index 3229aeecc3096fa74bc9f022616eb277b4e79d58..1ddaeaf16fd930f802582b9b062dbd3451993576 100644 |
--- a/src/heap-inl.h |
+++ b/src/heap-inl.h |
@@ -489,7 +489,15 @@ void Heap::UpdateAllocationSiteFeedback(HeapObject* object) { |
JSObject::cast(object), true); |
if (memento != NULL) { |
ASSERT(memento->IsValid()); |
- memento->GetAllocationSite()->IncrementMementoFoundCount(); |
+ bool add_to_scratchpad = |
+ memento->GetAllocationSite()->IncrementMementoFoundCount(); |
+ Heap* heap = object->GetIsolate()->heap(); |
+ if (add_to_scratchpad && heap->allocation_sites_scratchpad_length < |
+ kAllocationSiteScratchpadSize) { |
+ heap->allocation_sites_scratchpad[ |
+ heap->allocation_sites_scratchpad_length++] = |
+ memento->GetAllocationSite(); |
+ } |
} |
} |
} |