Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Land number collision fix for v8 3.6 by Erik Corry
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Jan 19, 2012
1 parent e282c0a commit 4fdec07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions deps/v8/src/ia32/code-stubs-ia32.cc
Expand Up @@ -5614,6 +5614,7 @@ void StringHelper::GenerateHashInit(MacroAssembler* masm,
__ mov(scratch, Operand::StaticArray(scratch,
times_pointer_size,
roots_address));
__ SmiUntag(scratch);
__ add(scratch, Operand(character));
__ mov(hash, scratch);
__ shl(scratch, 10);
Expand Down
8 changes: 2 additions & 6 deletions deps/v8/src/objects.h
Expand Up @@ -2534,19 +2534,15 @@ class HashTable: public FixedArray {
// Wrapper methods
inline uint32_t Hash(Key key) {
if (Shape::UsesSeed) {
// I'm using map()->heap() to skip is_safe_to_read_maps assertion.
// That was done, because NumberDictionary is used inside GC.
return Shape::SeededHash(key, map()->heap()->HashSeed());
return Shape::SeededHash(key, GetHeap()->HashSeed());
} else {
return Shape::Hash(key);
}
}

inline uint32_t HashForObject(Key key, Object* object) {
if (Shape::UsesSeed) {
// I'm using map()->heap() to skip is_safe_to_read_maps assertion.
// That was done, because NumberDictionary is used inside GC.
return Shape::SeededHashForObject(key, map()->heap()->HashSeed(), object);
return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object);
} else {
return Shape::HashForObject(key, object);
}
Expand Down

0 comments on commit 4fdec07

Please sign in to comment.