Chromium Code Reviews| Index: src/heap.cc |
| diff --git a/src/heap.cc b/src/heap.cc |
| index c17794f99b394456583b5bf9d9241777f1bc0d63..66fbbeb1f1dbd6596f6f691d619e835b11b466b3 100644 |
| --- a/src/heap.cc |
| +++ b/src/heap.cc |
| @@ -545,7 +545,9 @@ void Heap::ProcessPretenuringFeedback() { |
| } |
| } |
| - if (trigger_deoptimization) isolate_->stack_guard()->DeoptMarkedCode(); |
| + if (trigger_deoptimization) { |
| + isolate_->stack_guard()->DeoptMarkedAllocationSites(); |
| + } |
| FlushAllocationSitesScratchpad(); |
| @@ -567,6 +569,25 @@ void Heap::ProcessPretenuringFeedback() { |
| } |
| +void Heap::DeoptMarkedAllocationSites() { |
| + // TODO(hpayer): If iterating over the alloation sites list becomes a |
|
mvstanton
2014/02/17 12:10:06
"allocation"
Hannes Payer (out of office)
2014/02/17 12:14:43
Done.
|
| + // performance issue, use a cache heap data structure instead (similar to the |
| + // allocation sites scratchpad). |
| + Object* list_element = allocation_sites_list(); |
| + while (list_element->IsAllocationSite()) { |
| + AllocationSite* site = AllocationSite::cast(list_element); |
| + if (site->deopt_dependent_code()) { |
| + site->dependent_code()->MarkCodeForDeoptimization( |
| + isolate_, |
| + DependentCode::kAllocationSiteTenuringChangedGroup); |
| + site->set_deopt_dependent_code(false); |
| + } |
| + list_element = site->weak_next(); |
| + } |
| + Deoptimizer::DeoptimizeMarkedCode(isolate_); |
| +} |
| + |
| + |
| void Heap::GarbageCollectionEpilogue() { |
| store_buffer()->GCEpilogue(); |
| @@ -2000,14 +2021,12 @@ void Heap::ResetAllAllocationSitesDependentCode(PretenureFlag flag) { |
| 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; |
| + casted->set_deopt_dependent_code(true); |
| + marked = true; |
| } |
| cur = casted->weak_next(); |
| } |
| - if (marked) isolate_->stack_guard()->DeoptMarkedCode(); |
| + if (marked) isolate_->stack_guard()->DeoptMarkedAllocationSites(); |
| } |