| 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 4592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4603 __ movq(rax, result); | 4603 __ movq(rax, result); |
| 4604 } | 4604 } |
| 4605 } | 4605 } |
| 4606 | 4606 |
| 4607 | 4607 |
| 4608 void StringHelper::GenerateHashInit(MacroAssembler* masm, | 4608 void StringHelper::GenerateHashInit(MacroAssembler* masm, |
| 4609 Register hash, | 4609 Register hash, |
| 4610 Register character, | 4610 Register character, |
| 4611 Register scratch) { | 4611 Register scratch) { |
| 4612 // hash = (seed + character) + ((seed + character) << 10); | 4612 // hash = (seed + character) + ((seed + character) << 10); |
| 4613 __ LoadRoot(scratch, Heap::kStringHashSeedRootIndex); | 4613 __ LoadRoot(scratch, Heap::kHashSeedRootIndex); |
| 4614 __ SmiToInteger32(scratch, scratch); | 4614 __ SmiToInteger32(scratch, scratch); |
| 4615 __ addl(scratch, character); | 4615 __ addl(scratch, character); |
| 4616 __ movl(hash, scratch); | 4616 __ movl(hash, scratch); |
| 4617 __ shll(scratch, Immediate(10)); | 4617 __ shll(scratch, Immediate(10)); |
| 4618 __ addl(hash, scratch); | 4618 __ addl(hash, scratch); |
| 4619 // hash ^= hash >> 6; | 4619 // hash ^= hash >> 6; |
| 4620 __ movl(scratch, hash); | 4620 __ movl(scratch, hash); |
| 4621 __ shrl(scratch, Immediate(6)); | 4621 __ shrl(scratch, Immediate(6)); |
| 4622 __ xorl(hash, scratch); | 4622 __ xorl(hash, scratch); |
| 4623 } | 4623 } |
| (...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5495 __ Drop(1); | 5495 __ Drop(1); |
| 5496 __ ret(2 * kPointerSize); | 5496 __ ret(2 * kPointerSize); |
| 5497 } | 5497 } |
| 5498 | 5498 |
| 5499 | 5499 |
| 5500 #undef __ | 5500 #undef __ |
| 5501 | 5501 |
| 5502 } } // namespace v8::internal | 5502 } } // namespace v8::internal |
| 5503 | 5503 |
| 5504 #endif // V8_TARGET_ARCH_X64 | 5504 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |