Skip to content

Commit

Permalink
Alter the second hash used in StoreBuffer::Compact.
Browse files Browse the repository at this point in the history
hash2 >> (kHashMapLengthLog2 * 2) was always zero because hash2 was masked with (kHashMapLength - 1).

R=erik.corry@gmail.com

Review URL: http://codereview.chromium.org/9085021

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@10336 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
  • Loading branch information
vegorov@chromium.org committed Jan 5, 2012
1 parent 565ce1d commit 7130f93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/store-buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,9 @@ void StoreBuffer::Compact() {
int hash1 =
((int_addr ^ (int_addr >> kHashSetLengthLog2)) & (kHashSetLength - 1));
if (hash_set_1_[hash1] == int_addr) continue;
int hash2 =
((int_addr - (int_addr >> kHashSetLengthLog2)) & (kHashSetLength - 1));
uintptr_t hash2 = (int_addr - (int_addr >> kHashSetLengthLog2));
hash2 ^= hash2 >> (kHashSetLengthLog2 * 2);
hash2 &= (kHashSetLength - 1);
if (hash_set_2_[hash2] == int_addr) continue;
if (hash_set_1_[hash1] == 0) {
hash_set_1_[hash1] = int_addr;
Expand Down

0 comments on commit 7130f93

Please sign in to comment.