#include <initializer_list>
#include "base/functional/bind.h"
#include "base/test/scoped_feature_list.h"
#include "build/buildflag.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_deque.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_counted_set.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/heap_buildflags.h"
#include "third_party/blink/renderer/platform/heap/heap_test_objects.h"
#include "third_party/blink/renderer/platform/heap/heap_test_utilities.h"
#include "third_party/blink/renderer/platform/heap/member.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/heap/thread_state.h"
#include "third_party/blink/renderer/platform/heap/trace_traits.h"
#include "third_party/blink/renderer/platform/heap/visitor.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink {
class IncrementalMarkingTest : public TestSupportingGC { … };
namespace incremental_marking_test {
namespace {
class NonGarbageCollectedContainer { … };
class NonGarbageCollectedContainerRoot { … };
}
TEST_F(IncrementalMarkingTest, HeapVectorPushBackMember) { … }
TEST_F(IncrementalMarkingTest, HeapVectorPushBackNonGCedContainer) { … }
TEST_F(IncrementalMarkingTest, HeapVectorPushBackStdPair) { … }
TEST_F(IncrementalMarkingTest, HeapVectorEmplaceBackMember) { … }
TEST_F(IncrementalMarkingTest, HeapVectorEmplaceBackNonGCedContainer) { … }
TEST_F(IncrementalMarkingTest, HeapVectorEmplaceBackStdPair) { … }
TEST_F(IncrementalMarkingTest, HeapVectorCopyMember) { … }
TEST_F(IncrementalMarkingTest, HeapVectorCopyMemberInCtor) { … }
TEST_F(IncrementalMarkingTest, HeapVectorCopyNonGCedContainer) { … }
TEST_F(IncrementalMarkingTest, HeapVectorCopyNonGCedContainerInCtor) { … }
TEST_F(IncrementalMarkingTest, HeapVectorCopyStdPair) { … }
TEST_F(IncrementalMarkingTest, HeapVectorCopyStdPairInCtor) { … }
TEST_F(IncrementalMarkingTest, HeapVectorMoveMember) { … }
TEST_F(IncrementalMarkingTest, HeapVectorMoveMemberInCtor) { … }
TEST_F(IncrementalMarkingTest, HeapVectorMoveNonGCedContainer) { … }
TEST_F(IncrementalMarkingTest, HeapVectorMoveNonGCedContainerInCtor) { … }
TEST_F(IncrementalMarkingTest, HeapVectorMoveStdPair) { … }
TEST_F(IncrementalMarkingTest, HeapVectorMoveStdPairInCtor) { … }
TEST_F(IncrementalMarkingTest, HeapVectorSwapMember) { … }
TEST_F(IncrementalMarkingTest, HeapVectorSwapNonGCedContainer) { … }
TEST_F(IncrementalMarkingTest, HeapVectorSwapStdPair) { … }
TEST_F(IncrementalMarkingTest, HeapVectorSubscriptOperator) { … }
TEST_F(IncrementalMarkingTest, HeapVectorEagerTracingStopsAtMember) { … }
TEST_F(IncrementalMarkingTest, HeapDequePushBackMember) { … }
TEST_F(IncrementalMarkingTest, HeapDequePushFrontMember) { … }
TEST_F(IncrementalMarkingTest, HeapDequeEmplaceBackMember) { … }
TEST_F(IncrementalMarkingTest, HeapDequeEmplaceFrontMember) { … }
TEST_F(IncrementalMarkingTest, HeapDequeCopyMember) { … }
TEST_F(IncrementalMarkingTest, HeapDequeCopyMemberInCtor) { … }
TEST_F(IncrementalMarkingTest, HeapDequeMoveMember) { … }
TEST_F(IncrementalMarkingTest, HeapDequeMoveMemberInCtor) { … }
TEST_F(IncrementalMarkingTest, HeapDequeSwapMember) { … }
namespace {
template <typename Container>
void Insert() { … }
template <typename Container>
void Copy() { … }
template <typename Container>
void Move() { … }
template <typename Container>
void Swap() { … }
}
TEST_F(IncrementalMarkingTest, HeapHashSetInsert) { … }
TEST_F(IncrementalMarkingTest, HeapHashSetCopy) { … }
TEST_F(IncrementalMarkingTest, HeapHashSetMove) { … }
TEST_F(IncrementalMarkingTest, HeapHashSetSwap) { … }
TEST_F(IncrementalMarkingTest, HeapLinkedHashSetInsert) { … }
TEST_F(IncrementalMarkingTest, HeapLinkedHashSetCopy) { … }
TEST_F(IncrementalMarkingTest, HeapLinkedHashSetMove) { … }
TEST_F(IncrementalMarkingTest, HeapLinkedHashSetSwap) { … }
TEST_F(IncrementalMarkingTest, HeapHashCountedSetInsert) { … }
TEST_F(IncrementalMarkingTest, HeapHashCountedSetSwap) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapInsertMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapInsertWeakMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapInsertMemberWeakMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapInsertWeakMemberMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapSetMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapSetMemberUpdateValue) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapIteratorChangeKey) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapIteratorChangeValue) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapCopyMemberMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapCopyWeakMemberWeakMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapCopyMemberWeakMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapCopyWeakMemberMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapMoveMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapMoveWeakMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapMoveMemberWeakMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapMoveWeakMemberMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapSwapMemberMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapSwapWeakMemberWeakMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapSwapMemberWeakMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapSwapWeakMemberMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapCopyKeysToVectorMember) { … }
TEST_F(IncrementalMarkingTest, HeapHashMapCopyValuesToVectorMember) { … }
TEST_F(IncrementalMarkingTest, TestDriver) { … }
TEST_F(IncrementalMarkingTest, DropBackingStore) { … }
TEST_F(IncrementalMarkingTest, NoBackingFreeDuringIncrementalMarking) { … }
TEST_F(IncrementalMarkingTest, DropReferenceWithHeapCompaction) { … }
namespace {
class ObjectWithWeakMember : public GarbageCollected<ObjectWithWeakMember> { … };
}
TEST_F(IncrementalMarkingTest, WeakMember) { … }
TEST_F(IncrementalMarkingTest, MemberSwap) { … }
namespace {
template <typename T>
class ObjectHolder : public GarbageCollected<ObjectHolder<T>> { … };
}
TEST_F(IncrementalMarkingTest, StepDuringObjectConstruction) { … }
TEST_F(IncrementalMarkingTest, StepDuringMixinObjectConstruction) { … }
TEST_F(IncrementalMarkingTest, IncrementalMarkingShrinkingBackingCompaction) { … }
TEST_F(IncrementalMarkingTest,
InPayloadWriteBarrierRegistersInvalidSlotForCompaction) { … }
TEST_F(IncrementalMarkingTest, AdjustMarkedBytesOnMarkedBackingStore) { … }
TEST_F(IncrementalMarkingTest, HeapCompactWithStaleSlotInNestedContainer) { … }
class Destructed final : public GarbageCollected<Destructed> { … };
size_t Destructed::n_destructed = …;
class LinkedHashSetWrapper final
: public GarbageCollected<LinkedHashSetWrapper> { … };
TEST_F(IncrementalMarkingTest, LinkedHashSetMovingCallback) { … }
class DestructedAndTraced final : public GarbageCollected<DestructedAndTraced> { … };
size_t DestructedAndTraced::n_destructed = …;
size_t DestructedAndTraced::n_traced = …;
#if BUILDFLAG(IS_LINUX)
#define MAYBE_ConservativeGCOfWeakContainer …
#else
#define MAYBE_ConservativeGCOfWeakContainer …
#endif
TEST_F(IncrementalMarkingTest, MAYBE_ConservativeGCOfWeakContainer) { … }
TEST_F(IncrementalMarkingTest,
WriteBarrierOfWeakContainersStrongifiesBackingStore) { … }
TEST_F(IncrementalMarkingTest, NestedVectorsWithInlineCapacityOnStack) { … }
}
}