Reviewers: Michael Starzinger,
Description:
Remove write barriers for cells on x64, ARM and MIPS.
Please review this at http://codereview.chromium.org/8834005/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M src/arm/lithium-codegen-arm.cc
M src/arm/stub-cache-arm.cc
M src/mips/lithium-codegen-mips.cc
M src/mips/stub-cache-mips.cc
M src/x64/lithium-codegen-x64.cc
M src/x64/stub-cache-x64.cc
Index: src/arm/lithium-codegen-arm.cc
===================================================================
--- src/arm/lithium-codegen-arm.cc (revision 10185)
+++ src/arm/lithium-codegen-arm.cc (working copy)
@@ -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.
}
Index: src/arm/stub-cache-arm.cc
===================================================================
--- src/arm/stub-cache-arm.cc (revision 10185)
+++ src/arm/stub-cache-arm.cc (working copy)
@@ -2587,16 +2587,8 @@
// Store the value in the cell.
__ str(r0, FieldMemOperand(r4, JSGlobalPropertyCell::kValueOffset));
+ // Cells are always rescanned, so no write barrier here.
- __ mov(r1, r0);
- __ RecordWriteField(r4,
- JSGlobalPropertyCell::kValueOffset,
- r1,
- r2,
- kLRHasNotBeenSaved,
- kDontSaveFPRegs,
- OMIT_REMEMBERED_SET);
-
Counters* counters = masm()->isolate()->counters();
__ IncrementCounter(counters->named_store_global_inline(), 1, r4, r3);
__ Ret();
Index: src/mips/lithium-codegen-mips.cc
===================================================================
--- src/mips/lithium-codegen-mips.cc (revision 10185)
+++ src/mips/lithium-codegen-mips.cc (working copy)
@@ -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.
}
Index: src/mips/stub-cache-mips.cc
===================================================================
--- src/mips/stub-cache-mips.cc (revision 10185)
+++ src/mips/stub-cache-mips.cc (working copy)
@@ -2605,16 +2605,8 @@
// Store the value in the cell.
__ sw(a0, FieldMemOperand(t0, JSGlobalPropertyCell::kValueOffset));
__ mov(v0, a0); // Stored value must be returned in v0.
+ // Cells are always rescanned, so no write barrier here.
- // This trashes a0 but the value is returned in v0 anyway.
- __ RecordWriteField(t0,
- JSGlobalPropertyCell::kValueOffset,
- a0,
- a2,
- kRAHasNotBeenSaved,
- kDontSaveFPRegs,
- OMIT_REMEMBERED_SET);
-
Counters* counters = masm()->isolate()->counters();
__ IncrementCounter(counters->named_store_global_inline(), 1, a1, a3);
__ Ret();
Index: src/x64/lithium-codegen-x64.cc
===================================================================
--- src/x64/lithium-codegen-x64.cc (revision 10185)
+++ src/x64/lithium-codegen-x64.cc (working copy)
@@ -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.
}
Index: src/x64/stub-cache-x64.cc
===================================================================
--- src/x64/stub-cache-x64.cc (revision 10185)
+++ src/x64/stub-cache-x64.cc (working copy)
@@ -2370,23 +2370,9 @@
// Store the value in the cell.
__ movq(cell_operand, rax);
- Label done;
- __ JumpIfSmi(rax, &done);
+ // Cells are always rescanned, so no write barrier here.
- __ 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);
-
-
// 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