Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index bf7ac5fb827709e620a38f3ca4c02e274bdc14fc..a44600727579043f89852f211f7d61ef3838c3e2 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -112,10 +112,9 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) { |
void FastNewContextStub::Generate(MacroAssembler* masm) { |
// Try to allocate the context in new space. |
Label gc; |
- int length = slots_ + Context::MIN_CONTEXT_SLOTS; |
// Attempt to allocate the context in new space. |
- __ AllocateInNewSpace(FixedArray::SizeFor(length), |
+ __ AllocateInNewSpace(FixedArray::SizeFor(slots_), |
r0, |
r1, |
r2, |
@@ -128,7 +127,7 @@ void FastNewContextStub::Generate(MacroAssembler* masm) { |
// Setup the object header. |
__ LoadRoot(r2, Heap::kContextMapRootIndex); |
__ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset)); |
- __ mov(r2, Operand(Smi::FromInt(length))); |
+ __ mov(r2, Operand(Smi::FromInt(slots_))); |
__ str(r2, FieldMemOperand(r0, FixedArray::kLengthOffset)); |
// Setup the fixed slots. |
@@ -144,7 +143,7 @@ void FastNewContextStub::Generate(MacroAssembler* masm) { |
// Initialize the rest of the slots to undefined. |
__ LoadRoot(r1, Heap::kUndefinedValueRootIndex); |
- for (int i = Context::MIN_CONTEXT_SLOTS; i < length; i++) { |
+ for (int i = Context::MIN_CONTEXT_SLOTS; i < slots_; i++) { |
__ str(r1, MemOperand(r0, Context::SlotOffset(i))); |
} |