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()); |