Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 011529d6cdfd94f85f2029b93e93ee07333d6e19..1ad3e0cb4834467a9743312d59993cc91d980880 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -2457,7 +2457,11 @@ class HConstant: public HTemplateInstruction<0> { |
virtual intptr_t Hashcode() { |
ASSERT(!HEAP->allow_allocation(false)); |
- return reinterpret_cast<intptr_t>(*handle()); |
+ intptr_t hash = reinterpret_cast<intptr_t>(*handle()); |
+ // Prevent smis from having fewer hash values when truncated to |
+ // the least significant bits. |
+ const int kShiftSize = kSmiShiftSize + kSmiTagSize; |
+ return hash ^ (hash >> kShiftSize); |
} |
#ifdef DEBUG |