Index: src/arm/codegen-arm.cc |
diff --git a/src/arm/codegen-arm.cc b/src/arm/codegen-arm.cc |
index e53563e6273dc3cdca9d416d1030c2768b914605..0a2b1b17985d494139fc0b0a5a7d1a95df49e0be 100644 |
--- a/src/arm/codegen-arm.cc |
+++ b/src/arm/codegen-arm.cc |
@@ -2314,7 +2314,6 @@ void CodeGenerator::VisitForInStatement(ForInStatement* node) { |
frame_->EmitPush(r0); // map |
frame_->EmitPush(r2); // enum cache bridge cache |
__ ldr(r0, FieldMemOperand(r2, FixedArray::kLengthOffset)); |
- __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
frame_->EmitPush(r0); |
__ mov(r0, Operand(Smi::FromInt(0))); |
frame_->EmitPush(r0); |
@@ -2327,7 +2326,6 @@ void CodeGenerator::VisitForInStatement(ForInStatement* node) { |
// Push the length of the array and the initial index onto the stack. |
__ ldr(r0, FieldMemOperand(r0, FixedArray::kLengthOffset)); |
- __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
frame_->EmitPush(r0); |
__ mov(r0, Operand(Smi::FromInt(0))); // init index |
frame_->EmitPush(r0); |
@@ -4667,7 +4665,8 @@ void CodeGenerator::GenerateRegExpConstructResult(ZoneList<Expression*>* args) { |
__ mov(r2, Operand(Factory::fixed_array_map())); |
__ str(r2, FieldMemOperand(r3, HeapObject::kMapOffset)); |
// Set FixedArray length. |
- __ str(r5, FieldMemOperand(r3, FixedArray::kLengthOffset)); |
+ __ mov(r6, Operand(r5, LSL, kSmiTagSize)); |
+ __ str(r6, FieldMemOperand(r3, FixedArray::kLengthOffset)); |
// Fill contents of fixed-array with the-hole. |
__ mov(r2, Operand(Factory::the_hole_value())); |
__ add(r3, r3, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
@@ -5869,7 +5868,7 @@ void CodeGenerator::EmitKeyedLoad() { |
// Check that key is within bounds. Use unsigned comparison to handle |
// negative keys. |
__ ldr(scratch2, FieldMemOperand(scratch1, FixedArray::kLengthOffset)); |
- __ cmp(scratch2, Operand(key, ASR, kSmiTagSize)); |
+ __ cmp(scratch2, key); |
deferred->Branch(ls); // Unsigned less equal. |
// Load and check that the result is not the hole (key is a smi). |
@@ -6170,8 +6169,8 @@ void FastNewContextStub::Generate(MacroAssembler* masm) { |
// Setup the object header. |
__ LoadRoot(r2, Heap::kContextMapRootIndex); |
__ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); |
- __ mov(r2, Operand(length)); |
- __ str(r2, FieldMemOperand(r0, Array::kLengthOffset)); |
+ __ mov(r2, Operand(Smi::FromInt(length))); |
+ __ str(r2, FieldMemOperand(r0, FixedArray::kLengthOffset)); |
// Setup the fixed slots. |
__ mov(r1, Operand(Smi::FromInt(0))); |
@@ -6802,8 +6801,8 @@ void NumberToStringStub::GenerateLookupNumberStringCache(MacroAssembler* masm, |
// Make the hash mask from the length of the number string cache. It |
// contains two elements (number and string) for each cache entry. |
__ ldr(mask, FieldMemOperand(number_string_cache, FixedArray::kLengthOffset)); |
- // Divide length by two (length is not a smi). |
- __ mov(mask, Operand(mask, ASR, 1)); |
+ // Divide length by two (length is a smi). |
+ __ mov(mask, Operand(mask, ASR, kSmiTagSize + 1)); |
__ sub(mask, mask, Operand(1)); // Make mask. |
// Calculate the entry in the number string cache. The hash value in the |
@@ -8694,9 +8693,8 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) { |
__ cmp(r1, Operand(0)); |
__ b(eq, &done); |
- // Get the parameters pointer from the stack and untag the length. |
+ // Get the parameters pointer from the stack. |
__ ldr(r2, MemOperand(sp, 1 * kPointerSize)); |
- __ mov(r1, Operand(r1, LSR, kSmiTagSize)); |
// Setup the elements pointer in the allocated arguments object and |
// initialize the header in the elements fixed array. |
@@ -8705,6 +8703,7 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) { |
__ LoadRoot(r3, Heap::kFixedArrayMapRootIndex); |
__ str(r3, FieldMemOperand(r4, FixedArray::kMapOffset)); |
__ str(r1, FieldMemOperand(r4, FixedArray::kLengthOffset)); |
+ __ mov(r1, Operand(r1, LSR, kSmiTagSize)); // Untag the length for the loop. |
// Copy the fixed array slots. |
Label loop; |
@@ -8855,7 +8854,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) { |
__ ldr(r0, |
FieldMemOperand(last_match_info_elements, FixedArray::kLengthOffset)); |
__ add(r2, r2, Operand(RegExpImpl::kLastMatchOverhead)); |
- __ cmp(r2, r0); |
+ __ cmp(r2, Operand(r0, ASR, kSmiTagSize)); |
__ b(gt, &runtime); |
// subject: Subject string |