Commit 4db396b1 authored by ulan's avatar ulan Committed by Commit bot

Avoid redundant weak pointer updates after evacuation.

Since we record slots for weak list fields, there is no need to iterate over
them after evacuation. We just need to update the roots for which we didn't
record slots.

This speeds up the evacuate_update_pointers_weak phase by ~2.5x.

BUG=

Review URL: https://codereview.chromium.org/1772803002

Cr-Commit-Position: refs/heads/master@{#34555}
parent 7dc13c2a
......@@ -1852,6 +1852,10 @@ void Heap::ProcessAllocationSites(WeakObjectRetainer* retainer) {
set_allocation_sites_list(allocation_site_obj);
}
void Heap::ProcessWeakListRoots(WeakObjectRetainer* retainer) {
set_native_contexts_list(retainer->RetainAs(native_contexts_list()));
set_allocation_sites_list(retainer->RetainAs(allocation_sites_list()));
}
void Heap::ResetAllAllocationSitesDependentCode(PretenureFlag flag) {
DisallowHeapAllocation no_allocation_scope;
......
......@@ -1675,6 +1675,7 @@ class Heap {
void ProcessYoungWeakReferences(WeakObjectRetainer* retainer);
void ProcessNativeContexts(WeakObjectRetainer* retainer);
void ProcessAllocationSites(WeakObjectRetainer* retainer);
void ProcessWeakListRoots(WeakObjectRetainer* retainer);
// ===========================================================================
// GC statistics. ============================================================
......
......@@ -3695,7 +3695,7 @@ void MarkCompactCollector::UpdatePointersAfterEvacuation() {
&UpdateReferenceInExternalStringTableEntry);
EvacuationWeakObjectRetainer evacuation_object_retainer;
heap()->ProcessAllWeakReferences(&evacuation_object_retainer);
heap()->ProcessWeakListRoots(&evacuation_object_retainer);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment