| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 | 994 |
| 995 // Compute the hash code from the untagged key. This must be kept in sync | 995 // Compute the hash code from the untagged key. This must be kept in sync |
| 996 // with ComputeIntegerHash in utils.h. | 996 // with ComputeIntegerHash in utils.h. |
| 997 // | 997 // |
| 998 // Note: r0 will contain hash code | 998 // Note: r0 will contain hash code |
| 999 void MacroAssembler::GetNumberHash(Register r0, Register scratch) { | 999 void MacroAssembler::GetNumberHash(Register r0, Register scratch) { |
| 1000 // Xor original key with a seed. | 1000 // Xor original key with a seed. |
| 1001 if (Serializer::enabled()) { | 1001 if (Serializer::enabled()) { |
| 1002 ExternalReference roots_array_start = | 1002 ExternalReference roots_array_start = |
| 1003 ExternalReference::roots_array_start(isolate()); | 1003 ExternalReference::roots_array_start(isolate()); |
| 1004 mov(scratch, Immediate(Heap::kStringHashSeedRootIndex)); | 1004 mov(scratch, Immediate(Heap::kHashSeedRootIndex)); |
| 1005 xor_(r0, Operand::StaticArray(scratch, | 1005 xor_(r0, Operand::StaticArray(scratch, |
| 1006 times_pointer_size, | 1006 times_pointer_size, |
| 1007 roots_array_start)); | 1007 roots_array_start)); |
| 1008 } else { | 1008 } else { |
| 1009 int32_t seed = isolate()->heap()->StringHashSeed(); | 1009 int32_t seed = isolate()->heap()->HashSeed(); |
| 1010 xor_(r0, Immediate(seed)); | 1010 xor_(r0, Immediate(seed)); |
| 1011 } | 1011 } |
| 1012 | 1012 |
| 1013 // hash = ~hash + (hash << 15); | 1013 // hash = ~hash + (hash << 15); |
| 1014 mov(scratch, r0); | 1014 mov(scratch, r0); |
| 1015 not_(r0); | 1015 not_(r0); |
| 1016 shl(scratch, 15); | 1016 shl(scratch, 15); |
| 1017 add(r0, scratch); | 1017 add(r0, scratch); |
| 1018 // hash = hash ^ (hash >> 12); | 1018 // hash = hash ^ (hash >> 12); |
| 1019 mov(scratch, r0); | 1019 mov(scratch, r0); |
| (...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2738 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); | 2738 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); |
| 2739 Check(less_equal, "Live Bytes Count overflow chunk size"); | 2739 Check(less_equal, "Live Bytes Count overflow chunk size"); |
| 2740 } | 2740 } |
| 2741 | 2741 |
| 2742 bind(&done); | 2742 bind(&done); |
| 2743 } | 2743 } |
| 2744 | 2744 |
| 2745 } } // namespace v8::internal | 2745 } } // namespace v8::internal |
| 2746 | 2746 |
| 2747 #endif // V8_TARGET_ARCH_IA32 | 2747 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |