| Index: src/x64/full-codegen-x64.cc
|
| diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
|
| index 34663acb280f31a28aadc8935bd95d2d9af82cab..fab0dec2acfffc2d0456cd9f2d4cfe483cd839c3 100644
|
| --- a/src/x64/full-codegen-x64.cc
|
| +++ b/src/x64/full-codegen-x64.cc
|
| @@ -116,11 +116,13 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
|
| // Store it in the context.
|
| int context_offset = Context::SlotOffset(slot->index());
|
| __ movq(Operand(rsi, context_offset), rax);
|
| +#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| // Update the write barrier. This clobbers all involved
|
| // registers, so we have use a third register to avoid
|
| // clobbering rsi.
|
| __ movq(rcx, rsi);
|
| __ RecordWrite(rcx, context_offset, rax, rbx);
|
| +#endif
|
| }
|
| }
|
| }
|
| @@ -538,11 +540,13 @@ void FullCodeGenerator::Move(Slot* dst,
|
| ASSERT(!scratch1.is(src) && !scratch2.is(src));
|
| MemOperand location = EmitSlotSearch(dst, scratch1);
|
| __ movq(location, src);
|
| +#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| // Emit the write barrier code if the location is in the heap.
|
| if (dst->type() == Slot::CONTEXT) {
|
| int offset = FixedArray::kHeaderSize + dst->index() * kPointerSize;
|
| __ RecordWrite(scratch1, offset, src, scratch2);
|
| }
|
| +#endif
|
| }
|
|
|
|
|
| @@ -593,9 +597,11 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable,
|
| } else if (function != NULL) {
|
| VisitForAccumulatorValue(function);
|
| __ movq(ContextOperand(rsi, slot->index()), result_register());
|
| +#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| int offset = Context::SlotOffset(slot->index());
|
| __ movq(rbx, rsi);
|
| __ RecordWrite(rbx, offset, result_register(), rcx);
|
| +#endif
|
| }
|
| break;
|
|
|
| @@ -1304,8 +1310,10 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| int offset = FixedArray::kHeaderSize + (i * kPointerSize);
|
| __ movq(FieldOperand(rbx, offset), result_register());
|
|
|
| +#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| // Update the write barrier for the array store.
|
| __ RecordWrite(rbx, offset, result_register(), rcx);
|
| +#endif
|
| }
|
|
|
| if (result_saved) {
|
| @@ -1621,11 +1629,14 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
|
| }
|
| // Perform the assignment and issue the write barrier.
|
| __ movq(target, rax);
|
| +
|
| +#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| // The value of the assignment is in rax. RecordWrite clobbers its
|
| // register arguments.
|
| __ movq(rdx, rax);
|
| int offset = FixedArray::kHeaderSize + slot->index() * kPointerSize;
|
| __ RecordWrite(rcx, offset, rdx, rbx);
|
| +#endif
|
| break;
|
| }
|
|
|
| @@ -2470,10 +2481,12 @@ void FullCodeGenerator::EmitSetValueOf(ZoneList<Expression*>* args) {
|
|
|
| // Store the value.
|
| __ movq(FieldOperand(rbx, JSValue::kValueOffset), rax);
|
| +#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| // Update the write barrier. Save the value as it will be
|
| // overwritten by the write barrier code and is needed afterward.
|
| __ movq(rdx, rax);
|
| __ RecordWrite(rbx, JSValue::kValueOffset, rdx, rcx);
|
| +#endif
|
|
|
| __ bind(&done);
|
| context()->Plug(rax);
|
|
|