[hash-table] Make a few accessor definitions more readable

Change-Id: I10dd526c0ec1bee9c049b8a2a352908357bb302a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2534812
Commit-Queue: Georg Neis <neis@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Auto-Submit: Georg Neis <neis@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71158}
This commit is contained in:
Georg Neis 2020-11-12 16:03:39 +01:00 committed by Commit Bot
parent 4a89c01876
commit a28eb2c81c

View File

@ -71,18 +71,15 @@ void EphemeronHashTable::set_key(int index, Object value,
}
int HashTableBase::NumberOfElements() const {
int offset = OffsetOfElementAt(kNumberOfElementsIndex);
return TaggedField<Smi>::load(*this, offset).value();
return Smi::cast(get(kNumberOfElementsIndex)).value();
}
int HashTableBase::NumberOfDeletedElements() const {
int offset = OffsetOfElementAt(kNumberOfDeletedElementsIndex);
return TaggedField<Smi>::load(*this, offset).value();
return Smi::cast(get(kNumberOfDeletedElementsIndex)).value();
}
int HashTableBase::Capacity() const {
int offset = OffsetOfElementAt(kCapacityIndex);
return TaggedField<Smi>::load(*this, offset).value();
return Smi::cast(get(kCapacityIndex)).value();
}
InternalIndex::Range HashTableBase::IterateEntries() const {