Index: src/x64/macro-assembler-x64.cc |
=================================================================== |
--- src/x64/macro-assembler-x64.cc (revision 4975) |
+++ src/x64/macro-assembler-x64.cc (working copy) |
@@ -105,12 +105,6 @@ |
} |
-// For page containing |object| mark region covering [object+offset] dirty. |
-// object is the object being stored into, value is the object being stored. |
-// If offset is zero, then the index register contains the array index into |
-// the elements array represented a zero extended int32. Otherwise it can be |
-// used as a scratch register. |
-// All registers are clobbered by the operation. |
void MacroAssembler::RecordWrite(Register object, |
int offset, |
Register value, |
@@ -141,6 +135,35 @@ |
} |
+void MacroAssembler::RecordWrite(Register object, |
+ Register address, |
+ Register value) { |
+ // The compiled code assumes that record write doesn't change the |
+ // context register, so we check that none of the clobbered |
+ // registers are esi. |
+ ASSERT(!object.is(rsi) && !value.is(rsi) && !address.is(rsi)); |
+ |
+ // First, check if a write barrier is even needed. The tests below |
+ // catch stores of Smis and stores into young gen. |
+ Label done; |
+ JumpIfSmi(value, &done); |
+ |
+ InNewSpace(object, value, equal, &done); |
+ |
+ RecordWriteHelper(object, address, value); |
+ |
+ bind(&done); |
+ |
+ // Clobber all input registers when running with the debug-code flag |
+ // turned on to provoke errors. |
+ if (FLAG_debug_code) { |
+ movq(object, BitCast<int64_t>(kZapValue), RelocInfo::NONE); |
+ movq(address, BitCast<int64_t>(kZapValue), RelocInfo::NONE); |
+ movq(value, BitCast<int64_t>(kZapValue), RelocInfo::NONE); |
+ } |
+} |
+ |
+ |
void MacroAssembler::RecordWriteNonSmi(Register object, |
int offset, |
Register scratch, |