Index: src/x64/codegen-x64.cc |
=================================================================== |
--- src/x64/codegen-x64.cc (revision 5357) |
+++ src/x64/codegen-x64.cc (working copy) |
@@ -7223,6 +7223,34 @@ |
} |
+void CodeGenerator::GenerateHasCachedArrayIndex(ZoneList<Expression*>* args) { |
+ ASSERT(args->length() == 1); |
+ Load(args->at(0)); |
+ Result value = frame_->Pop(); |
+ value.ToRegister(); |
+ ASSERT(value.is_valid()); |
+ __ testl(FieldOperand(value.reg(), String::kHashFieldOffset), |
+ Immediate(String::kContainsCachedArrayIndexMask)); |
+ value.Unuse(); |
+ destination()->Split(zero); |
+} |
+ |
+ |
+void CodeGenerator::GenerateGetCachedArrayIndex(ZoneList<Expression*>* args) { |
+ ASSERT(args->length() == 1); |
+ Load(args->at(0)); |
+ Result string = frame_->Pop(); |
+ string.ToRegister(); |
+ |
+ Result number = allocator()->Allocate(); |
+ ASSERT(number.is_valid()); |
+ __ movl(number.reg(), FieldOperand(string.reg(), String::kHashFieldOffset)); |
+ __ IndexFromHash(number.reg(), number.reg()); |
+ string.Unuse(); |
+ frame_->Push(&number); |
+} |
+ |
+ |
void CodeGenerator::VisitCallRuntime(CallRuntime* node) { |
if (CheckForInlineRuntimeCall(node)) { |
return; |