Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 899d701a856d28024ab5a95fd419f0be435e58d1..5bebe1a225cbe58a021fd6ca66fd3fe9b5e4663c 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -1983,14 +1983,22 @@ void Heap::ProcessAllocationSites(WeakObjectRetainer* retainer, |
void Heap::ResetAllAllocationSitesDependentCode(PretenureFlag flag) { |
+ ASSERT(AllowCodeDependencyChange::IsAllowed()); |
+ DisallowHeapAllocation no_allocation_scope; |
Object* cur = allocation_sites_list(); |
+ bool marked = false; |
while (cur->IsAllocationSite()) { |
AllocationSite* casted = AllocationSite::cast(cur); |
if (casted->GetPretenureMode() == flag) { |
casted->ResetPretenureDecision(); |
+ bool got_marked = casted->dependent_code()->MarkCodeForDeoptimization( |
+ isolate_, |
+ DependentCode::kAllocationSiteTenuringChangedGroup); |
+ if (got_marked) marked = true; |
} |
cur = casted->weak_next(); |
} |
+ if (marked) Deoptimizer::DeoptimizeMarkedCode(isolate_); |
} |