chromium/v8/test/unittests/heap/cppgc/sweeper-unittest.cc

// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/heap/cppgc/sweeper.h"

#include <algorithm>

#include "include/cppgc/allocation.h"
#include "include/cppgc/cross-thread-persistent.h"
#include "include/cppgc/persistent.h"
#include "src/heap/cppgc/globals.h"
#include "src/heap/cppgc/heap-object-header.h"
#include "src/heap/cppgc/heap-page.h"
#include "src/heap/cppgc/heap-visitor.h"
#include "src/heap/cppgc/heap.h"
#include "src/heap/cppgc/object-view.h"
#include "src/heap/cppgc/page-memory.h"
#include "src/heap/cppgc/stats-collector.h"
#include "test/unittests/heap/cppgc/tests.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace cppgc {
namespace internal {

namespace {

size_t g_destructor_callcount;

template <size_t Size>
class GCed : public GarbageCollected<GCed<Size>> {};

class SweeperTest : public testing::TestWithHeap {};

}  // namespace

TEST_F(SweeperTest, SweepUnmarkedNormalObject) {}

TEST_F(SweeperTest, DontSweepMarkedNormalObject) {}

TEST_F(SweeperTest, SweepUnmarkedLargeObject) {}

TEST_F(SweeperTest, DontSweepMarkedLargeObject) {}

TEST_F(SweeperTest, SweepMultipleObjectsOnPage) {}

TEST_F(SweeperTest, SweepObjectsOnAllArenas) {}

TEST_F(SweeperTest, SweepMultiplePagesInSingleSpace) {}

TEST_F(SweeperTest, CoalesceFreeListEntries) {}

namespace {

class GCInDestructor final : public GarbageCollected<GCInDestructor> {};

}  // namespace

TEST_F(SweeperTest, SweepDoesNotTriggerRecursiveGC) {}

TEST_F(SweeperTest, UnmarkObjects) {}

TEST_F(SweeperTest, LazySweepingDuringAllocation) {}

TEST_F(SweeperTest, LazySweepingNormalPages) {}

namespace {
class AllocatingFinalizer : public GarbageCollected<AllocatingFinalizer> {};
size_t AllocatingFinalizer::destructor_callcount_ =;
}  // namespace

TEST_F(SweeperTest, AllocationDuringFinalizationIsNotSwept) {}

TEST_F(SweeperTest, DiscardingNormalPageMemory) {}

namespace {

class Holder final : public GarbageCollected<Holder> {};

// static
size_t Holder::destructor_callcount;

}  // namespace

TEST_F(SweeperTest, CrossThreadPersistentCanBeClearedFromOtherThread) {}

TEST_F(SweeperTest, WeakCrossThreadPersistentCanBeClearedFromOtherThread) {}

TEST_F(SweeperTest, SweepOnAllocationTakeLastFreeListEntry) {}

}  // namespace internal
}  // namespace cppgc