Index: src/heap-inl.h |
diff --git a/src/heap-inl.h b/src/heap-inl.h |
index 525c634da626809c7c1bdfa3ce70b512e8eca621..0ba4a60fcaca1848174787d62e3ac368854b59b0 100644 |
--- a/src/heap-inl.h |
+++ b/src/heap-inl.h |
@@ -484,9 +484,10 @@ void Heap::ScavengePointer(HeapObject** p) { |
void Heap::UpdateAllocationSiteFeedback(HeapObject* object) { |
- if (FLAG_allocation_site_pretenuring && object->IsJSObject()) { |
- AllocationMemento* memento = AllocationMemento::FindForJSObject( |
- JSObject::cast(object), true); |
+ if (FLAG_allocation_site_pretenuring && |
+ AllocationSite::CanTrack(object->map()->instance_type())) { |
+ AllocationMemento* memento = AllocationMemento::FindForHeapObject( |
+ object, true); |
if (memento != NULL) { |
ASSERT(memento->IsValid()); |
memento->GetAllocationSite()->IncrementMementoFoundCount(); |