Commit 4ed9eb18 authored by ager@chromium.org's avatar ager@chromium.org

Fix bug in the ARM port of FastNewContextStub. Load the function from

the stack instead of popping it - it is needed by the slow case.

Review URL: http://codereview.chromium.org/546031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3593 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent bac8b21f
......@@ -4455,9 +4455,6 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
Label gc;
int length = slots_ + Context::MIN_CONTEXT_SLOTS;
// Pop the function from the stack.
__ pop(r3);
// Attempt to allocate the context in new space.
__ AllocateInNewSpace(length + (FixedArray::kHeaderSize / kPointerSize),
r0,
......@@ -4466,6 +4463,9 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
&gc,
TAG_OBJECT);
// Load the function from the stack.
__ ldr(r3, MemOperand(sp, 0 * kPointerSize));
// Setup the object header.
__ LoadRoot(r2, Heap::kContextMapRootIndex);
__ str(r2, FieldMemOperand(r0, HeapObject::kMapOffset));
......@@ -4489,8 +4489,9 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
__ str(r1, MemOperand(r0, Context::SlotOffset(i)));
}
// Return. The on-stack parameter has already been popped.
// Remove the on-stack argument and return.
__ mov(cp, r0);
__ pop();
__ Ret();
// Need to collect. Call into runtime system.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment