Chromium Code Reviews| Index: src/objects-inl.h |
| diff --git a/src/objects-inl.h b/src/objects-inl.h |
| index b26a857e1920fa691b2eceb244fd0272da285f58..cd1f910f62664cbffe565ba452fdd73ae7f9f665 100644 |
| --- a/src/objects-inl.h |
| +++ b/src/objects-inl.h |
| @@ -2367,8 +2367,8 @@ ConstantPoolArray::LayoutSection ConstantPoolArray::final_section() { |
| int ConstantPoolArray::first_extended_section_index() { |
| ASSERT(is_extended_layout()); |
| - uint32_t small_layout_2 = READ_UINT32_FIELD(this, kSmallLayout2Offset); |
| - return TotalCountField::decode(small_layout_2); |
| + uint32_t small_layout_3 = READ_UINT32_FIELD(this, kSmallLayout3Offset); |
| + return TotalCountField::decode(small_layout_3); |
| } |
| @@ -2378,16 +2378,16 @@ int ConstantPoolArray::get_extended_section_header_offset() { |
| ConstantPoolArray::WeakObjectState ConstantPoolArray::get_weak_object_state() { |
| - uint32_t small_layout_2 = READ_UINT32_FIELD(this, kSmallLayout2Offset); |
| - return WeakObjectStateField::decode(small_layout_2); |
| + uint32_t small_layout_3 = READ_UINT32_FIELD(this, kSmallLayout3Offset); |
| + return WeakObjectStateField::decode(small_layout_3); |
| } |
| void ConstantPoolArray::set_weak_object_state( |
| ConstantPoolArray::WeakObjectState state) { |
| - uint32_t small_layout_2 = READ_UINT32_FIELD(this, kSmallLayout2Offset); |
| - small_layout_2 = WeakObjectStateField::update(small_layout_2, state); |
| - WRITE_INT32_FIELD(this, kSmallLayout2Offset, small_layout_2); |
| + uint32_t small_layout_3 = READ_UINT32_FIELD(this, kSmallLayout3Offset); |
| + small_layout_3 = WeakObjectStateField::update(small_layout_3, state); |
| + WRITE_INT32_FIELD(this, kSmallLayout3Offset, small_layout_3); |
| } |
| @@ -2422,7 +2422,7 @@ int ConstantPoolArray::number_of_entries(Type type, LayoutSection section) { |
| case CODE_PTR: |
| return CodePtrCountField::decode(small_layout_1); |
| case HEAP_PTR: |
| - return HeapPtrCountField::decode(small_layout_1); |
| + return HeapPtrCountField::decode(small_layout_2); |
| case INT32: |
| return Int32CountField::decode(small_layout_2); |
| default: |
| @@ -2593,14 +2593,16 @@ void ConstantPoolArray::Init(const NumberOfEntries& small) { |
| uint32_t small_layout_1 = |
| Int64CountField::encode(small.count_of(INT64)) | |
| CodePtrCountField::encode(small.count_of(CODE_PTR)) | |
| - HeapPtrCountField::encode(small.count_of(HEAP_PTR)) | |
| IsExtendedField::encode(false); |
| uint32_t small_layout_2 = |
| - Int32CountField::encode(small.count_of(INT32)) | |
| + HeapPtrCountField::encode(small.count_of(HEAP_PTR)) | |
| + Int32CountField::encode(small.count_of(INT32)); |
| + uint32_t small_layout_3 = |
| TotalCountField::encode(small.total_count()) | |
| WeakObjectStateField::encode(NO_WEAK_OBJECTS); |
| WRITE_UINT32_FIELD(this, kSmallLayout1Offset, small_layout_1); |
| WRITE_UINT32_FIELD(this, kSmallLayout2Offset, small_layout_2); |
| + WRITE_UINT32_FIELD(this, kSmallLayout3Offset, small_layout_3); |
|
rmcilroy
2014/07/29 17:11:45
Why did you have to add another layout field? I t
|
| if (kHeaderSize != kFirstEntryOffset) { |
| ASSERT(kFirstEntryOffset - kHeaderSize == kInt32Size); |
| WRITE_UINT32_FIELD(this, kHeaderSize, 0); // Zero out header padding. |
| @@ -2643,8 +2645,8 @@ int ConstantPoolArray::size() { |
| int ConstantPoolArray::length() { |
| - uint32_t small_layout_2 = READ_UINT32_FIELD(this, kSmallLayout2Offset); |
| - int length = TotalCountField::decode(small_layout_2); |
| + uint32_t small_layout_3 = READ_UINT32_FIELD(this, kSmallLayout3Offset); |
| + int length = TotalCountField::decode(small_layout_3); |
| if (is_extended_layout()) { |
| length += number_of_entries(INT64, EXTENDED_SECTION) + |
| number_of_entries(CODE_PTR, EXTENDED_SECTION) + |
| @@ -3316,10 +3318,7 @@ uint32_t Name::hash_field() { |
| void Name::set_hash_field(uint32_t value) { |
| - WRITE_UINT32_FIELD(this, kHashFieldOffset, value); |
| -#if V8_HOST_ARCH_64_BIT |
| - WRITE_UINT32_FIELD(this, kHashFieldOffset + kIntSize, 0); |
| -#endif |
| + WRITE_INTPTR_FIELD(this, kHashFieldSlot, value); |
| } |
| @@ -5471,25 +5470,33 @@ SMI_ACCESSORS(SharedFunctionInfo, profiler_ticks, kProfilerTicksOffset) |
| #else |
| -#define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ |
| - STATIC_ASSERT(holder::offset % kPointerSize == 0); \ |
| - int holder::name() const { \ |
| - int value = READ_INT_FIELD(this, offset); \ |
| - ASSERT(kHeapObjectTag == 1); \ |
| - ASSERT((value & kHeapObjectTag) == 0); \ |
| - return value >> 1; \ |
| - } \ |
| - void holder::set_##name(int value) { \ |
| - ASSERT(kHeapObjectTag == 1); \ |
| - ASSERT((value & 0xC0000000) == 0xC0000000 || \ |
| - (value & 0xC0000000) == 0x0); \ |
| - WRITE_INT_FIELD(this, \ |
| - offset, \ |
| - (value << 1) & ~kHeapObjectTag); \ |
| - } |
| - |
| -#define PSEUDO_SMI_ACCESSORS_HI(holder, name, offset) \ |
| - STATIC_ASSERT(holder::offset % kPointerSize == kIntSize); \ |
| +#if V8_TARGET_LITTLE_ENDIAN |
| +#define PSEUDO_SMI_LO_ALIGN 0 |
| +#define PSEUDO_SMI_HI_ALIGN kIntSize |
| +#else |
| +#define PSEUDO_SMI_LO_ALIGN kIntSize |
| +#define PSEUDO_SMI_HI_ALIGN 0 |
| +#endif |
| + |
| +#define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ |
| + STATIC_ASSERT(holder::offset % kPointerSize == PSEUDO_SMI_LO_ALIGN); \ |
| + int holder::name() const { \ |
| + int value = READ_INT_FIELD(this, offset); \ |
| + ASSERT(kHeapObjectTag == 1); \ |
| + ASSERT((value & kHeapObjectTag) == 0); \ |
| + return value >> 1; \ |
| + } \ |
| + void holder::set_##name(int value) { \ |
| + ASSERT(kHeapObjectTag == 1); \ |
| + ASSERT((value & 0xC0000000) == 0xC0000000 || \ |
| + (value & 0xC0000000) == 0x0); \ |
| + WRITE_INT_FIELD(this, \ |
| + offset, \ |
| + (value << 1) & ~kHeapObjectTag); \ |
| + } |
| + |
| +#define PSEUDO_SMI_ACCESSORS_HI(holder, name, offset) \ |
| + STATIC_ASSERT(holder::offset % kPointerSize == PSEUDO_SMI_HI_ALIGN); \ |
| INT_ACCESSORS(holder, name, offset) |