Revision: 10188
Author:   [email protected]
Date:     Wed Dec  7 00:49:06 2011
Log:      Remove write barriers for cells on x64, ARM and MIPS.
Review URL: http://codereview.chromium.org/8834005
http://code.google.com/p/v8/source/detail?r=10188

Modified:
 /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc
 /branches/bleeding_edge/src/arm/stub-cache-arm.cc
 /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc
 /branches/bleeding_edge/src/mips/stub-cache-mips.cc
 /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc
 /branches/bleeding_edge/src/x64/stub-cache-x64.cc

=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Tue Dec 6 04:11:08 2011 +++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Wed Dec 7 00:49:06 2011
@@ -2283,21 +2283,7 @@

   // Store the value.
__ str(value, FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset));
-
-  // Cells are always in the remembered set.
-  if (instr->hydrogen()->NeedsWriteBarrier()) {
-    HType type = instr->hydrogen()->value()->type();
-    SmiCheck check_needed =
-        type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
-    __ RecordWriteField(scratch,
-                        JSGlobalPropertyCell::kValueOffset,
-                        value,
-                        scratch2,
-                        kLRHasBeenSaved,
-                        kSaveFPRegs,
-                        OMIT_REMEMBERED_SET,
-                        check_needed);
-  }
+  // Cells are always rescanned, so no write barrier here.
 }


=======================================
--- /branches/bleeding_edge/src/arm/stub-cache-arm.cc Tue Dec 6 04:11:08 2011 +++ /branches/bleeding_edge/src/arm/stub-cache-arm.cc Wed Dec 7 00:49:06 2011
@@ -2587,15 +2587,7 @@

   // Store the value in the cell.
   __ str(r0, FieldMemOperand(r4, JSGlobalPropertyCell::kValueOffset));
-
-  __ mov(r1, r0);
-  __ RecordWriteField(r4,
-                      JSGlobalPropertyCell::kValueOffset,
-                      r1,
-                      r2,
-                      kLRHasNotBeenSaved,
-                      kDontSaveFPRegs,
-                      OMIT_REMEMBERED_SET);
+  // Cells are always rescanned, so no write barrier here.

   Counters* counters = masm()->isolate()->counters();
   __ IncrementCounter(counters->named_store_global_inline(), 1, r4, r3);
=======================================
--- /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Thu Dec 1 06:32:26 2011 +++ /branches/bleeding_edge/src/mips/lithium-codegen-mips.cc Wed Dec 7 00:49:06 2011
@@ -2141,21 +2141,7 @@

   // Store the value.
__ sw(value, FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset));
-
-  // Cells are always in the remembered set.
-  if (instr->hydrogen()->NeedsWriteBarrier()) {
-    HType type = instr->hydrogen()->value()->type();
-    SmiCheck check_needed =
-        type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK;
-    __ RecordWriteField(scratch,
-                        JSGlobalPropertyCell::kValueOffset,
-                        value,
-                        scratch2,
-                        kRAHasBeenSaved,
-                        kSaveFPRegs,
-                        OMIT_REMEMBERED_SET,
-                        check_needed);
-  }
+  // Cells are always rescanned, so no write barrier here.
 }


=======================================
--- /branches/bleeding_edge/src/mips/stub-cache-mips.cc Thu Nov 24 07:17:04 2011 +++ /branches/bleeding_edge/src/mips/stub-cache-mips.cc Wed Dec 7 00:49:06 2011
@@ -2605,15 +2605,7 @@
   // Store the value in the cell.
   __ sw(a0, FieldMemOperand(t0, JSGlobalPropertyCell::kValueOffset));
   __ mov(v0, a0);  // Stored value must be returned in v0.
-
-  // This trashes a0 but the value is returned in v0 anyway.
-  __ RecordWriteField(t0,
-                      JSGlobalPropertyCell::kValueOffset,
-                      a0,
-                      a2,
-                      kRAHasNotBeenSaved,
-                      kDontSaveFPRegs,
-                      OMIT_REMEMBERED_SET);
+  // Cells are always rescanned, so no write barrier here.

   Counters* counters = masm()->isolate()->counters();
   __ IncrementCounter(counters->named_store_global_inline(), 1, a1, a3);
=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Wed Dec 7 00:34:27 2011 +++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Wed Dec 7 00:49:06 2011
@@ -2047,25 +2047,7 @@

   // Store the value.
   __ movq(Operand(address, 0), value);
-
-  if (instr->hydrogen()->NeedsWriteBarrier()) {
-    Label smi_store;
-    HType type = instr->hydrogen()->value()->type();
- if (!type.IsHeapNumber() && !type.IsString() && !type.IsNonPrimitive()) {
-      __ JumpIfSmi(value, &smi_store, Label::kNear);
-    }
-
-    int offset = JSGlobalPropertyCell::kValueOffset - kHeapObjectTag;
-    __ lea(object, Operand(address, -offset));
-    // Cells are always in the remembered set.
-    __ RecordWrite(object,
-                   address,
-                   value,
-                   kSaveFPRegs,
-                   OMIT_REMEMBERED_SET,
-                   OMIT_SMI_CHECK);
-    __ bind(&smi_store);
-  }
+  // Cells are always rescanned, so no write barrier here.
 }


=======================================
--- /branches/bleeding_edge/src/x64/stub-cache-x64.cc Tue Dec 6 04:11:08 2011 +++ /branches/bleeding_edge/src/x64/stub-cache-x64.cc Wed Dec 7 00:49:06 2011
@@ -2370,23 +2370,9 @@

   // Store the value in the cell.
   __ movq(cell_operand, rax);
-  Label done;
-  __ JumpIfSmi(rax, &done);
-
-  __ movq(rcx, rax);
-  __ lea(rdx, cell_operand);
-  // Cells are always in the remembered set.
-  __ RecordWrite(rbx,  // Object.
-                 rdx,  // Address.
-                 rcx,  // Value.
-                 kDontSaveFPRegs,
-                 OMIT_REMEMBERED_SET,
-                 OMIT_SMI_CHECK);
-
+  // Cells are always rescanned, so no write barrier here.

   // Return the value (register rax).
-  __ bind(&done);
-
   Counters* counters = isolate()->counters();
   __ IncrementCounter(counters->named_store_global_inline(), 1);
   __ ret(0);

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

Reply via email to