| Index: src/x64/codegen-x64.cc
|
| ===================================================================
|
| --- src/x64/codegen-x64.cc (revision 6183)
|
| +++ src/x64/codegen-x64.cc (working copy)
|
| @@ -262,14 +262,16 @@
|
| Result context = allocator_->Allocate();
|
| ASSERT(context.is_valid());
|
| __ movq(SlotOperand(slot, context.reg()), value.reg());
|
| -#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| int offset = FixedArray::kHeaderSize + slot->index() * kPointerSize;
|
| Result scratch = allocator_->Allocate();
|
| ASSERT(scratch.is_valid());
|
| frame_->Spill(context.reg());
|
| frame_->Spill(value.reg());
|
| - __ RecordWrite(context.reg(), offset, value.reg(), scratch.reg());
|
| -#endif
|
| + __ RecordWrite(context.reg(),
|
| + offset,
|
| + value.reg(),
|
| + scratch.reg(),
|
| + kDontSaveFPRegs);
|
| }
|
| }
|
| }
|
| @@ -4655,7 +4657,6 @@
|
| Result start = allocator_->Allocate();
|
| ASSERT(start.is_valid());
|
| __ movq(SlotOperand(slot, start.reg()), value.reg());
|
| -#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| // RecordWrite may destroy the value registers.
|
| //
|
| // TODO(204): Avoid actually spilling when the value is not
|
| @@ -4664,8 +4665,11 @@
|
| int offset = FixedArray::kHeaderSize + slot->index() * kPointerSize;
|
| Result temp = allocator_->Allocate();
|
| ASSERT(temp.is_valid());
|
| - __ RecordWrite(start.reg(), offset, value.reg(), temp.reg());
|
| -#endif
|
| + __ RecordWrite(start.reg(),
|
| + offset,
|
| + value.reg(),
|
| + temp.reg(),
|
| + kDontSaveFPRegs);
|
| // The results start, value, and temp are unused by going out of
|
| // scope.
|
| }
|
| @@ -5016,11 +5020,13 @@
|
|
|
| // Update the write barrier for the array address.
|
| frame_->Spill(prop_value.reg()); // Overwritten by the write barrier.
|
| -#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| Result scratch = allocator_->Allocate();
|
| ASSERT(scratch.is_valid());
|
| - __ RecordWrite(elements.reg(), offset, prop_value.reg(), scratch.reg());
|
| -#endif
|
| + __ RecordWrite(elements.reg(),
|
| + offset,
|
| + prop_value.reg(),
|
| + scratch.reg(),
|
| + kDontSaveFPRegs);
|
| }
|
| }
|
|
|
| @@ -6348,10 +6354,11 @@
|
| // The object register is also overwritten by the write barrier and
|
| // possibly aliased in the frame.
|
| frame_->Spill(object.reg());
|
| -#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| - __ RecordWrite(object.reg(), JSValue::kValueOffset, duplicate_value.reg(),
|
| - scratch.reg());
|
| -#endif
|
| + __ RecordWrite(object.reg(),
|
| + JSValue::kValueOffset,
|
| + duplicate_value.reg(),
|
| + scratch.reg(),
|
| + kDontSaveFPRegs);
|
| object.Unuse();
|
| scratch.Unuse();
|
| duplicate_value.Unuse();
|
| @@ -6632,9 +6639,7 @@
|
| FieldOperand(rcx, JSFunctionResultCache::kFingerOffset), r9);
|
| // Store key.
|
| __ movq(ArrayElement(rcx, r9), rbx);
|
| -#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| - __ RecordWrite(rcx, 0, rbx, r9);
|
| -#endif
|
| + __ RecordWrite(rcx, 0, rbx, r9, kDontSaveFPRegs);
|
|
|
| // Store value.
|
| __ pop(rcx); // restore the cache.
|
| @@ -6644,9 +6649,7 @@
|
| // Backup rax, because the RecordWrite macro clobbers its arguments.
|
| __ movq(rbx, rax);
|
| __ movq(ArrayElement(rcx, rdx), rax);
|
| -#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| - __ RecordWrite(rcx, 0, rbx, rdx);
|
| -#endif
|
| + __ RecordWrite(rcx, 0, rbx, rdx, kDontSaveFPRegs);
|
|
|
| if (!dst_.is(rax)) {
|
| __ movq(dst_, rax);
|
| @@ -6819,17 +6822,15 @@
|
| __ movq(Operand(index2.reg(), 0), object.reg());
|
| __ movq(Operand(index1.reg(), 0), tmp2.reg());
|
|
|
| -#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| Label done;
|
| __ InNewSpace(tmp1.reg(), tmp2.reg(), equal, &done);
|
| // Possible optimization: do a check that both values are Smis
|
| // (or them and test against Smi mask.)
|
|
|
| __ movq(tmp2.reg(), tmp1.reg());
|
| - __ RecordWriteHelper(tmp1.reg(), index1.reg(), object.reg());
|
| - __ RecordWriteHelper(tmp2.reg(), index2.reg(), object.reg());
|
| + __ RecordWriteHelper(tmp1.reg(), index1.reg(), object.reg(), kDontSaveFPRegs);
|
| + __ RecordWriteHelper(tmp2.reg(), index2.reg(), object.reg(), kDontSaveFPRegs);
|
| __ bind(&done);
|
| -#endif
|
|
|
| deferred->BindExit();
|
| frame_->Push(Factory::undefined_value());
|
| @@ -8324,23 +8325,20 @@
|
|
|
| // Update the write barrier. To save instructions in the inlined
|
| // version we do not filter smis.
|
| -#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| Label skip_write_barrier;
|
| __ InNewSpace(receiver.reg(), value.reg(), equal, &skip_write_barrier);
|
| int delta_to_record_write = masm_->SizeOfCodeGeneratedSince(&patch_site);
|
| __ lea(scratch.reg(), Operand(receiver.reg(), offset));
|
| - __ RecordWriteHelper(receiver.reg(), scratch.reg(), value.reg());
|
| + __ RecordWriteHelper(receiver.reg(),
|
| + scratch.reg(),
|
| + value.reg(),
|
| + kDontSaveFPRegs);
|
| if (FLAG_debug_code) {
|
| __ movq(receiver.reg(), BitCast<int64_t>(kZapValue), RelocInfo::NONE);
|
| __ movq(value.reg(), BitCast<int64_t>(kZapValue), RelocInfo::NONE);
|
| __ movq(scratch.reg(), BitCast<int64_t>(kZapValue), RelocInfo::NONE);
|
| }
|
| __ bind(&skip_write_barrier);
|
| -#else
|
| - // Use dummy delta to record write value to ensure proper
|
| - // testl encoding.
|
| - int delta_to_record_write = 0x0001;
|
| -#endif
|
| value.Unuse();
|
| scratch.Unuse();
|
| receiver.Unuse();
|
| @@ -8478,11 +8476,9 @@
|
| Result tmp2 = allocator_->Allocate();
|
| ASSERT(tmp2.is_valid());
|
|
|
| -#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| // Determine whether the value is a constant before putting it in a
|
| // register.
|
| bool value_is_constant = result.is_constant();
|
| -#endif
|
|
|
| // Make sure that value, key and receiver are in registers.
|
| result.ToRegister();
|
| @@ -8522,7 +8518,6 @@
|
| // Check whether it is possible to omit the write barrier. If the elements
|
| // array is in new space or the value written is a smi we can safely update
|
| // the elements array without write barrier.
|
| -#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
|
| Label in_new_space;
|
| __ InNewSpace(tmp.reg(), tmp2.reg(), equal, &in_new_space);
|
| if (!value_is_constant) {
|
| @@ -8530,7 +8525,6 @@
|
| }
|
|
|
| __ bind(&in_new_space);
|
| -#endif
|
|
|
| // Bind the deferred code patch site to be able to locate the fixed
|
| // array map comparison. When debugging, we patch this comparison to
|
|
|