Reviewers: Kevin Millikin,

Description:
Remember to update the write barrier when storing into
the context in the full compiler.

Please review this at http://codereview.chromium.org/556100

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/arm/full-codegen-arm.cc
  M     src/ia32/full-codegen-ia32.cc
  M     src/x64/full-codegen-x64.cc


Index: src/ia32/full-codegen-ia32.cc
===================================================================
--- src/ia32/full-codegen-ia32.cc       (revision 3745)
+++ src/ia32/full-codegen-ia32.cc       (working copy)
@@ -94,8 +94,10 @@
                                (num_parameters - 1 - i) * kPointerSize;
         // Load parameter from stack.
         __ mov(eax, Operand(ebp, parameter_offset));
-        // Store it in the context
-        __ mov(Operand(esi, Context::SlotOffset(slot->index())), eax);
+        // Store it in the context.
+        int context_offset = Context::SlotOffset(slot->index());
+        __ mov(Operand(esi, context_offset), eax);
+        __ RecordWrite(esi, context_offset, eax, ebx);
       }
     }
   }
@@ -111,7 +113,7 @@
     }
     // Receiver is just before the parameters on the caller's stack.
     __ lea(edx, Operand(ebp, StandardFrameConstants::kCallerSPOffset +
-                                 fun->num_parameters() * kPointerSize));
+                        fun->num_parameters() * kPointerSize));
     __ push(edx);
     __ push(Immediate(Smi::FromInt(fun->num_parameters())));
     // Arguments to ArgumentsAccessStub:
Index: src/x64/full-codegen-x64.cc
===================================================================
--- src/x64/full-codegen-x64.cc (revision 3745)
+++ src/x64/full-codegen-x64.cc (working copy)
@@ -94,8 +94,10 @@
                                (num_parameters - 1 - i) * kPointerSize;
         // Load parameter from stack.
         __ movq(rax, Operand(rbp, parameter_offset));
-        // Store it in the context
-        __ movq(Operand(rsi, Context::SlotOffset(slot->index())), rax);
+        // Store it in the context.
+        int context_offset = Context::SlotOffset(slot->index());
+        __ movq(Operand(rsi, context_offset), rax);
+        __ RecordWrite(rsi, context_offset, rax, rbx);
       }
     }
   }
Index: src/arm/full-codegen-arm.cc
===================================================================
--- src/arm/full-codegen-arm.cc (revision 3745)
+++ src/arm/full-codegen-arm.cc (working copy)
@@ -92,8 +92,11 @@
                                (num_parameters - 1 - i) * kPointerSize;
         // Load parameter from stack.
         __ ldr(r0, MemOperand(fp, parameter_offset));
-        // Store it in the context
-        __ str(r0, MemOperand(cp, Context::SlotOffset(slot->index())));
+        // Store it in the context.
+        int context_offset = Context::SlotOffset(slot->index());
+        __ mov(r1, Operand(context_offset));
+        __ str(r0, MemOperand(cp, r1));
+        __ RecordWrite(cp, r1, r0);
       }
     }
   }
@@ -110,7 +113,7 @@
     }
     // Receiver is just before the parameters on the caller's stack.
     __ add(r2, fp, Operand(StandardFrameConstants::kCallerSPOffset +
-                               fun->num_parameters() * kPointerSize));
+                           fun->num_parameters() * kPointerSize));
     __ mov(r1, Operand(Smi::FromInt(fun->num_parameters())));
     __ stm(db_w, sp, r3.bit() | r2.bit() | r1.bit());



--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to