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 5345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5356 Register result = candidate; | 5356 Register result = candidate; |
5357 __ bind(&found_in_symbol_table); | 5357 __ bind(&found_in_symbol_table); |
5358 __ Move(r0, result); | 5358 __ Move(r0, result); |
5359 } | 5359 } |
5360 | 5360 |
5361 | 5361 |
5362 void StringHelper::GenerateHashInit(MacroAssembler* masm, | 5362 void StringHelper::GenerateHashInit(MacroAssembler* masm, |
5363 Register hash, | 5363 Register hash, |
5364 Register character) { | 5364 Register character) { |
5365 // hash = character + (character << 10); | 5365 // hash = character + (character << 10); |
5366 __ LoadRoot(hash, Heap::kStringHashSeedRootIndex); | 5366 __ LoadRoot(hash, Heap::kHashSeedRootIndex); |
5367 // Untag smi seed and add the character. | 5367 // Untag smi seed and add the character. |
5368 __ add(hash, character, Operand(hash, LSR, kSmiTagSize)); | 5368 __ add(hash, character, Operand(hash, LSR, kSmiTagSize)); |
5369 // hash += hash << 10; | 5369 // hash += hash << 10; |
5370 __ add(hash, hash, Operand(hash, LSL, 10)); | 5370 __ add(hash, hash, Operand(hash, LSL, 10)); |
5371 // hash ^= hash >> 6; | 5371 // hash ^= hash >> 6; |
5372 __ eor(hash, hash, Operand(hash, LSR, 6)); | 5372 __ eor(hash, hash, Operand(hash, LSR, 6)); |
5373 } | 5373 } |
5374 | 5374 |
5375 | 5375 |
5376 void StringHelper::GenerateHashAddCharacter(MacroAssembler* masm, | 5376 void StringHelper::GenerateHashAddCharacter(MacroAssembler* masm, |
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6641 __ mov(result, Operand::Zero()); | 6641 __ mov(result, Operand::Zero()); |
6642 __ Ret(); | 6642 __ Ret(); |
6643 } | 6643 } |
6644 | 6644 |
6645 | 6645 |
6646 #undef __ | 6646 #undef __ |
6647 | 6647 |
6648 } } // namespace v8::internal | 6648 } } // namespace v8::internal |
6649 | 6649 |
6650 #endif // V8_TARGET_ARCH_ARM | 6650 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |