Revision: 3593
Author: [email protected]
Date: Wed Jan 13 02:27:54 2010
Log: 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
http://code.google.com/p/v8/source/detail?r=3593

Modified:
 /branches/bleeding_edge/src/arm/codegen-arm.cc

=======================================
--- /branches/bleeding_edge/src/arm/codegen-arm.cc      Wed Jan 13 00:16:02 2010
+++ /branches/bleeding_edge/src/arm/codegen-arm.cc      Wed Jan 13 02:27:54 2010
@@ -4455,9 +4455,6 @@
   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 @@
                         &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 @@
     __ 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.
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to