diff options
author | Ryan <ry@tinyclouds.org> | 2009-07-20 13:18:42 +0200 |
---|---|---|
committer | Ryan <ry@tinyclouds.org> | 2009-07-20 13:18:42 +0200 |
commit | 88e9a5f122822b96e0ccfbba2083fe6ef43f3fdc (patch) | |
tree | 3cad417de864555fd27d573af866f2a1b3c352ad /deps/v8/src/spaces-inl.h | |
parent | f4dfbe37a3f1fef2c91068958dfe1888ba100332 (diff) | |
download | node-new-88e9a5f122822b96e0ccfbba2083fe6ef43f3fdc.tar.gz |
Upgrade V8 to 1.2.14
Diffstat (limited to 'deps/v8/src/spaces-inl.h')
-rw-r--r-- | deps/v8/src/spaces-inl.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/deps/v8/src/spaces-inl.h b/deps/v8/src/spaces-inl.h index 2f01164f89..8b2eab0c45 100644 --- a/deps/v8/src/spaces-inl.h +++ b/deps/v8/src/spaces-inl.h @@ -93,17 +93,21 @@ Address Page::AllocationTop() { void Page::ClearRSet() { -#ifndef V8_HOST_ARCH_64_BIT // This method can be called in all rset states. memset(RSetStart(), 0, kRSetEndOffset - kRSetStartOffset); -#endif } -// Give an address a (32-bits): +// Given a 32-bit address, separate its bits into: // | page address | words (6) | bit offset (5) | pointer alignment (2) | -// The rset address is computed as: +// The address of the rset word containing the bit for this word is computed as: // page_address + words * 4 +// For a 64-bit address, if it is: +// | page address | quadwords(5) | bit offset(5) | pointer alignment (3) | +// The address of the rset word containing the bit for this word is computed as: +// page_address + quadwords * 4 + kRSetOffset. +// The rset is accessed as 32-bit words, and bit offsets in a 32-bit word, +// even on the X64 architecture. Address Page::ComputeRSetBitPosition(Address address, int offset, uint32_t* bitmask) { @@ -115,7 +119,7 @@ Address Page::ComputeRSetBitPosition(Address address, int offset, *bitmask = 1 << (bit_offset % kBitsPerInt); Address rset_address = - page->address() + (bit_offset / kBitsPerInt) * kIntSize; + page->address() + kRSetOffset + (bit_offset / kBitsPerInt) * kIntSize; // The remembered set address is either in the normal remembered set range // of a page or else we have a large object page. ASSERT((page->RSetStart() <= rset_address && rset_address < page->RSetEnd()) @@ -131,8 +135,10 @@ Address Page::ComputeRSetBitPosition(Address address, int offset, // 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 ASSERT(HeapObject::FromAddress(address)->IsFixedArray()); - rset_address += + rset_address += kObjectStartOffset - kRSetEndOffset + FixedArray::SizeFor(Memory::int_at(page->ObjectAreaStart() + Array::kLengthOffset)); } @@ -160,14 +166,9 @@ void Page::UnsetRSet(Address address, int offset) { bool Page::IsRSetSet(Address address, int offset) { -#ifdef V8_HOST_ARCH_64_BIT - // TODO(X64): Reenable when RSet works. - return true; -#else // V8_HOST_ARCH_64_BIT uint32_t bitmask = 0; Address rset_address = ComputeRSetBitPosition(address, offset, &bitmask); return (Memory::uint32_at(rset_address) & bitmask) != 0; -#endif // V8_HOST_ARCH_64_BIT } |