Use architecture-specific alignment for hashing in Descriptor lookup cache.
authorverwaest@chromium.org <verwaest@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 31 Jul 2012 12:33:28 +0000 (12:33 +0000)
committerverwaest@chromium.org <verwaest@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 31 Jul 2012 12:33:28 +0000 (12:33 +0000)
Review URL: https://chromiumcodereview.appspot.com/10825099

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12236 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/heap.h

index 918e25e..8d40bd9 100644 (file)
@@ -2395,9 +2395,11 @@ class DescriptorLookupCache {
   static int Hash(DescriptorArray* array, String* name) {
     // Uses only lower 32 bits if pointers are larger.
     uint32_t array_hash =
-        static_cast<uint32_t>(reinterpret_cast<uintptr_t>(array)) >> 2;
+        static_cast<uint32_t>(reinterpret_cast<uintptr_t>(array))
+            >> kPointerSizeLog2;
     uint32_t name_hash =
-        static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name)) >> 2;
+        static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name))
+            >> kPointerSizeLog2;
     return (array_hash ^ name_hash) % kLength;
   }