From: verwaest@chromium.org Date: Tue, 31 Jul 2012 12:33:28 +0000 (+0000) Subject: Use architecture-specific alignment for hashing in Descriptor lookup cache. X-Git-Tag: upstream/4.7.83~16208 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec2b5ab57c0c2961138e3c491b166676ce26470c;p=platform%2Fupstream%2Fv8.git 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 --- 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; }