Index: src/mips/code-stubs-mips.cc |
=================================================================== |
--- src/mips/code-stubs-mips.cc (revision 10328) |
+++ src/mips/code-stubs-mips.cc (working copy) |
@@ -5924,11 +5924,15 @@ |
void StringHelper::GenerateHashInit(MacroAssembler* masm, |
- Register hash, |
- Register character) { |
+ Register hash, |
+ Register character) { |
// hash = character + (character << 10); |
Vyacheslav Egorov (Chromium)
2012/01/04 14:30:57
comment is outdated
Erik Corry
2012/01/04 15:48:59
Done.
|
- __ sll(hash, character, 10); |
+ __ LoadRoot(hash, Heap::kStringHashSeedRootIndex); |
+ // Untag smi seed and add the character. |
+ __ SmiUntag(hash); |
__ addu(hash, hash, character); |
+ __ sll(at, hash, 10); |
+ __ addu(hash, hash, at); |
// hash ^= hash >> 6; |
__ srl(at, hash, 6); |
__ xor_(hash, hash, at); |
@@ -5936,8 +5940,8 @@ |
void StringHelper::GenerateHashAddCharacter(MacroAssembler* masm, |
- Register hash, |
- Register character) { |
+ Register hash, |
+ Register character) { |
// hash += character; |
__ addu(hash, hash, character); |
// hash += hash << 10; |