diff options
Diffstat (limited to 'deps/v8/src/objects.h')
-rw-r--r-- | deps/v8/src/objects.h | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/deps/v8/src/objects.h b/deps/v8/src/objects.h index 671978ab7f..03e2ca19b9 100644 --- a/deps/v8/src/objects.h +++ b/deps/v8/src/objects.h @@ -892,15 +892,25 @@ class MapWord BASE_EMBEDDED { 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 @@ class MapWord BASE_EMBEDDED { 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: @@ -1662,6 +1668,7 @@ class DescriptorArray: public FixedArray { public: // Is this the singleton empty_descriptor_array? inline bool IsEmpty(); + // Returns the number of descriptors in the array. int number_of_descriptors() { return IsEmpty() ? 0 : length() - kFirstIndex; @@ -1801,12 +1808,14 @@ class DescriptorArray: public FixedArray { static int ToKeyIndex(int descriptor_number) { return descriptor_number+kFirstIndex; } + + static int ToDetailsIndex(int descriptor_number) { + return (descriptor_number << 1) + 1; + } + static int ToValueIndex(int descriptor_number) { return descriptor_number << 1; } - static int ToDetailsIndex(int descriptor_number) { - return( descriptor_number << 1) + 1; - } bool is_null_descriptor(int descriptor_number) { return PropertyDetails(GetDetails(descriptor_number)).type() == @@ -2838,7 +2847,6 @@ class Map: public HeapObject { // [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 +2914,8 @@ class Map: public HeapObject { 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; |