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 4941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4952 __ movq(rax, result); | 4952 __ movq(rax, result); |
4953 } | 4953 } |
4954 } | 4954 } |
4955 | 4955 |
4956 | 4956 |
4957 void StringHelper::GenerateHashInit(MacroAssembler* masm, | 4957 void StringHelper::GenerateHashInit(MacroAssembler* masm, |
4958 Register hash, | 4958 Register hash, |
4959 Register character, | 4959 Register character, |
4960 Register scratch) { | 4960 Register scratch) { |
4961 // hash = (seed + character) + ((seed + character) << 10); | 4961 // hash = (seed + character) + ((seed + character) << 10); |
4962 __ LoadRoot(scratch, Heap::kStringHashSeedRootIndex); | 4962 __ LoadRoot(scratch, Heap::kHashSeedRootIndex); |
4963 __ SmiToInteger32(scratch, scratch); | 4963 __ SmiToInteger32(scratch, scratch); |
4964 __ addl(scratch, character); | 4964 __ addl(scratch, character); |
4965 __ movl(hash, scratch); | 4965 __ movl(hash, scratch); |
4966 __ shll(scratch, Immediate(10)); | 4966 __ shll(scratch, Immediate(10)); |
4967 __ addl(hash, scratch); | 4967 __ addl(hash, scratch); |
4968 // hash ^= hash >> 6; | 4968 // hash ^= hash >> 6; |
4969 __ movl(scratch, hash); | 4969 __ movl(scratch, hash); |
4970 __ shrl(scratch, Immediate(6)); | 4970 __ shrl(scratch, Immediate(6)); |
4971 __ xorl(hash, scratch); | 4971 __ xorl(hash, scratch); |
4972 } | 4972 } |
(...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6233 xmm0, | 6233 xmm0, |
6234 &slow_elements); | 6234 &slow_elements); |
6235 __ ret(0); | 6235 __ ret(0); |
6236 } | 6236 } |
6237 | 6237 |
6238 #undef __ | 6238 #undef __ |
6239 | 6239 |
6240 } } // namespace v8::internal | 6240 } } // namespace v8::internal |
6241 | 6241 |
6242 #endif // V8_TARGET_ARCH_X64 | 6242 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |