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

Unified Diff: src/x64/ic-x64.cc

Issue 5736008: Provide baseline for experimental GC implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 10 years 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
Index: src/x64/ic-x64.cc
diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc
index 200209906be85ca32c5a3f8c7a560ce8949b9884..6a5392b1667ed325aac7ba6aa76eb93c09bcebd0 100644
--- a/src/x64/ic-x64.cc
+++ b/src/x64/ic-x64.cc
@@ -269,8 +269,10 @@ static void GenerateDictionaryStore(MacroAssembler* masm,
__ movq(Operand(scratch1, 0), value);
// Update write barrier. Make sure not to clobber the value.
+#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
__ movq(scratch0, value);
__ RecordWrite(elements, scratch1, scratch0);
+#endif
}
@@ -1087,8 +1089,10 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
__ bind(&non_smi_value);
// Slow case that needs to retain rcx for use by RecordWrite.
// Update write barrier for the elements array address.
+#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
__ movq(rdx, rax);
__ RecordWriteNonSmi(rbx, 0, rdx, rcx);
+#endif
__ ret(0);
}
@@ -1759,7 +1763,9 @@ bool StoreIC::PatchInlinedStore(Address address, Object* map, int offset) {
Address encoded_offsets_address = test_instruction_address + 1;
int encoded_offsets = *reinterpret_cast<int*>(encoded_offsets_address);
int delta_to_map_check = -(encoded_offsets & 0xFFFF);
+#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
int delta_to_record_write = encoded_offsets >> 16;
+#endif
// Patch the map to check. The map address is the last 8 bytes of
// the 10-byte immediate move instruction.
@@ -1778,6 +1784,7 @@ bool StoreIC::PatchInlinedStore(Address address, Object* map, int offset) {
(offset == 0 && map == Heap::null_value()));
*reinterpret_cast<int*>(offset_address) = offset - kHeapObjectTag;
+#ifdef ENABLE_CARDMARKING_WRITE_BARRIER
// Patch the offset in the write-barrier code. The offset is the
// last 4 bytes of a 7 byte lea instruction.
offset_address = map_check_address + delta_to_record_write + 3;
@@ -1787,6 +1794,7 @@ bool StoreIC::PatchInlinedStore(Address address, Object* map, int offset) {
*reinterpret_cast<int*>(offset_address) == -1 ||
(offset == 0 && map == Heap::null_value()));
*reinterpret_cast<int*>(offset_address) = offset - kHeapObjectTag;
+#endif
return true;
}
« src/globals.h ('K') | « src/x64/full-codegen-x64.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698