OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 5909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5920 Register result = candidate; | 5920 Register result = candidate; |
5921 __ bind(&found_in_symbol_table); | 5921 __ bind(&found_in_symbol_table); |
5922 __ mov(v0, result); | 5922 __ mov(v0, result); |
5923 } | 5923 } |
5924 | 5924 |
5925 | 5925 |
5926 void StringHelper::GenerateHashInit(MacroAssembler* masm, | 5926 void StringHelper::GenerateHashInit(MacroAssembler* masm, |
5927 Register hash, | 5927 Register hash, |
5928 Register character) { | 5928 Register character) { |
5929 // hash = seed + character + ((seed + character) << 10); | 5929 // hash = seed + character + ((seed + character) << 10); |
5930 __ LoadRoot(hash, Heap::kStringHashSeedRootIndex); | 5930 __ LoadRoot(hash, Heap::kHashSeedRootIndex); |
5931 // Untag smi seed and add the character. | 5931 // Untag smi seed and add the character. |
5932 __ SmiUntag(hash); | 5932 __ SmiUntag(hash); |
5933 __ addu(hash, hash, character); | 5933 __ addu(hash, hash, character); |
5934 __ sll(at, hash, 10); | 5934 __ sll(at, hash, 10); |
5935 __ addu(hash, hash, at); | 5935 __ addu(hash, hash, at); |
5936 // hash ^= hash >> 6; | 5936 // hash ^= hash >> 6; |
5937 __ srl(at, hash, 6); | 5937 __ srl(at, hash, 6); |
5938 __ xor_(hash, hash, at); | 5938 __ xor_(hash, hash, at); |
5939 } | 5939 } |
5940 | 5940 |
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7581 __ Ret(USE_DELAY_SLOT); | 7581 __ Ret(USE_DELAY_SLOT); |
7582 __ mov(v0, a0); | 7582 __ mov(v0, a0); |
7583 } | 7583 } |
7584 | 7584 |
7585 | 7585 |
7586 #undef __ | 7586 #undef __ |
7587 | 7587 |
7588 } } // namespace v8::internal | 7588 } } // namespace v8::internal |
7589 | 7589 |
7590 #endif // V8_TARGET_ARCH_MIPS | 7590 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |