| 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 4985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4996 __ leal(hash, Operand(hash, hash, times_8, 0)); | 4996 __ leal(hash, Operand(hash, hash, times_8, 0)); |
| 4997 // hash ^= hash >> 11; | 4997 // hash ^= hash >> 11; |
| 4998 __ movl(scratch, hash); | 4998 __ movl(scratch, hash); |
| 4999 __ shrl(scratch, Immediate(11)); | 4999 __ shrl(scratch, Immediate(11)); |
| 5000 __ xorl(hash, scratch); | 5000 __ xorl(hash, scratch); |
| 5001 // hash += hash << 15; | 5001 // hash += hash << 15; |
| 5002 __ movl(scratch, hash); | 5002 __ movl(scratch, hash); |
| 5003 __ shll(scratch, Immediate(15)); | 5003 __ shll(scratch, Immediate(15)); |
| 5004 __ addl(hash, scratch); | 5004 __ addl(hash, scratch); |
| 5005 | 5005 |
| 5006 uint32_t kHashShiftCutOffMask = (1 << (32 - String::kHashShift)) - 1; | 5006 __ andl(hash, Immediate(String::kHashBitMask)); |
| 5007 __ andl(hash, Immediate(kHashShiftCutOffMask)); | |
| 5008 | 5007 |
| 5009 // if (hash == 0) hash = 27; | 5008 // if (hash == 0) hash = 27; |
| 5010 Label hash_not_zero; | 5009 Label hash_not_zero; |
| 5011 __ j(not_zero, &hash_not_zero); | 5010 __ j(not_zero, &hash_not_zero); |
| 5012 __ Set(hash, 27); | 5011 __ Set(hash, StringHasher::kZeroHash); |
| 5013 __ bind(&hash_not_zero); | 5012 __ bind(&hash_not_zero); |
| 5014 } | 5013 } |
| 5015 | 5014 |
| 5016 void SubStringStub::Generate(MacroAssembler* masm) { | 5015 void SubStringStub::Generate(MacroAssembler* masm) { |
| 5017 Label runtime; | 5016 Label runtime; |
| 5018 | 5017 |
| 5019 // Stack frame on entry. | 5018 // Stack frame on entry. |
| 5020 // rsp[0]: return address | 5019 // rsp[0]: return address |
| 5021 // rsp[8]: to | 5020 // rsp[8]: to |
| 5022 // rsp[16]: from | 5021 // rsp[16]: from |
| (...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6234 xmm0, | 6233 xmm0, |
| 6235 &slow_elements); | 6234 &slow_elements); |
| 6236 __ ret(0); | 6235 __ ret(0); |
| 6237 } | 6236 } |
| 6238 | 6237 |
| 6239 #undef __ | 6238 #undef __ |
| 6240 | 6239 |
| 6241 } } // namespace v8::internal | 6240 } } // namespace v8::internal |
| 6242 | 6241 |
| 6243 #endif // V8_TARGET_ARCH_X64 | 6242 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |