Commit 391101df authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[stringtable] Remove number_of_elements DCHECK

The DCHECK on number_of_elements was making TSAN unhappy. Given that
making this field atomic would be a performance penalty, and that the
DCHECK isn't expected to catch any errors in practice (other DCHECKs
check the same invariant), we can just drop it.

Bug: v8:11183
Change-Id: Ic1b5697b233c4c45c3951816531f888459c3e69f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2567698
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71527}
parent 535fd785
...@@ -253,7 +253,6 @@ InternalIndex StringTable::Data::FindEntry(LocalIsolate* isolate, ...@@ -253,7 +253,6 @@ InternalIndex StringTable::Data::FindEntry(LocalIsolate* isolate,
uint32_t hash) const { uint32_t hash) const {
uint32_t count = 1; uint32_t count = 1;
// EnsureCapacity will guarantee the hash table is never full. // EnsureCapacity will guarantee the hash table is never full.
DCHECK_LT(number_of_elements_, capacity_);
for (InternalIndex entry = FirstProbe(hash, capacity_);; for (InternalIndex entry = FirstProbe(hash, capacity_);;
entry = NextProbe(entry, count++, capacity_)) { entry = NextProbe(entry, count++, capacity_)) {
// TODO(leszeks): Consider delaying the decompression until after the // TODO(leszeks): Consider delaying the decompression until after the
...@@ -270,7 +269,6 @@ InternalIndex StringTable::Data::FindInsertionEntry(IsolateRoot isolate, ...@@ -270,7 +269,6 @@ InternalIndex StringTable::Data::FindInsertionEntry(IsolateRoot isolate,
uint32_t hash) const { uint32_t hash) const {
uint32_t count = 1; uint32_t count = 1;
// EnsureCapacity will guarantee the hash table is never full. // EnsureCapacity will guarantee the hash table is never full.
DCHECK_LT(number_of_elements_, capacity_);
for (InternalIndex entry = FirstProbe(hash, capacity_);; for (InternalIndex entry = FirstProbe(hash, capacity_);;
entry = NextProbe(entry, count++, capacity_)) { entry = NextProbe(entry, count++, capacity_)) {
// TODO(leszeks): Consider delaying the decompression until after the // TODO(leszeks): Consider delaying the decompression until after the
...@@ -287,7 +285,6 @@ InternalIndex StringTable::Data::FindEntryOrInsertionEntry( ...@@ -287,7 +285,6 @@ InternalIndex StringTable::Data::FindEntryOrInsertionEntry(
InternalIndex insertion_entry = InternalIndex::NotFound(); InternalIndex insertion_entry = InternalIndex::NotFound();
uint32_t count = 1; uint32_t count = 1;
// EnsureCapacity will guarantee the hash table is never full. // EnsureCapacity will guarantee the hash table is never full.
DCHECK_LT(number_of_elements_, capacity_);
for (InternalIndex entry = FirstProbe(hash, capacity_);; for (InternalIndex entry = FirstProbe(hash, capacity_);;
entry = NextProbe(entry, count++, capacity_)) { entry = NextProbe(entry, count++, capacity_)) {
// TODO(leszeks): Consider delaying the decompression until after the // TODO(leszeks): Consider delaying the decompression until after the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment