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

Unified Diff: src/heap-inl.h

Issue 99133017: Use an allocation site scratchpad to speed up allocaton site processing during gc. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 | « src/heap.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+ }
}
}
}
« no previous file with comments | « src/heap.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698