Index: src/arm/macro-assembler-arm.cc |
=================================================================== |
--- src/arm/macro-assembler-arm.cc (revision 5357) |
+++ src/arm/macro-assembler-arm.cc (working copy) |
@@ -1337,6 +1337,21 @@ |
} |
+void MacroAssembler::IndexFromHash(Register hash, Register index) { |
+ // If the hash field contains an array index pick it out. The assert checks |
+ // that the constants for the maximum number of digits for an array index |
+ // cached in the hash field and the number of bits reserved for it does not |
+ // conflict. |
+ ASSERT(TenToThe(String::kMaxCachedArrayIndexLength) < |
+ (1 << String::kArrayIndexValueBits)); |
+ // We want the smi-tagged index in key. kArrayIndexValueMask has zeros in |
+ // the low kHashShift bits. |
+ STATIC_ASSERT(kSmiTag == 0); |
+ Ubfx(hash, hash, String::kHashShift, String::kArrayIndexValueBits); |
+ mov(index, Operand(hash, LSL, kSmiTagSize)); |
+} |
+ |
+ |
void MacroAssembler::IntegerToDoubleConversionWithVFP3(Register inReg, |
Register outHighReg, |
Register outLowReg) { |