Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: src/heap/heap.cc

Issue 885553005: Collect phantom callback data only once during gc. For scavenges, just consider the young handles r… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@weak-allocation-sites
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/global-handles.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 UpdateNewSpaceReferencesInExternalStringTable( 1592 UpdateNewSpaceReferencesInExternalStringTable(
1593 &UpdateNewSpaceReferenceInExternalStringTableEntry); 1593 &UpdateNewSpaceReferenceInExternalStringTableEntry);
1594 1594
1595 promotion_queue_.Destroy(); 1595 promotion_queue_.Destroy();
1596 1596
1597 incremental_marking()->UpdateMarkingDequeAfterScavenge(); 1597 incremental_marking()->UpdateMarkingDequeAfterScavenge();
1598 1598
1599 ScavengeWeakObjectRetainer weak_object_retainer(this); 1599 ScavengeWeakObjectRetainer weak_object_retainer(this);
1600 ProcessYoungWeakReferences(&weak_object_retainer); 1600 ProcessYoungWeakReferences(&weak_object_retainer);
1601 1601
1602 // Collects callback info for handles referenced by young generation that are
1603 // pending (about to be collected) and either phantom or internal-fields.
1604 // Releases the global handles. See also PostGarbageCollectionProcessing.
1605 isolate()->global_handles()->CollectYoungPhantomCallbackData();
1606
1602 DCHECK(new_space_front == new_space_.top()); 1607 DCHECK(new_space_front == new_space_.top());
1603 1608
1604 // Set age mark. 1609 // Set age mark.
1605 new_space_.set_age_mark(new_space_.top()); 1610 new_space_.set_age_mark(new_space_.top());
1606 1611
1607 new_space_.LowerInlineAllocationLimit( 1612 new_space_.LowerInlineAllocationLimit(
1608 new_space_.inline_allocation_limit_step()); 1613 new_space_.inline_allocation_limit_step());
1609 1614
1610 // Update how much has survived scavenge. 1615 // Update how much has survived scavenge.
1611 IncrementYoungSurvivorsCounter(static_cast<int>( 1616 IncrementYoungSurvivorsCounter(static_cast<int>(
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 } 1686 }
1682 1687
1683 UpdateNewSpaceReferencesInExternalStringTable(updater_func); 1688 UpdateNewSpaceReferencesInExternalStringTable(updater_func);
1684 } 1689 }
1685 1690
1686 1691
1687 void Heap::ProcessAllWeakReferences(WeakObjectRetainer* retainer) { 1692 void Heap::ProcessAllWeakReferences(WeakObjectRetainer* retainer) {
1688 ProcessArrayBuffers(retainer); 1693 ProcessArrayBuffers(retainer);
1689 ProcessNativeContexts(retainer); 1694 ProcessNativeContexts(retainer);
1690 ProcessAllocationSites(retainer); 1695 ProcessAllocationSites(retainer);
1691 // Collects callback info for handles that are pending (about to be
1692 // collected) and either phantom or internal-fields. Releases the global
1693 // handles. See also PostGarbageCollectionProcessing.
1694 isolate()->global_handles()->CollectPhantomCallbackData();
1695 } 1696 }
1696 1697
1697 1698
1698 void Heap::ProcessYoungWeakReferences(WeakObjectRetainer* retainer) { 1699 void Heap::ProcessYoungWeakReferences(WeakObjectRetainer* retainer) {
1699 ProcessArrayBuffers(retainer); 1700 ProcessArrayBuffers(retainer);
1700 ProcessNativeContexts(retainer); 1701 ProcessNativeContexts(retainer);
1701 // Collects callback info for handles that are pending (about to be
1702 // collected) and either phantom or internal-fields. Releases the global
1703 // handles. See also PostGarbageCollectionProcessing.
1704 isolate()->global_handles()->CollectPhantomCallbackData();
1705 } 1702 }
1706 1703
1707 1704
1708 void Heap::ProcessNativeContexts(WeakObjectRetainer* retainer) { 1705 void Heap::ProcessNativeContexts(WeakObjectRetainer* retainer) {
1709 Object* head = VisitWeakList<Context>(this, native_contexts_list(), retainer); 1706 Object* head = VisitWeakList<Context>(this, native_contexts_list(), retainer);
1710 // Update the head of the list of contexts. 1707 // Update the head of the list of contexts.
1711 set_native_contexts_list(head); 1708 set_native_contexts_list(head);
1712 } 1709 }
1713 1710
1714 1711
(...skipping 4738 matching lines...) Expand 10 before | Expand all | Expand 10 after
6453 static_cast<int>(object_sizes_last_time_[index])); 6450 static_cast<int>(object_sizes_last_time_[index]));
6454 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6451 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6455 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6452 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6456 6453
6457 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6454 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6458 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6455 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6459 ClearObjectStats(); 6456 ClearObjectStats();
6460 } 6457 }
6461 } 6458 }
6462 } // namespace v8::internal 6459 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/global-handles.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698