| 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/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1660 | 1660 |
| 1661 { | 1661 { |
| 1662 // Copy roots. | 1662 // Copy roots. |
| 1663 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_ROOTS); | 1663 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_ROOTS); |
| 1664 IterateRoots(&scavenge_visitor, VISIT_ALL_IN_SCAVENGE); | 1664 IterateRoots(&scavenge_visitor, VISIT_ALL_IN_SCAVENGE); |
| 1665 } | 1665 } |
| 1666 | 1666 |
| 1667 { | 1667 { |
| 1668 // Copy objects reachable from the old generation. | 1668 // Copy objects reachable from the old generation. |
| 1669 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_OLD_TO_NEW_POINTERS); | 1669 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_OLD_TO_NEW_POINTERS); |
| 1670 RememberedSet<OLD_TO_NEW>::Iterate(this, [this](Address addr) { | 1670 PromotionMode promotion_mode = CurrentPromotionMode(); |
| 1671 return Scavenger::CheckAndScavengeObject(this, addr, DEFAULT_PROMOTION); | 1671 RememberedSet<OLD_TO_NEW>::Iterate( |
| 1672 }); | 1672 this, [this, promotion_mode](Address addr) { |
| 1673 return Scavenger::CheckAndScavengeObject(this, addr, promotion_mode); |
| 1674 }); |
| 1673 | 1675 |
| 1674 RememberedSet<OLD_TO_NEW>::IterateTyped( | 1676 RememberedSet<OLD_TO_NEW>::IterateTyped( |
| 1675 this, [this](SlotType type, Address addr) { | 1677 this, [this](SlotType type, Address addr) { |
| 1676 return UpdateTypedSlotHelper::UpdateTypedSlot( | 1678 return UpdateTypedSlotHelper::UpdateTypedSlot( |
| 1677 isolate(), type, addr, [this](Object** addr) { | 1679 isolate(), type, addr, [this](Object** addr) { |
| 1678 // We expect that objects referenced by code are long living. | 1680 // We expect that objects referenced by code are long living. |
| 1679 // If we do not force promotion, then we need to clear | 1681 // If we do not force promotion, then we need to clear |
| 1680 // old_to_new slots in dead code objects after mark-compact. | 1682 // old_to_new slots in dead code objects after mark-compact. |
| 1681 return Scavenger::CheckAndScavengeObject( | 1683 return Scavenger::CheckAndScavengeObject( |
| 1682 this, reinterpret_cast<Address>(addr), FORCE_PROMOTION); | 1684 this, reinterpret_cast<Address>(addr), FORCE_PROMOTION); |
| (...skipping 4687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6370 } | 6372 } |
| 6371 | 6373 |
| 6372 | 6374 |
| 6373 // static | 6375 // static |
| 6374 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6376 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6375 return StaticVisitorBase::GetVisitorId(map); | 6377 return StaticVisitorBase::GetVisitorId(map); |
| 6376 } | 6378 } |
| 6377 | 6379 |
| 6378 } // namespace internal | 6380 } // namespace internal |
| 6379 } // namespace v8 | 6381 } // namespace v8 |
| OLD | NEW |