Home | History | Annotate | Download | only in blockfile

Lines Matching refs:hash

46 // The number of bits that a hash has to be shifted to grab the part that
112 void SetCellId(IndexCell* cell, uint32 hash) {
113 DCHECK_LE(hash, static_cast<uint32>(kCellIdMask));
115 cell->first_part |= static_cast<int64>(hash) << kCellIdOffset;
118 void SetCellSmallTableId(IndexCell* cell, uint32 hash) {
119 DCHECK_LE(hash, static_cast<uint32>(kCellSmallTableIdMask));
121 cell->first_part |= static_cast<int64>(hash) << kCellSmallTableIdOffset;
248 CellInfo cell_info = { cell.hash(), cell.GetAddress() };
321 uint32 hash,
326 EntryCell entry_cell(cell_num, hash, *cell, small_table);
330 return EntryCell(cell_num, hash, address, small_table);
343 uint32 hash,
347 hash_(hash),
358 SetCellSmallTableId(&cell_, hash >> kSmallTableHashShift);
362 SetCellId(&cell_, hash >> kHashShift);
367 uint32 hash,
371 hash_(hash),
441 // from the main table. In order to locate a given cell, part of the hash is
443 // all cells with that partial hash (i.e., belonging to that bucket) are
577 EntrySet IndexTable::LookupEntries(uint32 hash) {
579 int bucket_num = static_cast<int>(hash & mask_);
596 if (MisplacedHash(*current_cell, hash)) {
597 HandleMisplacedCell(current_cell, cell_num, hash & mask_);
598 } else if (IsHashMatch(*current_cell, hash)) {
599 EntryCell entry_cell(cell_num, hash, *current_cell, small_table_);
614 EntryCell IndexTable::CreateEntryCell(uint32 hash, Addr address) {
618 int bucket_num = static_cast<int>(hash & mask_);
643 bucket->hash = hash & mask_;
651 EntryCell entry_cell(cell_num, hash, address, small_table_);
668 EntryCell IndexTable::FindEntryCell(uint32 hash, Addr address) {
669 return FindEntryCellImpl(hash, address, false);
682 void IndexTable::SetSate(uint32 hash, Addr address, EntryState state) {
683 EntryCell cell = FindEntryCellImpl(hash, address, state == ENTRY_FREE);
730 void IndexTable::UpdateTime(uint32 hash, Addr address, base::Time current) {
731 EntryCell cell = FindEntryCell(hash, address);
795 EntryCell IndexTable::FindEntryCellImpl(uint32 hash, Addr address,
797 int bucket_num = static_cast<int>(hash & mask_);
805 if (IsHashMatch(*current_cell, hash)) {
808 EntryCell entry_cell(cell_num, hash, *current_cell, small_table_);
956 // Consider a large cache: a cell stores the upper 18 bits of the hash
1019 uint32 hash = GetFullHash(*current_cell, main_table_index);
1020 EntryCell old_cell(cell_num, hash, *current_cell, small_table_);
1030 EntryCell new_cell = CreateEntryCell(hash, old_cell.GetAddress());
1073 uint32 hash = GetFullHash(*current_cell, main_table_index);
1077 CheckBucketList(hash & mask_);
1127 // part of the hash.
1134 // All the bits stored in the cell should match the provided hash.
1135 bool IndexTable::IsHashMatch(const IndexCell& cell, uint32 hash) {
1136 hash = small_table_ ? hash >> kSmallTableHashShift : hash >> kHashShift;
1137 return GetHashValue(cell) == hash;
1140 bool IndexTable::MisplacedHash(const IndexCell& cell, uint32 hash) {
1145 hash = small_table_ ? hash >> kSmallTableHashShift : hash >> kHashShift;
1146 return (GetHashValue(cell) & mask) != (hash & mask);