From a28eb2c81c8f20b45ae75b6996d7ae512a88839f Mon Sep 17 00:00:00 2001 From: Georg Neis Date: Thu, 12 Nov 2020 16:03:39 +0100 Subject: [PATCH] [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 Commit-Queue: Ulan Degenbaev Auto-Submit: Georg Neis Reviewed-by: Ulan Degenbaev Cr-Commit-Position: refs/heads/master@{#71158} --- src/objects/hash-table-inl.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/objects/hash-table-inl.h b/src/objects/hash-table-inl.h index 4e4e9b9017..1eeb89b3e1 100644 --- a/src/objects/hash-table-inl.h +++ b/src/objects/hash-table-inl.h @@ -71,18 +71,15 @@ void EphemeronHashTable::set_key(int index, Object value, } int HashTableBase::NumberOfElements() const { - int offset = OffsetOfElementAt(kNumberOfElementsIndex); - return TaggedField::load(*this, offset).value(); + return Smi::cast(get(kNumberOfElementsIndex)).value(); } int HashTableBase::NumberOfDeletedElements() const { - int offset = OffsetOfElementAt(kNumberOfDeletedElementsIndex); - return TaggedField::load(*this, offset).value(); + return Smi::cast(get(kNumberOfDeletedElementsIndex)).value(); } int HashTableBase::Capacity() const { - int offset = OffsetOfElementAt(kCapacityIndex); - return TaggedField::load(*this, offset).value(); + return Smi::cast(get(kCapacityIndex)).value(); } InternalIndex::Range HashTableBase::IterateEntries() const {