| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Review notes: | 5 // Review notes: |
| 6 // | 6 // |
| 7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
| 8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
| 9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
| 10 // | 10 // |
| (...skipping 2740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2751 | 2751 |
| 2752 WriteBarrierMode HeapObject::GetWriteBarrierMode( | 2752 WriteBarrierMode HeapObject::GetWriteBarrierMode( |
| 2753 const DisallowHeapAllocation& promise) { | 2753 const DisallowHeapAllocation& promise) { |
| 2754 Heap* heap = GetHeap(); | 2754 Heap* heap = GetHeap(); |
| 2755 if (heap->incremental_marking()->IsMarking()) return UPDATE_WRITE_BARRIER; | 2755 if (heap->incremental_marking()->IsMarking()) return UPDATE_WRITE_BARRIER; |
| 2756 if (heap->InNewSpace(this)) return SKIP_WRITE_BARRIER; | 2756 if (heap->InNewSpace(this)) return SKIP_WRITE_BARRIER; |
| 2757 return UPDATE_WRITE_BARRIER; | 2757 return UPDATE_WRITE_BARRIER; |
| 2758 } | 2758 } |
| 2759 | 2759 |
| 2760 | 2760 |
| 2761 bool HeapObject::NeedsToEnsureDoubleAlignment() { |
| 2762 #ifndef V8_HOST_ARCH_64_BIT |
| 2763 return (IsFixedFloat64Array() || IsFixedDoubleArray() || |
| 2764 IsConstantPoolArray()) && |
| 2765 FixedArrayBase::cast(this)->length() != 0; |
| 2766 #else |
| 2767 return false; |
| 2768 #endif // V8_HOST_ARCH_64_BIT |
| 2769 } |
| 2770 |
| 2771 |
| 2761 void FixedArray::set(int index, | 2772 void FixedArray::set(int index, |
| 2762 Object* value, | 2773 Object* value, |
| 2763 WriteBarrierMode mode) { | 2774 WriteBarrierMode mode) { |
| 2764 DCHECK(map() != GetHeap()->fixed_cow_array_map()); | 2775 DCHECK(map() != GetHeap()->fixed_cow_array_map()); |
| 2765 DCHECK(index >= 0 && index < this->length()); | 2776 DCHECK(index >= 0 && index < this->length()); |
| 2766 int offset = kHeaderSize + index * kPointerSize; | 2777 int offset = kHeaderSize + index * kPointerSize; |
| 2767 WRITE_FIELD(this, offset, value); | 2778 WRITE_FIELD(this, offset, value); |
| 2768 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, offset, value, mode); | 2779 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, offset, value, mode); |
| 2769 } | 2780 } |
| 2770 | 2781 |
| (...skipping 4703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7474 #undef READ_SHORT_FIELD | 7485 #undef READ_SHORT_FIELD |
| 7475 #undef WRITE_SHORT_FIELD | 7486 #undef WRITE_SHORT_FIELD |
| 7476 #undef READ_BYTE_FIELD | 7487 #undef READ_BYTE_FIELD |
| 7477 #undef WRITE_BYTE_FIELD | 7488 #undef WRITE_BYTE_FIELD |
| 7478 #undef NOBARRIER_READ_BYTE_FIELD | 7489 #undef NOBARRIER_READ_BYTE_FIELD |
| 7479 #undef NOBARRIER_WRITE_BYTE_FIELD | 7490 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7480 | 7491 |
| 7481 } } // namespace v8::internal | 7492 } } // namespace v8::internal |
| 7482 | 7493 |
| 7483 #endif // V8_OBJECTS_INL_H_ | 7494 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |