Commit ec2b5ab5 authored by verwaest@chromium.org's avatar verwaest@chromium.org

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
parent bf0322a8
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment