Land number collision fix for v8 3.6 by Erik Corry

Update with fixes from: http://codereview.chromium.org/9190001/
This commit is contained in:
Fedor Indutny 2012-01-19 21:44:59 +06:00
parent e282c0a081
commit 4fdec07bd8
2 changed files with 3 additions and 6 deletions

View File

@ -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 File

@ -2534,9 +2534,7 @@ 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);
}
@ -2544,9 +2542,7 @@ class HashTable: public FixedArray {
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);
}