Index: src/x64/lithium-codegen-x64.cc |
=================================================================== |
--- src/x64/lithium-codegen-x64.cc (revision 7028) |
+++ src/x64/lithium-codegen-x64.cc (working copy) |
@@ -1631,6 +1631,20 @@ |
} |
+void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { |
+ Register input = ToRegister(instr->InputAt(0)); |
+ Register result = ToRegister(instr->result()); |
+ |
+ if (FLAG_debug_code) { |
+ __ AbortIfNotString(input); |
+ } |
+ |
+ __ movl(result, FieldOperand(input, String::kHashFieldOffset)); |
+ ASSERT(String::kHashShift >= kSmiTagSize); |
+ __ IndexFromHash(result, result); |
+} |
+ |
+ |
void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) { |
Register input = ToRegister(instr->InputAt(0)); |
Register result = ToRegister(instr->result()); |
@@ -1640,7 +1654,7 @@ |
__ testl(FieldOperand(input, String::kHashFieldOffset), |
Immediate(String::kContainsCachedArrayIndexMask)); |
NearLabel done; |
- __ j(not_zero, &done); |
+ __ j(zero, &done); |
__ LoadRoot(result, Heap::kFalseValueRootIndex); |
__ bind(&done); |
} |
@@ -1655,7 +1669,7 @@ |
__ testl(FieldOperand(input, String::kHashFieldOffset), |
Immediate(String::kContainsCachedArrayIndexMask)); |
- EmitBranch(true_block, false_block, not_equal); |
+ EmitBranch(true_block, false_block, equal); |
} |