From ec2b5ab57c0c2961138e3c491b166676ce26470c Mon Sep 17 00:00:00 2001 From: "verwaest@chromium.org" Date: Tue, 31 Jul 2012 12:33:28 +0000 Subject: [PATCH] Use architecture-specific alignment for hashing in Descriptor lookup cache. 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/heap.h b/src/heap.h index 918e25e..8d40bd9 100644 --- a/src/heap.h +++ b/src/heap.h @@ -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(reinterpret_cast(array)) >> 2; + static_cast(reinterpret_cast(array)) + >> kPointerSizeLog2; uint32_t name_hash = - static_cast(reinterpret_cast(name)) >> 2; + static_cast(reinterpret_cast(name)) + >> kPointerSizeLog2; return (array_hash ^ name_hash) % kLength; } -- 2.7.4