![]() |
v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
|
#include <scavenger.h>
Classes | |
| struct | PromotedListEntry |
Public Types | |
| using | CopiedList |
| using | ObjectAndMap = std::pair<Tagged<HeapObject>, Tagged<Map>> |
| using | PinnedList |
| using | PromotedList |
| using | EmptyChunksList = ::heap::base::Worklist<MutablePageMetadata*, 64> |
Public Member Functions | |
| Scavenger (ScavengerCollector *collector, Heap *heap, bool is_logging, EmptyChunksList *empty_chunks, CopiedList *copied_list, PinnedList *pinned_list, PromotedList *promoted_list, EphemeronRememberedSet::TableList *ephemeron_table_list) | |
| void | ScavengePage (MutablePageMetadata *page) |
| void | Process (JobDelegate *delegate=nullptr) |
| void | Finalize () |
| void | Publish () |
| void | AddEphemeronHashTable (Tagged< EphemeronHashTable > table) |
| bool | PromoteIfLargeObject (Tagged< HeapObject > object) |
| void | PinAndPushObject (MemoryChunk *chunk, Tagged< HeapObject > object, MapWord map_word) |
| void | VisitPinnedObjects () |
| size_t | bytes_copied () const |
| size_t | bytes_promoted () const |
| template<typename THeapObjectSlot > | |
| CopyAndForwardResult | SemiSpaceCopyObject (Tagged< Map > map, THeapObjectSlot slot, Tagged< HeapObject > object, int object_size, ObjectFields object_fields) |
| template<typename THeapObjectSlot , Scavenger::PromotionHeapChoice promotion_heap_choice> | |
| CopyAndForwardResult | PromoteObject (Tagged< Map > map, THeapObjectSlot slot, Tagged< HeapObject > object, int object_size, ObjectFields object_fields) |
| template<typename THeapObjectSlot , Scavenger::PromotionHeapChoice promotion_heap_choice> | |
| SlotCallbackResult | EvacuateObjectDefault (Tagged< Map > map, THeapObjectSlot slot, Tagged< HeapObject > object, int object_size, ObjectFields object_fields) |
| template<typename THeapObjectSlot > | |
| SlotCallbackResult | EvacuateObject (THeapObjectSlot slot, Tagged< Map > map, Tagged< HeapObject > source) |
Static Public Attributes | |
| static constexpr int | kCopiedListSegmentSize = 256 |
| static constexpr int | kPinnedListSegmentSize = 64 |
| static constexpr int | kPromotedListSegmentSize = 256 |
Private Types | |
| enum | PromotionHeapChoice { kPromoteIntoLocalHeap , kPromoteIntoSharedHeap } |
Private Member Functions | |
| Heap * | heap () |
| void | SynchronizePageAccess (Tagged< MaybeObject > object) const |
| void | AddPageToSweeperIfNecessary (MutablePageMetadata *page) |
| template<typename TSlot > | |
| SlotCallbackResult | CheckAndScavengeObject (Heap *heap, TSlot slot) |
| template<typename TSlot > | |
| void | CheckOldToNewSlotForSharedUntyped (MemoryChunk *chunk, MutablePageMetadata *page, TSlot slot) |
| void | CheckOldToNewSlotForSharedTyped (MemoryChunk *chunk, MutablePageMetadata *page, SlotType slot_type, Address slot_address, Tagged< MaybeObject > new_target) |
| template<typename THeapObjectSlot > | |
| SlotCallbackResult | ScavengeObject (THeapObjectSlot p, Tagged< HeapObject > object) |
| V8_INLINE bool | MigrateObject (Tagged< Map > map, Tagged< HeapObject > source, Tagged< HeapObject > target, int size, PromotionHeapChoice promotion_heap_choice) |
| V8_INLINE SlotCallbackResult | RememberedSetEntryNeeded (CopyAndForwardResult result) |
| template<typename THeapObjectSlot > | |
| V8_INLINE CopyAndForwardResult | SemiSpaceCopyObject (Tagged< Map > map, THeapObjectSlot slot, Tagged< HeapObject > object, int object_size, ObjectFields object_fields) |
| template<typename THeapObjectSlot , PromotionHeapChoice promotion_heap_choice = kPromoteIntoLocalHeap> | |
| V8_INLINE CopyAndForwardResult | PromoteObject (Tagged< Map > map, THeapObjectSlot slot, Tagged< HeapObject > object, int object_size, ObjectFields object_fields) |
| template<typename THeapObjectSlot > | |
| V8_INLINE SlotCallbackResult | EvacuateObject (THeapObjectSlot slot, Tagged< Map > map, Tagged< HeapObject > source) |
| V8_INLINE bool | HandleLargeObject (Tagged< Map > map, Tagged< HeapObject > object, int object_size, ObjectFields object_fields) |
| template<typename THeapObjectSlot , PromotionHeapChoice promotion_heap_choice = kPromoteIntoLocalHeap> | |
| V8_INLINE SlotCallbackResult | EvacuateObjectDefault (Tagged< Map > map, THeapObjectSlot slot, Tagged< HeapObject > object, int object_size, ObjectFields object_fields) |
| template<typename THeapObjectSlot > | |
| SlotCallbackResult | EvacuateThinString (Tagged< Map > map, THeapObjectSlot slot, Tagged< ThinString > object, int object_size) |
| template<typename THeapObjectSlot > | |
| SlotCallbackResult | EvacuateShortcutCandidate (Tagged< Map > map, THeapObjectSlot slot, Tagged< ConsString > object, int object_size) |
| template<typename THeapObjectSlot > | |
| SlotCallbackResult | EvacuateInPlaceInternalizableString (Tagged< Map > map, THeapObjectSlot slot, Tagged< String > string, int object_size, ObjectFields object_fields) |
| void | IterateAndScavengePromotedObject (Tagged< HeapObject > target, Tagged< Map > map, int size) |
| void | RememberPromotedEphemeron (Tagged< EphemeronHashTable > table, int index) |
| V8_INLINE bool | ShouldEagerlyProcessPromotedList () const |
| void | PushPinnedObject (Tagged< HeapObject > object, Tagged< Map > map, int object_size) |
| void | PushPinnedPromotedObject (Tagged< HeapObject > object, Tagged< Map > map, int object_size) |
Static Private Attributes | |
| static const int | kInterruptThreshold = 128 |
Friends | |
| class | IterateAndScavengePromotedObjectsVisitor |
| class | RootScavengeVisitor |
| class | ScavengeVisitor |
Definition at line 42 of file scavenger.h.
Definition at line 48 of file scavenger.h.
Definition at line 63 of file scavenger.h.
| using v8::internal::Scavenger::ObjectAndMap = std::pair<Tagged<HeapObject>, Tagged<Map>> |
Definition at line 51 of file scavenger.h.
Definition at line 52 of file scavenger.h.
Definition at line 60 of file scavenger.h.
|
private |
| Enumerator | |
|---|---|
| kPromoteIntoLocalHeap | |
| kPromoteIntoSharedHeap | |
Definition at line 95 of file scavenger.h.
| v8::internal::Scavenger::Scavenger | ( | ScavengerCollector * | collector, |
| Heap * | heap, | ||
| bool | is_logging, | ||
| EmptyChunksList * | empty_chunks, | ||
| CopiedList * | copied_list, | ||
| PinnedList * | pinned_list, | ||
| PromotedList * | promoted_list, | ||
| EphemeronRememberedSet::TableList * | ephemeron_table_list ) |
Definition at line 1109 of file scavenger.cc.
| void v8::internal::Scavenger::AddEphemeronHashTable | ( | Tagged< EphemeronHashTable > | table | ) |
Definition at line 1370 of file scavenger.cc.
|
private |
|
inline |
|
inline |
|
inlineprivate |
Definition at line 407 of file scavenger-inl.h.
|
inlineprivate |
Definition at line 1388 of file scavenger.cc.
|
inlineprivate |
Definition at line 1375 of file scavenger.cc.
|
inlineprivate |
Definition at line 302 of file scavenger-inl.h.
| SlotCallbackResult v8::internal::Scavenger::EvacuateObject | ( | THeapObjectSlot | slot, |
| Tagged< Map > | map, | ||
| Tagged< HeapObject > | source ) |
|
private |
| SlotCallbackResult v8::internal::Scavenger::EvacuateObjectDefault | ( | Tagged< Map > | map, |
| THeapObjectSlot | slot, | ||
| Tagged< HeapObject > | object, | ||
| int | object_size, | ||
| ObjectFields | object_fields ) |
|
private |
|
inlineprivate |
Definition at line 260 of file scavenger-inl.h.
|
inlineprivate |
Definition at line 234 of file scavenger-inl.h.
| void v8::internal::Scavenger::Finalize | ( | ) |
|
private |
Definition at line 169 of file scavenger-inl.h.
|
inlineprivate |
|
private |
Definition at line 1131 of file scavenger.cc.
|
private |
Definition at line 48 of file scavenger-inl.h.
| void v8::internal::Scavenger::PinAndPushObject | ( | MemoryChunk * | chunk, |
| Tagged< HeapObject > | object, | ||
| MapWord | map_word ) |
| void v8::internal::Scavenger::Process | ( | JobDelegate * | delegate = nullptr | ) |
Definition at line 1245 of file scavenger.cc.
| bool v8::internal::Scavenger::PromoteIfLargeObject | ( | Tagged< HeapObject > | object | ) |
| CopyAndForwardResult v8::internal::Scavenger::PromoteObject | ( | Tagged< Map > | map, |
| THeapObjectSlot | slot, | ||
| Tagged< HeapObject > | object, | ||
| int | object_size, | ||
| ObjectFields | object_fields ) |
|
private |
| void v8::internal::Scavenger::Publish | ( | ) |
Definition at line 1364 of file scavenger.cc.
|
private |
Definition at line 1428 of file scavenger.cc.
|
private |
Definition at line 1438 of file scavenger.cc.
|
private |
|
private |
|
inlineprivate |
Definition at line 353 of file scavenger-inl.h.
| void v8::internal::Scavenger::ScavengePage | ( | MutablePageMetadata * | page | ) |
Definition at line 1157 of file scavenger.cc.
| CopyAndForwardResult v8::internal::Scavenger::SemiSpaceCopyObject | ( | Tagged< Map > | map, |
| THeapObjectSlot | slot, | ||
| Tagged< HeapObject > | object, | ||
| int | object_size, | ||
| ObjectFields | object_fields ) |
|
private |
|
private |
Definition at line 29 of file scavenger-inl.h.
|
inlineprivate |
Definition at line 37 of file scavenger-inl.h.
| void v8::internal::Scavenger::VisitPinnedObjects | ( | ) |
Definition at line 1448 of file scavenger.cc.
|
friend |
Definition at line 211 of file scavenger.h.
|
friend |
Definition at line 212 of file scavenger.h.
|
friend |
Definition at line 213 of file scavenger.h.
|
private |
Definition at line 204 of file scavenger.h.
|
private |
Definition at line 192 of file scavenger.h.
|
private |
Definition at line 202 of file scavenger.h.
|
private |
Definition at line 193 of file scavenger.h.
|
private |
Definition at line 206 of file scavenger.h.
|
staticconstexpr |
Definition at line 44 of file scavenger.h.
|
staticprivate |
Definition at line 99 of file scavenger.h.
|
staticconstexpr |
Definition at line 45 of file scavenger.h.
|
staticconstexpr |
Definition at line 46 of file scavenger.h.
|
private |
Definition at line 195 of file scavenger.h.
|
private |
Definition at line 194 of file scavenger.h.
|
private |
Definition at line 200 of file scavenger.h.
|
private |
Definition at line 198 of file scavenger.h.
|
private |
Definition at line 196 of file scavenger.h.
|
private |
Definition at line 199 of file scavenger.h.
|
private |
Definition at line 197 of file scavenger.h.
|
private |
Definition at line 201 of file scavenger.h.
|
private |
Definition at line 208 of file scavenger.h.
|
private |
Definition at line 203 of file scavenger.h.
|
private |
Definition at line 207 of file scavenger.h.
|
private |
Definition at line 209 of file scavenger.h.