OLD | NEW |
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/assembler-inl.h" | 9 #include "src/assembler-inl.h" |
10 #include "src/ast/context-slot-cache.h" | 10 #include "src/ast/context-slot-cache.h" |
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1716 | 1716 |
1717 { | 1717 { |
1718 // Copy roots. | 1718 // Copy roots. |
1719 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_ROOTS); | 1719 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_ROOTS); |
1720 IterateRoots(&scavenge_visitor, VISIT_ALL_IN_SCAVENGE); | 1720 IterateRoots(&scavenge_visitor, VISIT_ALL_IN_SCAVENGE); |
1721 } | 1721 } |
1722 | 1722 |
1723 { | 1723 { |
1724 // Copy objects reachable from the old generation. | 1724 // Copy objects reachable from the old generation. |
1725 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_OLD_TO_NEW_POINTERS); | 1725 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_OLD_TO_NEW_POINTERS); |
1726 RememberedSet<OLD_TO_NEW>::Iterate( | 1726 RememberedSet<OLD_TO_NEW>::Iterate(this, [this](Address addr) { |
1727 this, SYNCHRONIZED, [this](Address addr) { | 1727 return Scavenger::CheckAndScavengeObject(this, addr); |
1728 return Scavenger::CheckAndScavengeObject(this, addr); | 1728 }); |
1729 }); | |
1730 | 1729 |
1731 RememberedSet<OLD_TO_NEW>::IterateTyped( | 1730 RememberedSet<OLD_TO_NEW>::IterateTyped( |
1732 this, SYNCHRONIZED, | 1731 this, [this](SlotType type, Address host_addr, Address addr) { |
1733 [this](SlotType type, Address host_addr, Address addr) { | |
1734 return UpdateTypedSlotHelper::UpdateTypedSlot( | 1732 return UpdateTypedSlotHelper::UpdateTypedSlot( |
1735 isolate(), type, addr, [this](Object** addr) { | 1733 isolate(), type, addr, [this](Object** addr) { |
1736 // We expect that objects referenced by code are long living. | 1734 // We expect that objects referenced by code are long living. |
1737 // If we do not force promotion, then we need to clear | 1735 // If we do not force promotion, then we need to clear |
1738 // old_to_new slots in dead code objects after mark-compact. | 1736 // old_to_new slots in dead code objects after mark-compact. |
1739 return Scavenger::CheckAndScavengeObject( | 1737 return Scavenger::CheckAndScavengeObject( |
1740 this, reinterpret_cast<Address>(addr)); | 1738 this, reinterpret_cast<Address>(addr)); |
1741 }); | 1739 }); |
1742 }); | 1740 }); |
1743 } | 1741 } |
(...skipping 4659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6403 } | 6401 } |
6404 | 6402 |
6405 | 6403 |
6406 // static | 6404 // static |
6407 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6405 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6408 return StaticVisitorBase::GetVisitorId(map); | 6406 return StaticVisitorBase::GetVisitorId(map); |
6409 } | 6407 } |
6410 | 6408 |
6411 } // namespace internal | 6409 } // namespace internal |
6412 } // namespace v8 | 6410 } // namespace v8 |
OLD | NEW |