Chromium Code Reviews| Index: src/heap-inl.h |
| diff --git a/src/heap-inl.h b/src/heap-inl.h |
| index 3229aeecc3096fa74bc9f022616eb277b4e79d58..9dacefce63b14ca93259b2ef2ac6be26e75e5c3a 100644 |
| --- a/src/heap-inl.h |
| +++ b/src/heap-inl.h |
| @@ -489,7 +489,17 @@ 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 (heap->allocation_sites_scratchpad_pointer < |
| + kAllocationSiteScratchpadSize && |
| + add_to_scratchpad) { |
|
mvstanton
2013/12/13 10:30:17
put add_to_scratchpad first in the if expression.
Hannes Payer (out of office)
2013/12/18 14:29:19
Done.
|
| + heap->allocation_sites_scratchpad[ |
| + heap->allocation_sites_scratchpad_pointer] = |
|
mvstanton
2013/12/13 10:30:17
nit: I'd be into the more compact heap->allocation
Hannes Payer (out of office)
2013/12/18 14:29:19
Done.
|
| + memento->GetAllocationSite(); |
| + heap->allocation_sites_scratchpad_pointer++; |
| + } |
| } |
| } |
| } |