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

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

Issue 2486173002: [api] Remove marking persistents as partially dependent (Closed)
Patch Set: Addressed comments Created 4 years, 1 month 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/heap/gc-tracer.cc ('k') | no next file » | 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/heap/heap.h" 5 #include "src/heap/heap.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/ast/context-slot-cache.h" 9 #include "src/ast/context-slot-cache.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after
1626 // 1626 //
1627 // There is guaranteed to be enough room at the top of the to space 1627 // There is guaranteed to be enough room at the top of the to space
1628 // for the addresses of promoted objects: every object promoted 1628 // for the addresses of promoted objects: every object promoted
1629 // frees up its size in bytes from the top of the new space, and 1629 // frees up its size in bytes from the top of the new space, and
1630 // objects are at least one pointer in size. 1630 // objects are at least one pointer in size.
1631 Address new_space_front = new_space_->ToSpaceStart(); 1631 Address new_space_front = new_space_->ToSpaceStart();
1632 promotion_queue_.Initialize(); 1632 promotion_queue_.Initialize();
1633 1633
1634 ScavengeVisitor scavenge_visitor(this); 1634 ScavengeVisitor scavenge_visitor(this);
1635 1635
1636 if (FLAG_scavenge_reclaim_unmodified_objects) { 1636 isolate()->global_handles()->IdentifyWeakUnmodifiedObjects(
1637 isolate()->global_handles()->IdentifyWeakUnmodifiedObjects( 1637 &IsUnmodifiedHeapObject);
1638 &IsUnmodifiedHeapObject);
1639 }
1640 1638
1641 { 1639 {
1642 // Copy roots. 1640 // Copy roots.
1643 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_ROOTS); 1641 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_ROOTS);
1644 IterateRoots(&scavenge_visitor, VISIT_ALL_IN_SCAVENGE); 1642 IterateRoots(&scavenge_visitor, VISIT_ALL_IN_SCAVENGE);
1645 } 1643 }
1646 1644
1647 { 1645 {
1648 // Copy objects reachable from the old generation. 1646 // Copy objects reachable from the old generation.
1649 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_OLD_TO_NEW_POINTERS); 1647 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_OLD_TO_NEW_POINTERS);
(...skipping 27 matching lines...) Expand all
1677 if (collector->is_code_flushing_enabled()) { 1675 if (collector->is_code_flushing_enabled()) {
1678 collector->code_flusher()->IteratePointersToFromSpace(&scavenge_visitor); 1676 collector->code_flusher()->IteratePointersToFromSpace(&scavenge_visitor);
1679 } 1677 }
1680 } 1678 }
1681 1679
1682 { 1680 {
1683 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_SEMISPACE); 1681 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_SEMISPACE);
1684 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); 1682 new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
1685 } 1683 }
1686 1684
1687 if (FLAG_scavenge_reclaim_unmodified_objects) { 1685 isolate()->global_handles()->MarkNewSpaceWeakUnmodifiedObjectsPending(
1688 isolate()->global_handles()->MarkNewSpaceWeakUnmodifiedObjectsPending( 1686 &IsUnscavengedHeapObject);
1689 &IsUnscavengedHeapObject);
1690 1687
1691 isolate()->global_handles()->IterateNewSpaceWeakUnmodifiedRoots( 1688 isolate()->global_handles()->IterateNewSpaceWeakUnmodifiedRoots(
1692 &scavenge_visitor); 1689 &scavenge_visitor);
1693 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); 1690 new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
1694 } else {
1695 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_OBJECT_GROUPS);
1696 while (isolate()->global_handles()->IterateObjectGroups(
1697 &scavenge_visitor, &IsUnscavengedHeapObject)) {
1698 new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
1699 }
1700 isolate()->global_handles()->RemoveObjectGroups();
1701 isolate()->global_handles()->RemoveImplicitRefGroups();
1702
1703 isolate()->global_handles()->IdentifyNewSpaceWeakIndependentHandles(
1704 &IsUnscavengedHeapObject);
1705
1706 isolate()->global_handles()->IterateNewSpaceWeakIndependentRoots(
1707 &scavenge_visitor);
1708 new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
1709 }
1710 1691
1711 UpdateNewSpaceReferencesInExternalStringTable( 1692 UpdateNewSpaceReferencesInExternalStringTable(
1712 &UpdateNewSpaceReferenceInExternalStringTableEntry); 1693 &UpdateNewSpaceReferenceInExternalStringTableEntry);
1713 1694
1714 promotion_queue_.Destroy(); 1695 promotion_queue_.Destroy();
1715 1696
1716 incremental_marking()->UpdateMarkingDequeAfterScavenge(); 1697 incremental_marking()->UpdateMarkingDequeAfterScavenge();
1717 1698
1718 ScavengeWeakObjectRetainer weak_object_retainer(this); 1699 ScavengeWeakObjectRetainer weak_object_retainer(this);
1719 ProcessYoungWeakReferences(&weak_object_retainer); 1700 ProcessYoungWeakReferences(&weak_object_retainer);
(...skipping 4754 matching lines...) Expand 10 before | Expand all | Expand 10 after
6474 } 6455 }
6475 6456
6476 6457
6477 // static 6458 // static
6478 int Heap::GetStaticVisitorIdForMap(Map* map) { 6459 int Heap::GetStaticVisitorIdForMap(Map* map) {
6479 return StaticVisitorBase::GetVisitorId(map); 6460 return StaticVisitorBase::GetVisitorId(map);
6480 } 6461 }
6481 6462
6482 } // namespace internal 6463 } // namespace internal
6483 } // namespace v8 6464 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/gc-tracer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698