2016-02-08 08:51:02 +00:00
|
|
|
// Copyright 2016 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 <limits>
|
2016-10-21 09:04:50 +00:00
|
|
|
#include <map>
|
2016-02-08 08:51:02 +00:00
|
|
|
|
2019-05-24 13:51:59 +00:00
|
|
|
#include "src/common/globals.h"
|
2016-02-08 08:51:02 +00:00
|
|
|
#include "src/heap/slot-set.h"
|
|
|
|
#include "src/heap/spaces.h"
|
2018-10-23 23:02:20 +00:00
|
|
|
#include "src/objects/slots.h"
|
2016-02-08 08:51:02 +00:00
|
|
|
#include "testing/gtest/include/gtest/gtest.h"
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
2019-12-06 14:49:21 +00:00
|
|
|
TEST(PossiblyEmptyBucketsTest, WordsForBuckets) {
|
|
|
|
EXPECT_EQ(
|
|
|
|
PossiblyEmptyBuckets::WordsForBuckets(PossiblyEmptyBuckets::kBitsPerWord),
|
|
|
|
1U);
|
|
|
|
EXPECT_EQ(PossiblyEmptyBuckets::WordsForBuckets(
|
|
|
|
PossiblyEmptyBuckets::kBitsPerWord - 1),
|
|
|
|
1U);
|
|
|
|
EXPECT_EQ(PossiblyEmptyBuckets::WordsForBuckets(
|
|
|
|
PossiblyEmptyBuckets::kBitsPerWord + 1),
|
|
|
|
2U);
|
|
|
|
|
|
|
|
EXPECT_EQ(PossiblyEmptyBuckets::WordsForBuckets(
|
|
|
|
5 * PossiblyEmptyBuckets::kBitsPerWord - 1),
|
|
|
|
5U);
|
|
|
|
EXPECT_EQ(PossiblyEmptyBuckets::WordsForBuckets(
|
|
|
|
5 * PossiblyEmptyBuckets::kBitsPerWord),
|
|
|
|
5U);
|
|
|
|
EXPECT_EQ(PossiblyEmptyBuckets::WordsForBuckets(
|
|
|
|
5 * PossiblyEmptyBuckets::kBitsPerWord + 1),
|
|
|
|
6U);
|
|
|
|
}
|
|
|
|
|
2019-10-30 09:56:04 +00:00
|
|
|
TEST(SlotSet, BucketsForSize) {
|
|
|
|
EXPECT_EQ(static_cast<size_t>(SlotSet::kBucketsRegularPage),
|
|
|
|
SlotSet::BucketsForSize(Page::kPageSize));
|
|
|
|
|
|
|
|
EXPECT_EQ(static_cast<size_t>(SlotSet::kBucketsRegularPage) * 2,
|
|
|
|
SlotSet::BucketsForSize(Page::kPageSize * 2));
|
|
|
|
}
|
|
|
|
|
2016-02-08 08:51:02 +00:00
|
|
|
TEST(SlotSet, InsertAndLookup1) {
|
2019-10-30 09:56:04 +00:00
|
|
|
SlotSet* set = SlotSet::Allocate(SlotSet::kBucketsRegularPage);
|
2018-12-19 19:10:21 +00:00
|
|
|
for (int i = 0; i < Page::kPageSize; i += kTaggedSize) {
|
2019-10-30 09:56:04 +00:00
|
|
|
EXPECT_FALSE(set->Lookup(i));
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
2018-12-19 19:10:21 +00:00
|
|
|
for (int i = 0; i < Page::kPageSize; i += kTaggedSize) {
|
2019-10-30 09:56:04 +00:00
|
|
|
set->Insert<AccessMode::ATOMIC>(i);
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
2018-12-19 19:10:21 +00:00
|
|
|
for (int i = 0; i < Page::kPageSize; i += kTaggedSize) {
|
2019-10-30 09:56:04 +00:00
|
|
|
EXPECT_TRUE(set->Lookup(i));
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
2019-10-30 09:56:04 +00:00
|
|
|
SlotSet::Delete(set, SlotSet::kBucketsRegularPage);
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST(SlotSet, InsertAndLookup2) {
|
2019-10-30 09:56:04 +00:00
|
|
|
SlotSet* set = SlotSet::Allocate(SlotSet::kBucketsRegularPage);
|
2018-12-19 19:10:21 +00:00
|
|
|
for (int i = 0; i < Page::kPageSize; i += kTaggedSize) {
|
2016-02-08 08:51:02 +00:00
|
|
|
if (i % 7 == 0) {
|
2019-10-30 09:56:04 +00:00
|
|
|
set->Insert<AccessMode::ATOMIC>(i);
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
|
|
|
}
|
2018-12-19 19:10:21 +00:00
|
|
|
for (int i = 0; i < Page::kPageSize; i += kTaggedSize) {
|
2016-02-08 08:51:02 +00:00
|
|
|
if (i % 7 == 0) {
|
2019-10-30 09:56:04 +00:00
|
|
|
EXPECT_TRUE(set->Lookup(i));
|
2016-02-08 08:51:02 +00:00
|
|
|
} else {
|
2019-10-30 09:56:04 +00:00
|
|
|
EXPECT_FALSE(set->Lookup(i));
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-30 09:56:04 +00:00
|
|
|
SlotSet::Delete(set, SlotSet::kBucketsRegularPage);
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST(SlotSet, Iterate) {
|
2019-10-30 09:56:04 +00:00
|
|
|
SlotSet* set = SlotSet::Allocate(SlotSet::kBucketsRegularPage);
|
|
|
|
|
2018-12-19 19:10:21 +00:00
|
|
|
for (int i = 0; i < Page::kPageSize; i += kTaggedSize) {
|
2016-02-08 08:51:02 +00:00
|
|
|
if (i % 7 == 0) {
|
2019-10-30 09:56:04 +00:00
|
|
|
set->Insert<AccessMode::ATOMIC>(i);
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-30 09:56:04 +00:00
|
|
|
set->Iterate(
|
2020-04-28 15:36:52 +00:00
|
|
|
kNullAddress, 0, SlotSet::kBucketsRegularPage,
|
2018-10-23 23:02:20 +00:00
|
|
|
[](MaybeObjectSlot slot) {
|
|
|
|
if (slot.address() % 3 == 0) {
|
2016-10-05 09:26:55 +00:00
|
|
|
return KEEP_SLOT;
|
|
|
|
} else {
|
|
|
|
return REMOVE_SLOT;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
SlotSet::KEEP_EMPTY_BUCKETS);
|
2016-02-08 08:51:02 +00:00
|
|
|
|
2018-12-19 19:10:21 +00:00
|
|
|
for (int i = 0; i < Page::kPageSize; i += kTaggedSize) {
|
2016-02-08 08:51:02 +00:00
|
|
|
if (i % 21 == 0) {
|
2019-10-30 09:56:04 +00:00
|
|
|
EXPECT_TRUE(set->Lookup(i));
|
2016-02-08 08:51:02 +00:00
|
|
|
} else {
|
2019-10-30 09:56:04 +00:00
|
|
|
EXPECT_FALSE(set->Lookup(i));
|
2020-04-28 15:36:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SlotSet::Delete(set, SlotSet::kBucketsRegularPage);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(SlotSet, IterateFromHalfway) {
|
|
|
|
SlotSet* set = SlotSet::Allocate(SlotSet::kBucketsRegularPage);
|
|
|
|
|
|
|
|
for (int i = 0; i < Page::kPageSize; i += kTaggedSize) {
|
|
|
|
if (i % 7 == 0) {
|
|
|
|
set->Insert<AccessMode::ATOMIC>(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
set->Iterate(
|
|
|
|
kNullAddress, SlotSet::kBucketsRegularPage / 2,
|
|
|
|
SlotSet::kBucketsRegularPage,
|
|
|
|
[](MaybeObjectSlot slot) {
|
|
|
|
if (slot.address() % 3 == 0) {
|
|
|
|
return KEEP_SLOT;
|
|
|
|
} else {
|
|
|
|
return REMOVE_SLOT;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
SlotSet::KEEP_EMPTY_BUCKETS);
|
|
|
|
|
|
|
|
for (int i = 0; i < Page::kPageSize; i += kTaggedSize) {
|
|
|
|
if (i < Page::kPageSize / 2 && i % 7 == 0) {
|
|
|
|
EXPECT_TRUE(set->Lookup(i));
|
|
|
|
} else if (i >= Page::kPageSize / 2 && i % 21 == 0) {
|
|
|
|
EXPECT_TRUE(set->Lookup(i));
|
|
|
|
} else {
|
|
|
|
EXPECT_FALSE(set->Lookup(i));
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-30 09:56:04 +00:00
|
|
|
|
|
|
|
SlotSet::Delete(set, SlotSet::kBucketsRegularPage);
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST(SlotSet, Remove) {
|
2019-10-30 09:56:04 +00:00
|
|
|
SlotSet* set = SlotSet::Allocate(SlotSet::kBucketsRegularPage);
|
|
|
|
|
2018-12-19 19:10:21 +00:00
|
|
|
for (int i = 0; i < Page::kPageSize; i += kTaggedSize) {
|
2016-02-08 08:51:02 +00:00
|
|
|
if (i % 7 == 0) {
|
2019-10-30 09:56:04 +00:00
|
|
|
set->Insert<AccessMode::ATOMIC>(i);
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-19 19:10:21 +00:00
|
|
|
for (int i = 0; i < Page::kPageSize; i += kTaggedSize) {
|
2016-02-08 08:51:02 +00:00
|
|
|
if (i % 3 != 0) {
|
2019-10-30 09:56:04 +00:00
|
|
|
set->Remove(i);
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-19 19:10:21 +00:00
|
|
|
for (int i = 0; i < Page::kPageSize; i += kTaggedSize) {
|
2016-02-08 08:51:02 +00:00
|
|
|
if (i % 21 == 0) {
|
2019-10-30 09:56:04 +00:00
|
|
|
EXPECT_TRUE(set->Lookup(i));
|
2016-02-08 08:51:02 +00:00
|
|
|
} else {
|
2019-10-30 09:56:04 +00:00
|
|
|
EXPECT_FALSE(set->Lookup(i));
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-30 09:56:04 +00:00
|
|
|
|
|
|
|
SlotSet::Delete(set, SlotSet::kBucketsRegularPage);
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
|
|
|
|
2019-12-06 14:49:21 +00:00
|
|
|
TEST(PossiblyEmptyBuckets, ContainsAndInsert) {
|
|
|
|
static const int kBuckets = 100;
|
|
|
|
PossiblyEmptyBuckets possibly_empty_buckets;
|
|
|
|
possibly_empty_buckets.Insert(0, kBuckets);
|
|
|
|
int last = sizeof(uintptr_t) * kBitsPerByte - 2;
|
|
|
|
possibly_empty_buckets.Insert(last, kBuckets);
|
|
|
|
EXPECT_TRUE(possibly_empty_buckets.Contains(0));
|
|
|
|
EXPECT_TRUE(possibly_empty_buckets.Contains(last));
|
|
|
|
possibly_empty_buckets.Insert(last + 1, kBuckets);
|
|
|
|
EXPECT_TRUE(possibly_empty_buckets.Contains(0));
|
|
|
|
EXPECT_TRUE(possibly_empty_buckets.Contains(last));
|
|
|
|
EXPECT_TRUE(possibly_empty_buckets.Contains(last + 1));
|
|
|
|
}
|
|
|
|
|
2016-02-17 11:52:31 +00:00
|
|
|
void CheckRemoveRangeOn(uint32_t start, uint32_t end) {
|
2019-10-30 09:56:04 +00:00
|
|
|
SlotSet* set = SlotSet::Allocate(SlotSet::kBucketsRegularPage);
|
2018-12-19 19:10:21 +00:00
|
|
|
uint32_t first = start == 0 ? 0 : start - kTaggedSize;
|
|
|
|
uint32_t last = end == Page::kPageSize ? end - kTaggedSize : end;
|
2016-10-18 10:06:37 +00:00
|
|
|
for (const auto mode :
|
|
|
|
{SlotSet::FREE_EMPTY_BUCKETS, SlotSet::KEEP_EMPTY_BUCKETS}) {
|
2018-12-19 19:10:21 +00:00
|
|
|
for (uint32_t i = first; i <= last; i += kTaggedSize) {
|
2019-10-30 09:56:04 +00:00
|
|
|
set->Insert<AccessMode::ATOMIC>(i);
|
2016-10-18 10:06:37 +00:00
|
|
|
}
|
2019-10-30 09:56:04 +00:00
|
|
|
set->RemoveRange(start, end, SlotSet::kBucketsRegularPage, mode);
|
2016-10-18 10:06:37 +00:00
|
|
|
if (first != start) {
|
2019-10-30 09:56:04 +00:00
|
|
|
EXPECT_TRUE(set->Lookup(first));
|
2016-10-18 10:06:37 +00:00
|
|
|
}
|
|
|
|
if (last == end) {
|
2019-10-30 09:56:04 +00:00
|
|
|
EXPECT_TRUE(set->Lookup(last));
|
2016-10-18 10:06:37 +00:00
|
|
|
}
|
2018-12-19 19:10:21 +00:00
|
|
|
for (uint32_t i = start; i < end; i += kTaggedSize) {
|
2019-10-30 09:56:04 +00:00
|
|
|
EXPECT_FALSE(set->Lookup(i));
|
2016-10-18 10:06:37 +00:00
|
|
|
}
|
2016-02-17 11:52:31 +00:00
|
|
|
}
|
2019-10-30 09:56:04 +00:00
|
|
|
SlotSet::Delete(set, SlotSet::kBucketsRegularPage);
|
2016-02-17 11:52:31 +00:00
|
|
|
}
|
2016-02-08 08:51:02 +00:00
|
|
|
|
2016-02-17 11:52:31 +00:00
|
|
|
TEST(SlotSet, RemoveRange) {
|
|
|
|
CheckRemoveRangeOn(0, Page::kPageSize);
|
2018-12-19 19:10:21 +00:00
|
|
|
CheckRemoveRangeOn(1 * kTaggedSize, 1023 * kTaggedSize);
|
2016-02-17 11:52:31 +00:00
|
|
|
for (uint32_t start = 0; start <= 32; start++) {
|
2018-12-19 19:10:21 +00:00
|
|
|
CheckRemoveRangeOn(start * kTaggedSize, (start + 1) * kTaggedSize);
|
|
|
|
CheckRemoveRangeOn(start * kTaggedSize, (start + 2) * kTaggedSize);
|
2016-02-17 11:52:31 +00:00
|
|
|
const uint32_t kEnds[] = {32, 64, 100, 128, 1024, 1500, 2048};
|
2016-11-10 10:16:21 +00:00
|
|
|
for (size_t i = 0; i < sizeof(kEnds) / sizeof(uint32_t); i++) {
|
2016-02-17 11:52:31 +00:00
|
|
|
for (int k = -3; k <= 3; k++) {
|
|
|
|
uint32_t end = (kEnds[i] + k);
|
|
|
|
if (start < end) {
|
2018-12-19 19:10:21 +00:00
|
|
|
CheckRemoveRangeOn(start * kTaggedSize, end * kTaggedSize);
|
2016-02-17 11:52:31 +00:00
|
|
|
}
|
|
|
|
}
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-30 09:56:04 +00:00
|
|
|
SlotSet* set = SlotSet::Allocate(SlotSet::kBucketsRegularPage);
|
2016-10-18 10:06:37 +00:00
|
|
|
for (const auto mode :
|
|
|
|
{SlotSet::FREE_EMPTY_BUCKETS, SlotSet::KEEP_EMPTY_BUCKETS}) {
|
2019-10-30 09:56:04 +00:00
|
|
|
set->Insert<AccessMode::ATOMIC>(Page::kPageSize / 2);
|
|
|
|
set->RemoveRange(0, Page::kPageSize, SlotSet::kBucketsRegularPage, mode);
|
2018-12-19 19:10:21 +00:00
|
|
|
for (uint32_t i = 0; i < Page::kPageSize; i += kTaggedSize) {
|
2019-10-30 09:56:04 +00:00
|
|
|
EXPECT_FALSE(set->Lookup(i));
|
2016-10-18 10:06:37 +00:00
|
|
|
}
|
2016-02-17 11:52:31 +00:00
|
|
|
}
|
2019-10-30 09:56:04 +00:00
|
|
|
SlotSet::Delete(set, SlotSet::kBucketsRegularPage);
|
2016-02-08 08:51:02 +00:00
|
|
|
}
|
|
|
|
|
2016-02-25 17:28:50 +00:00
|
|
|
TEST(TypedSlotSet, Iterate) {
|
|
|
|
TypedSlotSet set(0);
|
2017-01-19 21:34:00 +00:00
|
|
|
// These two constants must be static as a workaround
|
|
|
|
// for a MSVC++ bug about lambda captures, see the discussion at
|
|
|
|
// https://social.msdn.microsoft.com/Forums/SqlServer/4abf18bd-4ae4-4c72-ba3e-3b13e7909d5f
|
|
|
|
static const int kDelta = 10000001;
|
2016-02-25 17:28:50 +00:00
|
|
|
int added = 0;
|
2018-12-10 16:13:45 +00:00
|
|
|
for (uint32_t i = 0; i < TypedSlotSet::kMaxOffset; i += kDelta) {
|
2016-09-21 13:20:36 +00:00
|
|
|
SlotType type = static_cast<SlotType>(i % CLEARED_SLOT);
|
2018-12-10 16:13:45 +00:00
|
|
|
set.Insert(type, i);
|
2016-02-25 17:28:50 +00:00
|
|
|
++added;
|
|
|
|
}
|
|
|
|
int iterated = 0;
|
2016-09-26 15:54:03 +00:00
|
|
|
set.Iterate(
|
2018-12-10 16:13:45 +00:00
|
|
|
[&iterated](SlotType type, Address addr) {
|
2018-04-13 22:28:05 +00:00
|
|
|
uint32_t i = static_cast<uint32_t>(addr);
|
2016-09-26 15:54:03 +00:00
|
|
|
EXPECT_EQ(i % CLEARED_SLOT, static_cast<uint32_t>(type));
|
2016-11-11 14:55:47 +00:00
|
|
|
EXPECT_EQ(0u, i % kDelta);
|
2016-09-26 15:54:03 +00:00
|
|
|
++iterated;
|
|
|
|
return i % 2 == 0 ? KEEP_SLOT : REMOVE_SLOT;
|
|
|
|
},
|
|
|
|
TypedSlotSet::KEEP_EMPTY_CHUNKS);
|
2016-02-25 17:28:50 +00:00
|
|
|
EXPECT_EQ(added, iterated);
|
|
|
|
iterated = 0;
|
2016-09-26 15:54:03 +00:00
|
|
|
set.Iterate(
|
2018-12-10 16:13:45 +00:00
|
|
|
[&iterated](SlotType type, Address addr) {
|
2018-04-13 22:28:05 +00:00
|
|
|
uint32_t i = static_cast<uint32_t>(addr);
|
2016-11-11 14:55:47 +00:00
|
|
|
EXPECT_EQ(0u, i % 2);
|
2016-09-26 15:54:03 +00:00
|
|
|
++iterated;
|
|
|
|
return KEEP_SLOT;
|
|
|
|
},
|
|
|
|
TypedSlotSet::KEEP_EMPTY_CHUNKS);
|
2016-02-25 17:28:50 +00:00
|
|
|
EXPECT_EQ(added / 2, iterated);
|
|
|
|
}
|
|
|
|
|
2018-11-21 10:34:07 +00:00
|
|
|
TEST(TypedSlotSet, ClearInvalidSlots) {
|
2016-10-21 09:04:50 +00:00
|
|
|
TypedSlotSet set(0);
|
|
|
|
const int kHostDelta = 100;
|
|
|
|
uint32_t entries = 10;
|
|
|
|
for (uint32_t i = 0; i < entries; i++) {
|
|
|
|
SlotType type = static_cast<SlotType>(i % CLEARED_SLOT);
|
2018-12-10 16:13:45 +00:00
|
|
|
set.Insert(type, i * kHostDelta);
|
2016-10-21 09:04:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
std::map<uint32_t, uint32_t> invalid_ranges;
|
|
|
|
for (uint32_t i = 1; i < entries; i += 2) {
|
|
|
|
invalid_ranges.insert(
|
|
|
|
std::pair<uint32_t, uint32_t>(i * kHostDelta, i * kHostDelta + 1));
|
|
|
|
}
|
|
|
|
|
2018-11-21 10:34:07 +00:00
|
|
|
set.ClearInvalidSlots(invalid_ranges);
|
2016-10-21 09:04:50 +00:00
|
|
|
for (std::map<uint32_t, uint32_t>::iterator it = invalid_ranges.begin();
|
|
|
|
it != invalid_ranges.end(); ++it) {
|
|
|
|
uint32_t start = it->first;
|
|
|
|
uint32_t end = it->second;
|
|
|
|
set.Iterate(
|
2018-12-10 16:13:45 +00:00
|
|
|
[=](SlotType slot_type, Address slot_addr) {
|
|
|
|
CHECK(slot_addr < start || slot_addr >= end);
|
2016-10-21 09:04:50 +00:00
|
|
|
return KEEP_SLOT;
|
|
|
|
},
|
|
|
|
TypedSlotSet::KEEP_EMPTY_CHUNKS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-21 10:34:07 +00:00
|
|
|
TEST(TypedSlotSet, Merge) {
|
|
|
|
TypedSlotSet set0(0), set1(0);
|
|
|
|
static const uint32_t kEntries = 10000;
|
|
|
|
for (uint32_t i = 0; i < kEntries; i++) {
|
2019-04-30 06:57:15 +00:00
|
|
|
set0.Insert(FULL_EMBEDDED_OBJECT_SLOT, 2 * i);
|
|
|
|
set1.Insert(FULL_EMBEDDED_OBJECT_SLOT, 2 * i + 1);
|
2018-11-21 10:34:07 +00:00
|
|
|
}
|
|
|
|
uint32_t count = 0;
|
|
|
|
set0.Merge(&set1);
|
|
|
|
set0.Iterate(
|
2018-12-10 16:13:45 +00:00
|
|
|
[&count](SlotType slot_type, Address slot_addr) {
|
2018-11-21 10:34:07 +00:00
|
|
|
if (count < kEntries) {
|
2018-12-10 16:13:45 +00:00
|
|
|
CHECK_EQ(slot_addr % 2, 0);
|
2018-11-21 10:34:07 +00:00
|
|
|
} else {
|
2018-12-10 16:13:45 +00:00
|
|
|
CHECK_EQ(slot_addr % 2, 1);
|
2018-11-21 10:34:07 +00:00
|
|
|
}
|
|
|
|
++count;
|
|
|
|
return KEEP_SLOT;
|
|
|
|
},
|
|
|
|
TypedSlotSet::KEEP_EMPTY_CHUNKS);
|
|
|
|
CHECK_EQ(2 * kEntries, count);
|
|
|
|
set1.Iterate(
|
2018-12-10 16:13:45 +00:00
|
|
|
[](SlotType slot_type, Address slot_addr) {
|
2018-11-21 10:34:07 +00:00
|
|
|
CHECK(false); // Unreachable.
|
|
|
|
return KEEP_SLOT;
|
|
|
|
},
|
|
|
|
TypedSlotSet::KEEP_EMPTY_CHUNKS);
|
|
|
|
}
|
|
|
|
|
2016-02-08 08:51:02 +00:00
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|