Index: src/objects.h |
=================================================================== |
--- src/objects.h (revision 3473) |
+++ src/objects.h (working copy) |
@@ -892,15 +892,25 @@ |
static const int kOverflowBit = 1; // overflow bit |
static const int kOverflowMask = (1 << kOverflowBit); // overflow mask |
- // Forwarding pointers and map pointer encoding |
- // 31 21 20 10 9 0 |
+ // Forwarding pointers and map pointer encoding. On 32 bit all the bits are |
+ // used. |
// +-----------------+------------------+-----------------+ |
// |forwarding offset|page offset of map|page index of map| |
// +-----------------+------------------+-----------------+ |
- // 11 bits 11 bits 10 bits |
- static const int kMapPageIndexBits = 10; |
- static const int kMapPageOffsetBits = 11; |
- static const int kForwardingOffsetBits = 11; |
+ // ^ ^ ^ |
+ // | | | |
+ // | | kMapPageIndexBits |
+ // | kMapPageOffsetBits |
+ // kForwardingOffsetBits |
+ static const int kMapPageOffsetBits = kPageSizeBits - kMapAlignmentBits; |
+ static const int kForwardingOffsetBits = kPageSizeBits - kObjectAlignmentBits; |
+#ifdef V8_HOST_ARCH_64_BIT |
+ static const int kMapPageIndexBits = 16; |
+#else |
+ // Use all the 32-bits to encode on a 32-bit platform. |
+ static const int kMapPageIndexBits = |
+ 32 - (kMapPageOffsetBits + kForwardingOffsetBits); |
+#endif |
static const int kMapPageIndexShift = 0; |
static const int kMapPageOffsetShift = |
@@ -908,16 +918,12 @@ |
static const int kForwardingOffsetShift = |
kMapPageOffsetShift + kMapPageOffsetBits; |
- // 0x000003FF |
- static const uint32_t kMapPageIndexMask = |
+ // Bit masks covering the different parts the encoding. |
+ static const uintptr_t kMapPageIndexMask = |
(1 << kMapPageOffsetShift) - 1; |
- |
- // 0x001FFC00 |
- static const uint32_t kMapPageOffsetMask = |
+ static const uintptr_t kMapPageOffsetMask = |
((1 << kForwardingOffsetShift) - 1) & ~kMapPageIndexMask; |
- |
- // 0xFFE00000 |
- static const uint32_t kForwardingOffsetMask = |
+ static const uintptr_t kForwardingOffsetMask = |
~(kMapPageIndexMask | kMapPageOffsetMask); |
private: |
@@ -2838,7 +2844,6 @@ |
// [stub cache]: contains stubs compiled for this map. |
DECL_ACCESSORS(code_cache, FixedArray) |
- // Returns a copy of the map. |
Object* CopyDropDescriptors(); |
// Returns a copy of the map, with all transitions dropped from the |
@@ -2906,7 +2911,8 @@ |
static const int kInstanceDescriptorsOffset = |
kConstructorOffset + kPointerSize; |
static const int kCodeCacheOffset = kInstanceDescriptorsOffset + kPointerSize; |
- static const int kSize = kCodeCacheOffset + kPointerSize; |
+ static const int kPadStart = kCodeCacheOffset + kPointerSize; |
+ static const int kSize = MAP_SIZE_ALIGN(kPadStart); |
// Byte offsets within kInstanceSizesOffset. |
static const int kInstanceSizeOffset = kInstanceSizesOffset + 0; |