diff options
Diffstat (limited to 'deps/v8/test/unittests/heap/spaces-unittest.cc')
-rw-r--r-- | deps/v8/test/unittests/heap/spaces-unittest.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/deps/v8/test/unittests/heap/spaces-unittest.cc b/deps/v8/test/unittests/heap/spaces-unittest.cc index 07be431f97..87b9dccf80 100644 --- a/deps/v8/test/unittests/heap/spaces-unittest.cc +++ b/deps/v8/test/unittests/heap/spaces-unittest.cc @@ -128,11 +128,14 @@ TEST_F(SpacesTest, WriteBarrierInYoungGenerationFromSpace) { TEST_F(SpacesTest, CodeRangeAddressReuse) { CodeRangeAddressHint hint; - const size_t kAnyBaseAlignment = 1; + const size_t base_alignment = MemoryChunk::kPageSize; // Create code ranges. - Address code_range1 = hint.GetAddressHint(100, kAnyBaseAlignment); - Address code_range2 = hint.GetAddressHint(200, kAnyBaseAlignment); - Address code_range3 = hint.GetAddressHint(100, kAnyBaseAlignment); + Address code_range1 = hint.GetAddressHint(100, base_alignment); + CHECK(IsAligned(code_range1, base_alignment)); + Address code_range2 = hint.GetAddressHint(200, base_alignment); + CHECK(IsAligned(code_range2, base_alignment)); + Address code_range3 = hint.GetAddressHint(100, base_alignment); + CHECK(IsAligned(code_range3, base_alignment)); // Since the addresses are random, we cannot check that they are different. @@ -141,14 +144,14 @@ TEST_F(SpacesTest, CodeRangeAddressReuse) { hint.NotifyFreedCodeRange(code_range2, 200); // The next two code ranges should reuse the freed addresses. - Address code_range4 = hint.GetAddressHint(100, kAnyBaseAlignment); + Address code_range4 = hint.GetAddressHint(100, base_alignment); EXPECT_EQ(code_range4, code_range1); - Address code_range5 = hint.GetAddressHint(200, kAnyBaseAlignment); + Address code_range5 = hint.GetAddressHint(200, base_alignment); EXPECT_EQ(code_range5, code_range2); // Free the third code range and check address reuse. hint.NotifyFreedCodeRange(code_range3, 100); - Address code_range6 = hint.GetAddressHint(100, kAnyBaseAlignment); + Address code_range6 = hint.GetAddressHint(100, base_alignment); EXPECT_EQ(code_range6, code_range3); } |