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

Unified Diff: src/spaces-inl.h

Issue 162001: Fix bug in X64 RSet code. Optimize IA32 version. (Closed)
Patch Set: Created 11 years, 4 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
Index: src/spaces-inl.h
diff --git a/src/spaces-inl.h b/src/spaces-inl.h
index 0b4315c93be13c244fc882b30392b6cac943d494..5e1d424f3ba0b148fd45d2d183b783c105745d4a 100644
--- a/src/spaces-inl.h
+++ b/src/spaces-inl.h
@@ -127,20 +127,19 @@ Address Page::ComputeRSetBitPosition(Address address, int offset,
if (rset_address >= page->RSetEnd()) {
// We have a large object page, and the remembered set address is actually
- // past the end of the object. The address of the remembered set in this
- // case is the extra remembered set start address at the address of the
- // end of the object:
+ // past the end of the object.
+
William Hesse 2009/08/05 10:17:50 Rather than saying "FixedArray" everywhere in comm
+ // The first part of the remembered set is still located at the start of
+ // the page, but anything after kRSetEndOffset must be relocated to after
+ // the FixedArray, i.e. after
// (page->ObjectAreaStart() + object size)
- // plus the offset of the computed remembered set address from the start
- // of the object:
- // (rset_address - page->ObjectAreaStart()).
- // Ie, we can just add the object size.
- // In the X64 architecture, the remembered set ends before the object start,
- // so we need to add an additional offset, from rset end to object start
+ // We do that by adding the difference between the normal RSet's end and
+ // the object's end.
ASSERT(HeapObject::FromAddress(address)->IsFixedArray());
- rset_address += kObjectStartOffset - kRSetEndOffset +
+ int fixedarray_length =
FixedArray::SizeFor(Memory::int_at(page->ObjectAreaStart()
+ Array::kLengthOffset));
+ rset_address += kObjectStartOffset - kRSetEndOffset + fixedarray_length;
}
return rset_address;
}

Powered by Google App Engine
This is Rietveld 408576698