#include "src/heap/heap.h"
#include <cmath>
#include <iostream>
#include <limits>
#include "include/v8-isolate.h"
#include "include/v8-object.h"
#include "src/flags/flags.h"
#include "src/handles/handles-inl.h"
#include "src/heap/gc-tracer-inl.h"
#include "src/heap/gc-tracer.h"
#include "src/heap/marking-state-inl.h"
#include "src/heap/minor-mark-sweep.h"
#include "src/heap/mutable-page-metadata.h"
#include "src/heap/remembered-set.h"
#include "src/heap/safepoint.h"
#include "src/heap/spaces-inl.h"
#include "src/heap/trusted-range.h"
#include "src/objects/js-array-buffer-inl.h"
#include "src/objects/objects-inl.h"
#include "test/unittests/heap/heap-utils.h"
#include "test/unittests/test-utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace v8 {
namespace internal {
using HeapTest = TestWithHeapInternalsAndContext;
TEST(Heap, YoungGenerationSizeFromOldGenerationSize) { … }
TEST(Heap, GenerationSizesFromHeapSize) { … }
TEST(Heap, HeapSizeFromPhysicalMemory) { … }
TEST_F(HeapTest, ASLR) { … }
TEST_F(HeapTest, ExternalLimitDefault) { … }
TEST_F(HeapTest, ExternalLimitStaysAboveDefaultForExplicitHandling) { … }
#ifdef V8_COMPRESS_POINTERS
TEST_F(HeapTest, HeapLayout) { … }
#endif
namespace {
void ShrinkNewSpace(NewSpace* new_space) { … }
}
TEST_F(HeapTest, GrowAndShrinkNewSpace) { … }
TEST_F(HeapTest, CollectingAllAvailableGarbageShrinksNewSpace) { … }
TEST_F(HeapTest, OptimizedAllocationAlwaysInNewSpace) { … }
namespace {
template <RememberedSetType direction>
static size_t GetRememberedSetSize(Tagged<HeapObject> obj) { … }
}
TEST_F(HeapTest, RememberedSet_InsertOnPromotingObjectToOld) { … }
TEST_F(HeapTest, Regress978156) { … }
#ifdef V8_ENABLE_ALLOCATION_TIMEOUT
namespace {
struct RandomGCIntervalTestSetter { … };
struct HeapTestWithRandomGCInterval : RandomGCIntervalTestSetter, HeapTest { … };
}
TEST_F(HeapTestWithRandomGCInterval, AllocationTimeout) { … }
#endif
TEST_F(HeapTest, Regress341769455) { … }
}
}