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

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

Issue 753553002: Phantom references support internal fields (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Delete allocated objects in test to make memory sanitizer happy Created 6 years 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
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 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after
1553 1553
1554 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); 1554 new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
1555 1555
1556 while (isolate()->global_handles()->IterateObjectGroups( 1556 while (isolate()->global_handles()->IterateObjectGroups(
1557 &scavenge_visitor, &IsUnscavengedHeapObject)) { 1557 &scavenge_visitor, &IsUnscavengedHeapObject)) {
1558 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); 1558 new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
1559 } 1559 }
1560 isolate()->global_handles()->RemoveObjectGroups(); 1560 isolate()->global_handles()->RemoveObjectGroups();
1561 isolate()->global_handles()->RemoveImplicitRefGroups(); 1561 isolate()->global_handles()->RemoveImplicitRefGroups();
1562 1562
1563 isolate_->global_handles()->IdentifyNewSpaceWeakIndependentHandles( 1563 isolate()->global_handles()->IdentifyNewSpaceWeakIndependentHandles(
1564 &IsUnscavengedHeapObject); 1564 &IsUnscavengedHeapObject);
1565 isolate_->global_handles()->IterateNewSpaceWeakIndependentRoots( 1565
1566 isolate()->global_handles()->IterateNewSpaceWeakIndependentRoots(
1566 &scavenge_visitor); 1567 &scavenge_visitor);
1567 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); 1568 new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
1568 1569
1569 UpdateNewSpaceReferencesInExternalStringTable( 1570 UpdateNewSpaceReferencesInExternalStringTable(
1570 &UpdateNewSpaceReferenceInExternalStringTableEntry); 1571 &UpdateNewSpaceReferenceInExternalStringTableEntry);
1571 1572
1572 promotion_queue_.Destroy(); 1573 promotion_queue_.Destroy();
1573 1574
1574 incremental_marking()->UpdateMarkingDequeAfterScavenge(); 1575 incremental_marking()->UpdateMarkingDequeAfterScavenge();
1575 1576
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1660 UpdateNewSpaceReferencesInExternalStringTable(updater_func); 1661 UpdateNewSpaceReferencesInExternalStringTable(updater_func);
1661 } 1662 }
1662 1663
1663 1664
1664 void Heap::ProcessWeakReferences(WeakObjectRetainer* retainer) { 1665 void Heap::ProcessWeakReferences(WeakObjectRetainer* retainer) {
1665 ProcessArrayBuffers(retainer); 1666 ProcessArrayBuffers(retainer);
1666 ProcessNativeContexts(retainer); 1667 ProcessNativeContexts(retainer);
1667 // TODO(mvstanton): AllocationSites only need to be processed during 1668 // TODO(mvstanton): AllocationSites only need to be processed during
1668 // MARK_COMPACT, as they live in old space. Verify and address. 1669 // MARK_COMPACT, as they live in old space. Verify and address.
1669 ProcessAllocationSites(retainer); 1670 ProcessAllocationSites(retainer);
1671 // Collects callback info for handles that are pending (about to be
1672 // collected) and either phantom or internal-fields. Releases the global
1673 // handles. See also PostGarbageCollectionProcessing.
1674 isolate()->global_handles()->CollectPhantomCallbackData();
1670 } 1675 }
1671 1676
1672 1677
1673 void Heap::ProcessNativeContexts(WeakObjectRetainer* retainer) { 1678 void Heap::ProcessNativeContexts(WeakObjectRetainer* retainer) {
1674 Object* head = VisitWeakList<Context>(this, native_contexts_list(), retainer); 1679 Object* head = VisitWeakList<Context>(this, native_contexts_list(), retainer);
1675 // Update the head of the list of contexts. 1680 // Update the head of the list of contexts.
1676 set_native_contexts_list(head); 1681 set_native_contexts_list(head);
1677 } 1682 }
1678 1683
1679 1684
(...skipping 4715 matching lines...) Expand 10 before | Expand all | Expand 10 after
6395 static_cast<int>(object_sizes_last_time_[index])); 6400 static_cast<int>(object_sizes_last_time_[index]));
6396 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6401 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6397 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6402 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6398 6403
6399 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6404 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6400 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6405 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6401 ClearObjectStats(); 6406 ClearObjectStats();
6402 } 6407 }
6403 } 6408 }
6404 } // namespace v8::internal 6409 } // namespace v8::internal
OLDNEW
« include/v8.h ('K') | « 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