Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index acff18596712c4cd746c2ed6a0bab772c0fbf0f9..521b10f9f94a6b34b0384f0840d53195c6700097 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -548,16 +548,10 @@ void MacroAssembler::IndexFromHash(Register hash, Register index) { |
// reserved for it does not conflict. |
ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < |
(1 << String::kArrayIndexValueBits)); |
- // We want the smi-tagged index in key. Even if we subsequently go to |
- // the slow case, converting the key to a smi is always valid. |
- // key: string key |
- // hash: key's hash field, including its array index value. |
- andp(hash, Immediate(String::kArrayIndexValueMask)); |
- shrp(hash, Immediate(String::kHashShift)); |
- // Here we actually clobber the key which will be used if calling into |
- // runtime later. However as the new key is the numeric value of a string key |
- // there is no difference in using either key. |
- Integer32ToSmi(index, hash); |
+ if (!hash.is(index)) { |
+ movl(index, hash); |
+ } |
+ DecodeFieldToSmi<String::ArrayIndexValueBits>(index); |
} |