Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index f2b195ec9843420a0e6c2011fa2ab043a3caa006..a26c596051f8b92d2e2230d13e28d3c126f7d554 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -1125,26 +1125,34 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
// modification check. Otherwise, we got a fixed array, and we have |
// to do a slow check. |
Label fixed_array; |
- __ mov(r2, r0); |
- __ ldr(r1, FieldMemOperand(r2, HeapObject::kMapOffset)); |
+ __ ldr(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); |
__ LoadRoot(ip, Heap::kMetaMapRootIndex); |
- __ cmp(r1, ip); |
+ __ cmp(r2, ip); |
__ b(ne, &fixed_array); |
// We got a map in register r0. Get the enumeration cache from it. |
+ Label no_descriptors; |
__ bind(&use_cache); |
- __ LoadInstanceDescriptors(r0, r1, r2); |
- __ ldr(r1, FieldMemOperand(r1, DescriptorArray::kEnumCacheOffset)); |
- __ ldr(r2, FieldMemOperand(r1, DescriptorArray::kEnumCacheBridgeCacheOffset)); |
+ |
+ __ EnumLength(r1, r0); |
+ __ cmp(r1, Operand(Smi::FromInt(0))); |
+ __ b(eq, &no_descriptors); |
+ |
+ __ LoadInstanceDescriptors(r0, r2, r4); |
+ __ ldr(r2, FieldMemOperand(r2, DescriptorArray::kEnumCacheOffset)); |
+ __ ldr(r2, FieldMemOperand(r2, DescriptorArray::kEnumCacheBridgeCacheOffset)); |
// Set up the four remaining stack slots. |
__ push(r0); // Map. |
- __ ldr(r1, FieldMemOperand(r2, FixedArray::kLengthOffset)); |
__ mov(r0, Operand(Smi::FromInt(0))); |
// Push enumeration cache, enumeration cache length (as smi) and zero. |
__ Push(r2, r1, r0); |
__ jmp(&loop); |
+ __ bind(&no_descriptors); |
+ __ Drop(1); |
+ __ jmp(&exit); |
+ |
// We got a fixed array in register r0. Iterate through that. |
Label non_proxy; |
__ bind(&fixed_array); |