Commit 350cbaab authored by hpayer's avatar hpayer Committed by Commit bot

Introduce ProcessYoungWeakReferences and process weak list of allocation sites...

Introduce ProcessYoungWeakReferences and process weak list of allocation sites just during full GCs.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#26330}
parent f5ca4145
......@@ -1597,7 +1597,7 @@ void Heap::Scavenge() {
incremental_marking()->UpdateMarkingDequeAfterScavenge();
ScavengeWeakObjectRetainer weak_object_retainer(this);
ProcessWeakReferences(&weak_object_retainer);
ProcessYoungWeakReferences(&weak_object_retainer);
DCHECK(new_space_front == new_space_.top());
......@@ -1684,11 +1684,9 @@ void Heap::UpdateReferencesInExternalStringTable(
}
void Heap::ProcessWeakReferences(WeakObjectRetainer* retainer) {
void Heap::ProcessAllWeakReferences(WeakObjectRetainer* retainer) {
ProcessArrayBuffers(retainer);
ProcessNativeContexts(retainer);
// TODO(mvstanton): AllocationSites only need to be processed during
// MARK_COMPACT, as they live in old space. Verify and address.
ProcessAllocationSites(retainer);
// Collects callback info for handles that are pending (about to be
// collected) and either phantom or internal-fields. Releases the global
......@@ -1697,6 +1695,16 @@ void Heap::ProcessWeakReferences(WeakObjectRetainer* retainer) {
}
void Heap::ProcessYoungWeakReferences(WeakObjectRetainer* retainer) {
ProcessArrayBuffers(retainer);
ProcessNativeContexts(retainer);
// Collects callback info for handles that are pending (about to be
// collected) and either phantom or internal-fields. Releases the global
// handles. See also PostGarbageCollectionProcessing.
isolate()->global_handles()->CollectPhantomCallbackData();
}
void Heap::ProcessNativeContexts(WeakObjectRetainer* retainer) {
Object* head = VisitWeakList<Context>(this, native_contexts_list(), retainer);
// Update the head of the list of contexts.
......
......@@ -1224,7 +1224,8 @@ class Heap {
void UpdateReferencesInExternalStringTable(
ExternalStringTableUpdaterCallback updater_func);
void ProcessWeakReferences(WeakObjectRetainer* retainer);
void ProcessAllWeakReferences(WeakObjectRetainer* retainer);
void ProcessYoungWeakReferences(WeakObjectRetainer* retainer);
void VisitExternalResources(v8::ExternalResourceVisitor* visitor);
......
......@@ -2276,7 +2276,7 @@ void MarkCompactCollector::AfterMarking() {
// Process the weak references.
MarkCompactWeakObjectRetainer mark_compact_object_retainer;
heap()->ProcessWeakReferences(&mark_compact_object_retainer);
heap()->ProcessAllWeakReferences(&mark_compact_object_retainer);
// Remove object groups after marking phase.
heap()->isolate()->global_handles()->RemoveObjectGroups();
......@@ -3546,7 +3546,7 @@ void MarkCompactCollector::EvacuateNewSpaceAndCandidates() {
&UpdateReferenceInExternalStringTableEntry);
EvacuationWeakObjectRetainer evacuation_object_retainer;
heap()->ProcessWeakReferences(&evacuation_object_retainer);
heap()->ProcessAllWeakReferences(&evacuation_object_retainer);
// Visit invalidated code (we ignored all slots on it) and clear mark-bits
// under it.
......
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