Chromium Code Reviews| Index: src/spaces.h |
| =================================================================== |
| --- src/spaces.h (revision 2316) |
| +++ src/spaces.h (working copy) |
| @@ -93,13 +93,14 @@ |
| // bytes are used as remembered set, and the rest of the page is the object |
| // area. |
| // |
| -// Pointers are aligned to the pointer size (4 bytes), only 1 bit is needed |
| +// Pointers are aligned to the pointer size (4), only 1 bit is needed |
| // for a pointer in the remembered set. Given an address, its remembered set |
| // bit position (offset from the start of the page) is calculated by dividing |
| // its page offset by 32. Therefore, the object area in a page starts at the |
| // 256th byte (8K/32). Bytes 0 to 255 do not need the remembered set, so that |
| // the first two words (64 bits) in a page can be used for other purposes. |
| // TODO(X64): This description only represents the 32-bit layout. |
| +// On the 64-bit platform, we add an offset to the start of the remembered set. |
| // |
| // The mark-compact collector transforms a map pointer into a page index and a |
| // page offset. The map space can have up to 1024 pages, and 8M bytes (1024 * |
| @@ -217,16 +218,28 @@ |
| // Page size mask. |
| static const intptr_t kPageAlignmentMask = (1 << kPageSizeBits) - 1; |
| + // The offset of the remembered set in a page, in addition to the empty words |
| + // formed as the remembered bits of the remembered set itself. |
| +#ifdef V8_TARGET_ARCH_X64 |
| + static const int kRSetOffset = 2 * kPointerSize; // Room for two pointers. |
|
Lasse Reichstein
2009/07/01 12:30:18
Since we have room for it, we might want the RSet
|
| +#else |
| + static const int kRSetOffset = 0; |
| +#endif |
| // The end offset of the remembered set in a page |
| // (heaps are aligned to pointer size). |
| - static const int kRSetEndOffset= kPageSize / kBitsPerPointer; |
| + static const int kRSetEndOffset = kRSetOffset + kPageSize / kBitsPerPointer; |
| - // The start offset of the remembered set in a page. |
| - static const int kRSetStartOffset = kRSetEndOffset / kBitsPerPointer; |
| - |
| // The start offset of the object area in a page. |
| +#ifdef V8_TARGET_ARCH_X64 |
| + static const int kObjectStartOffset = 256; |
|
Lasse Reichstein
2009/07/01 12:30:18
We should be able to lower this to 160 and still w
|
| +#else |
| static const int kObjectStartOffset = kRSetEndOffset; |
| +#endif |
| + // The start offset of the remembered set in a page. |
| + static const int kRSetStartOffset = kRSetOffset + |
| + kObjectStartOffset / kBitsPerPointer; |
| + |
| // Object area size in bytes. |
| static const int kObjectAreaSize = kPageSize - kObjectStartOffset; |