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

Unified Diff: src/heap-inl.h

Issue 40063002: Bookkeeping for allocation site pretenuring (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase built on site fields in another CL. Created 7 years, 1 month 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
Index: src/heap-inl.h
diff --git a/src/heap-inl.h b/src/heap-inl.h
index 168aa50b36e540b2467c9a2d63da90f0c3c7cbb2..8e42b53f1b0819ba596346995c96cd68fb75f9d6 100644
--- a/src/heap-inl.h
+++ b/src/heap-inl.h
@@ -483,6 +483,29 @@ void Heap::ScavengePointer(HeapObject** p) {
}
+void Heap::AddressMemento(HeapObject* object) {
+ if ((FLAG_allocation_site_pretenuring || FLAG_trace_track_allocation_sites)
+ && object->IsJSObject()) {
+ AllocationMemento* memento = AllocationMemento::FindForJSObject(
+ JSObject::cast(object), true);
+ if (memento != NULL) {
+ ASSERT(memento->IsValid());
+
+ if (FLAG_allocation_site_pretenuring) {
+ // Update state
Hannes Payer (out of office) 2013/11/21 20:52:24 Remove this comment.
mvstanton 2013/11/22 11:18:51 Done.
+ memento->GetAllocationSite()->IncrementMementoFoundCount();
+ }
+
+ // TODO(mvstanton): consider always updating this variable as long as
+ // we are tracking mementos for pretenuring purposes.
+ if (FLAG_trace_track_allocation_sites) {
+ object->GetIsolate()->heap()->allocation_mementos_found_++;
Hannes Payer (out of office) 2013/11/21 20:52:24 Do we still need this variable? We could just ask
mvstanton 2013/11/22 11:18:51 Done. Facilitated by moving the allocation site fe
+ }
+ }
+ }
+}
+
+
void Heap::ScavengeObject(HeapObject** p, HeapObject* object) {
ASSERT(object->GetIsolate()->heap()->InFromSpace(object));
@@ -501,12 +524,7 @@ void Heap::ScavengeObject(HeapObject** p, HeapObject* object) {
return;
}
- if (FLAG_trace_track_allocation_sites && object->IsJSObject()) {
- if (AllocationMemento::FindForJSObject(JSObject::cast(object), true) !=
- NULL) {
- object->GetIsolate()->heap()->allocation_mementos_found_++;
- }
- }
+ AddressMemento(object);
// AllocationMementos are unrooted and shouldn't survive a scavenge
ASSERT(object->map() != object->GetHeap()->allocation_memento_map());

Powered by Google App Engine
This is Rietveld 408576698