Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Unified Diff: src/ia32/codegen-ia32.cc

Issue 6092007: Write buffer based write barrier for IA32 and Crankshaft. Currently... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/codegen-ia32.cc
===================================================================
--- src/ia32/codegen-ia32.cc (revision 6183)
+++ src/ia32/codegen-ia32.cc (working copy)
@@ -265,14 +265,16 @@
Result context = allocator_->Allocate();
ASSERT(context.is_valid());
__ mov(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);
}
}
}
@@ -5311,7 +5313,6 @@
ASSERT(start.is_valid());
__ mov(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
@@ -5320,10 +5321,13 @@
int offset = FixedArray::kHeaderSize + slot->index() * kPointerSize;
Result temp = allocator_->Allocate();
ASSERT(temp.is_valid());
- __ RecordWrite(start.reg(), offset, value.reg(), temp.reg());
+ __ RecordWrite(start.reg(),
+ offset,
+ value.reg(),
+ temp.reg(),
+ kDontSaveFPRegs);
// The results start, value, and temp are unused by going out of
// scope.
-#endif
}
exit.Bind();
@@ -5710,13 +5714,15 @@
int offset = i * kPointerSize + FixedArray::kHeaderSize;
__ mov(FieldOperand(elements.reg(), offset), prop_value.reg());
-#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
// Update the write barrier for the array address.
frame_->Spill(prop_value.reg()); // Overwritten by the 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);
}
}
@@ -7246,7 +7252,6 @@
// Store the value.
__ mov(FieldOperand(object.reg(), JSValue::kValueOffset), value.reg());
-#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.
Result duplicate_value = allocator_->Allocate();
@@ -7256,9 +7261,8 @@
// possibly aliased in the frame.
frame_->Spill(object.reg());
__ RecordWrite(object.reg(), JSValue::kValueOffset, duplicate_value.reg(),
- scratch.reg());
+ scratch.reg(), kDontSaveFPRegs);
duplicate_value.Unuse();
-#endif
object.Unuse();
scratch.Unuse();
@@ -7531,9 +7535,7 @@
__ mov(FieldOperand(ecx, JSFunctionResultCache::kFingerOffset), edx);
// Store key.
__ mov(CodeGenerator::FixedArrayElementOperand(ecx, edx), ebx);
-#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
- __ RecordWrite(ecx, 0, ebx, edx);
-#endif
+ __ RecordWrite(ecx, 0, ebx, edx, kDontSaveFPRegs);
// Store value.
__ pop(ecx); // restore the cache.
@@ -7541,9 +7543,7 @@
__ add(Operand(edx), Immediate(Smi::FromInt(1)));
__ mov(ebx, eax);
__ mov(CodeGenerator::FixedArrayElementOperand(ecx, edx), ebx);
-#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
- __ RecordWrite(ecx, 0, ebx, edx);
-#endif
+ __ RecordWrite(ecx, 0, ebx, edx, kDontSaveFPRegs);
if (!dst_.is(eax)) {
__ mov(dst_, eax);
@@ -7708,17 +7708,15 @@
__ mov(Operand(index2.reg(), 0), object.reg());
__ mov(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.)
__ mov(tmp2.reg(), tmp1.reg());
- __ RecordWriteHelper(tmp2.reg(), index1.reg(), object.reg());
- __ RecordWriteHelper(tmp1.reg(), index2.reg(), object.reg());
+ __ RecordWriteHelper(tmp2.reg(), index1.reg(), object.reg(), kDontSaveFPRegs);
+ __ RecordWriteHelper(tmp1.reg(), index2.reg(), object.reg(), kDontSaveFPRegs);
__ bind(&done);
-#endif
deferred->BindExit();
frame_->Push(Factory::undefined_value());
@@ -9659,22 +9657,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) {
__ mov(receiver.reg(), Immediate(BitCast<int32_t>(kZapValue)));
__ mov(value.reg(), Immediate(BitCast<int32_t>(kZapValue)));
__ mov(scratch.reg(), Immediate(BitCast<int32_t>(kZapValue)));
}
__ bind(&skip_write_barrier);
-#else
- // Store some dummy value to avoid short encoding of test instruction.
- int delta_to_record_write = 0x0001;
-#endif
value.Unuse();
scratch.Unuse();
receiver.Unuse();
@@ -9808,11 +9804,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();
@@ -9852,7 +9846,6 @@
__ mov(tmp.reg(),
FieldOperand(receiver.reg(), JSArray::kElementsOffset));
-#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
// 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.
@@ -9865,7 +9858,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
// always fail so that we will hit the IC call in the deferred code
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698