Index: src/mark-compact.cc |
diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
index b82149e3a408c8c00908f5472ca6e774e1be117a..6d03d43652e81a3afd101785800eeb2358e63fde 100644 |
--- a/src/mark-compact.cc |
+++ b/src/mark-compact.cc |
@@ -2541,6 +2541,17 @@ void MarkCompactCollector::ClearNonLiveReferences() { |
} |
} |
+ // Iterate over allocation sites, removing dependent code that is not |
+ // otherwise kept alive by strong references. |
+ Object* undefined = heap()->undefined_value(); |
+ for (Object* site = heap()->allocation_sites_list(); |
+ site != undefined; |
+ site = AllocationSite::cast(site)->weak_next()) { |
+ if (IsMarked(site)) { |
+ ClearNonLiveDependentCode(AllocationSite::cast(site)->dependent_code()); |
+ } |
+ } |
+ |
if (heap_->weak_object_to_code_table()->IsHashTable()) { |
WeakHashTable* table = |
WeakHashTable::cast(heap_->weak_object_to_code_table()); |