Index: src/heap-inl.h |
=================================================================== |
--- src/heap-inl.h (revision 4722) |
+++ src/heap-inl.h (working copy) |
@@ -184,7 +184,7 @@ |
if (new_space_.Contains(address)) return; |
ASSERT(!new_space_.FromSpaceContains(address)); |
SLOW_ASSERT(Contains(address + offset)); |
- Page::FromAddress(address)->MarkRegionDirty(address + offset); |
+ Page::SetRSet(address, offset); |
} |
@@ -195,7 +195,7 @@ |
offset < start + len * kPointerSize; |
offset += kPointerSize) { |
SLOW_ASSERT(Contains(address + offset)); |
- Page::FromAddress(address)->MarkRegionDirty(address + offset); |
+ Page::SetRSet(address, offset); |
} |
} |
@@ -234,42 +234,15 @@ |
} |
-void Heap::CopyBlock(Address dst, Address src, int byte_size) { |
+void Heap::CopyBlock(Object** dst, Object** src, int byte_size) { |
ASSERT(IsAligned(byte_size, kPointerSize)); |
- CopyWords(reinterpret_cast<Object**>(dst), |
- reinterpret_cast<Object**>(src), |
- byte_size / kPointerSize); |
+ CopyWords(dst, src, byte_size / kPointerSize); |
} |
-void Heap::CopyBlockToOldSpaceAndUpdateRegionMarks(Address dst, |
- Address src, |
- int byte_size) { |
+void Heap::MoveBlock(Object** dst, Object** src, int byte_size) { |
ASSERT(IsAligned(byte_size, kPointerSize)); |
- Page* page = Page::FromAddress(dst); |
- uint32_t marks = page->GetRegionMarks(); |
- |
- for (int remaining = byte_size / kPointerSize; |
- remaining > 0; |
- remaining--) { |
- Memory::Object_at(dst) = Memory::Object_at(src); |
- |
- if (Heap::InNewSpace(Memory::Object_at(dst))) { |
- marks |= page->GetRegionMaskForAddress(dst); |
- } |
- |
- dst += kPointerSize; |
- src += kPointerSize; |
- } |
- |
- page->SetRegionMarks(marks); |
-} |
- |
- |
-void Heap::MoveBlock(Address dst, Address src, int byte_size) { |
- ASSERT(IsAligned(byte_size, kPointerSize)); |
- |
int size_in_words = byte_size / kPointerSize; |
if ((dst < src) || (dst >= (src + size_in_words))) { |
@@ -277,12 +250,10 @@ |
((OffsetFrom(reinterpret_cast<Address>(src)) - |
OffsetFrom(reinterpret_cast<Address>(dst))) >= kPointerSize)); |
- Object** src_slot = reinterpret_cast<Object**>(src); |
- Object** dst_slot = reinterpret_cast<Object**>(dst); |
- Object** end_slot = src_slot + size_in_words; |
+ Object** end = src + size_in_words; |
- while (src_slot != end_slot) { |
- *dst_slot++ = *src_slot++; |
+ while (src != end) { |
+ *dst++ = *src++; |
} |
} else { |
memmove(dst, src, byte_size); |
@@ -290,17 +261,6 @@ |
} |
-void Heap::MoveBlockToOldSpaceAndUpdateRegionMarks(Address dst, |
- Address src, |
- int byte_size) { |
- ASSERT(IsAligned(byte_size, kPointerSize)); |
- ASSERT((dst >= (src + byte_size)) || |
- ((OffsetFrom(src) - OffsetFrom(dst)) >= kPointerSize)); |
- |
- CopyBlockToOldSpaceAndUpdateRegionMarks(dst, src, byte_size); |
-} |
- |
- |
void Heap::ScavengeObject(HeapObject** p, HeapObject* object) { |
ASSERT(InFromSpace(object)); |