Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(835)

Side by Side Diff: src/ia32/macro-assembler-ia32.cc

Issue 9148006: [objects] seed NumberDictionary (only ia32 now) Base URL: gh:v8/v8@master
Patch Set: [objects] remove nameless argument, use BaseShape Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/objects.h » ('j') | src/objects-inl.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 // r0 - holds the untagged key on entry and holds the hash once computed. 977 // r0 - holds the untagged key on entry and holds the hash once computed.
978 // 978 //
979 // r1 - used to hold the capacity mask of the dictionary 979 // r1 - used to hold the capacity mask of the dictionary
980 // 980 //
981 // r2 - used for the index into the dictionary. 981 // r2 - used for the index into the dictionary.
982 // 982 //
983 // result - holds the result on exit if the load succeeds and we fall through. 983 // result - holds the result on exit if the load succeeds and we fall through.
984 984
985 Label done; 985 Label done;
986 986
987 // First of all lets assign to r1 value of HashSeed
Erik Corry 2012/01/10 10:13:51 "First of all we assign the hash seed to r1."
988 if (Serializer::enabled()) {
989 ExternalReference roots_array_start =
990 ExternalReference::roots_array_start(isolate());
991 mov(r1, Immediate(Heap::kStringHashSeedRootIndex));
992 mov(r1, Operand::StaticArray(r1,
993 times_pointer_size,
994 roots_array_start));
995 } else {
996 int32_t seed = isolate()->heap()->StringHashSeed();
997 mov(r1, Operand(seed, RelocInfo::NONE));
998 }
999
1000 // Xor original key with a seed
1001 xor_(r1, r0);
1002
987 // Compute the hash code from the untagged key. This must be kept in sync 1003 // Compute the hash code from the untagged key. This must be kept in sync
988 // with ComputeIntegerHash in utils.h. 1004 // with ComputeIntegerHash in utils.h.
989 // 1005 //
990 // hash = ~hash + (hash << 15); 1006 // hash = ~hash + (hash << 15);
991 mov(r1, r0);
992 not_(r0); 1007 not_(r0);
Erik Corry 2012/01/10 10:13:51 The intention is that the original should be xored
993 shl(r1, 15); 1008 shl(r1, 15);
994 add(r0, r1); 1009 add(r0, r1);
995 // hash = hash ^ (hash >> 12); 1010 // hash = hash ^ (hash >> 12);
996 mov(r1, r0); 1011 mov(r1, r0);
997 shr(r1, 12); 1012 shr(r1, 12);
998 xor_(r0, r1); 1013 xor_(r0, r1);
999 // hash = hash + (hash << 2); 1014 // hash = hash + (hash << 2);
1000 lea(r0, Operand(r0, r0, times_4, 0)); 1015 lea(r0, Operand(r0, r0, times_4, 0));
1001 // hash = hash ^ (hash >> 4); 1016 // hash = hash ^ (hash >> 4);
1002 mov(r1, r0); 1017 mov(r1, r0);
(...skipping 1682 matching lines...) Expand 10 before | Expand all | Expand 10 after
2685 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset)); 2700 cmp(length, Operand(bitmap_scratch, MemoryChunk::kSizeOffset));
2686 Check(less_equal, "Live Bytes Count overflow chunk size"); 2701 Check(less_equal, "Live Bytes Count overflow chunk size");
2687 } 2702 }
2688 2703
2689 bind(&done); 2704 bind(&done);
2690 } 2705 }
2691 2706
2692 } } // namespace v8::internal 2707 } } // namespace v8::internal
2693 2708
2694 #endif // V8_TARGET_ARCH_IA32 2709 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698