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 2794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2805 WriteBarrierMode HeapObject::GetWriteBarrierMode( | 2805 WriteBarrierMode HeapObject::GetWriteBarrierMode( |
2806 const DisallowHeapAllocation& promise) { | 2806 const DisallowHeapAllocation& promise) { |
2807 Heap* heap = GetHeap(); | 2807 Heap* heap = GetHeap(); |
2808 if (heap->incremental_marking()->IsMarking()) return UPDATE_WRITE_BARRIER; | 2808 if (heap->incremental_marking()->IsMarking()) return UPDATE_WRITE_BARRIER; |
2809 if (heap->InNewSpace(this)) return SKIP_WRITE_BARRIER; | 2809 if (heap->InNewSpace(this)) return SKIP_WRITE_BARRIER; |
2810 return UPDATE_WRITE_BARRIER; | 2810 return UPDATE_WRITE_BARRIER; |
2811 } | 2811 } |
2812 | 2812 |
2813 | 2813 |
2814 bool HeapObject::NeedsToEnsureDoubleAlignment() { | 2814 bool HeapObject::NeedsToEnsureDoubleAlignment() { |
2815 #ifndef V8_HOST_ARCH_64_BIT | 2815 #ifdef V8_HOST_ARCH_32_BIT |
2816 return (IsFixedFloat64Array() || IsFixedDoubleArray() || | 2816 return (IsFixedFloat64Array() || IsFixedDoubleArray() || |
2817 IsConstantPoolArray()) && | 2817 IsConstantPoolArray()) && |
2818 FixedArrayBase::cast(this)->length() != 0; | 2818 FixedArrayBase::cast(this)->length() != 0; |
2819 #else | 2819 #else |
2820 return false; | 2820 return false; |
2821 #endif // V8_HOST_ARCH_64_BIT | 2821 #endif // V8_HOST_ARCH_32_BIT |
2822 } | 2822 } |
2823 | 2823 |
2824 | 2824 |
| 2825 bool HeapObject::NeedsToEnsureDoubleUnalignment() { |
| 2826 #ifdef V8_HOST_ARCH_32_BIT |
| 2827 return IsHeapNumber(); |
| 2828 #else |
| 2829 return false; |
| 2830 #endif // V8_HOST_ARCH_32_BIT |
| 2831 } |
| 2832 |
| 2833 |
2825 void FixedArray::set(int index, | 2834 void FixedArray::set(int index, |
2826 Object* value, | 2835 Object* value, |
2827 WriteBarrierMode mode) { | 2836 WriteBarrierMode mode) { |
2828 DCHECK(map() != GetHeap()->fixed_cow_array_map()); | 2837 DCHECK(map() != GetHeap()->fixed_cow_array_map()); |
2829 DCHECK(index >= 0 && index < this->length()); | 2838 DCHECK(index >= 0 && index < this->length()); |
2830 int offset = kHeaderSize + index * kPointerSize; | 2839 int offset = kHeaderSize + index * kPointerSize; |
2831 WRITE_FIELD(this, offset, value); | 2840 WRITE_FIELD(this, offset, value); |
2832 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, offset, value, mode); | 2841 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, offset, value, mode); |
2833 } | 2842 } |
2834 | 2843 |
(...skipping 4763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7598 #undef READ_SHORT_FIELD | 7607 #undef READ_SHORT_FIELD |
7599 #undef WRITE_SHORT_FIELD | 7608 #undef WRITE_SHORT_FIELD |
7600 #undef READ_BYTE_FIELD | 7609 #undef READ_BYTE_FIELD |
7601 #undef WRITE_BYTE_FIELD | 7610 #undef WRITE_BYTE_FIELD |
7602 #undef NOBARRIER_READ_BYTE_FIELD | 7611 #undef NOBARRIER_READ_BYTE_FIELD |
7603 #undef NOBARRIER_WRITE_BYTE_FIELD | 7612 #undef NOBARRIER_WRITE_BYTE_FIELD |
7604 | 7613 |
7605 } } // namespace v8::internal | 7614 } } // namespace v8::internal |
7606 | 7615 |
7607 #endif // V8_OBJECTS_INL_H_ | 7616 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |