Permalink
Browse files

Land number collision fix for v8 3.6 by Erik Corry

  • Loading branch information...
1 parent e282c0a commit 4fdec07bd81a604762218a8e9d0649fb5cef7b6c @indutny indutny committed Jan 19, 2012
Showing with 3 additions and 6 deletions.
  1. +1 −0 deps/v8/src/ia32/code-stubs-ia32.cc
  2. +2 −6 deps/v8/src/objects.h
View
1 deps/v8/src/ia32/code-stubs-ia32.cc
@@ -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);
View
8 deps/v8/src/objects.h
@@ -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);
}

0 comments on commit 4fdec07

Please sign in to comment.