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 2586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2597 } | 2597 } |
2598 | 2598 |
2599 | 2599 |
2600 void FixedArray::set(int index, | 2600 void FixedArray::set(int index, |
2601 Object* value, | 2601 Object* value, |
2602 WriteBarrierMode mode) { | 2602 WriteBarrierMode mode) { |
2603 DCHECK_NE(map(), GetHeap()->fixed_cow_array_map()); | 2603 DCHECK_NE(map(), GetHeap()->fixed_cow_array_map()); |
2604 DCHECK_GE(index, 0); | 2604 DCHECK_GE(index, 0); |
2605 DCHECK_LT(index, this->length()); | 2605 DCHECK_LT(index, this->length()); |
2606 int offset = kHeaderSize + index * kPointerSize; | 2606 int offset = kHeaderSize + index * kPointerSize; |
2607 WRITE_FIELD(this, offset, value); | 2607 NOBARRIER_WRITE_FIELD(this, offset, value); |
2608 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, offset, value, mode); | 2608 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, offset, value, mode); |
2609 } | 2609 } |
2610 | 2610 |
2611 | 2611 |
2612 void FixedArray::NoWriteBarrierSet(FixedArray* array, | 2612 void FixedArray::NoWriteBarrierSet(FixedArray* array, |
2613 int index, | 2613 int index, |
2614 Object* value) { | 2614 Object* value) { |
2615 DCHECK_NE(array->map(), array->GetHeap()->fixed_cow_array_map()); | 2615 DCHECK_NE(array->map(), array->GetHeap()->fixed_cow_array_map()); |
2616 DCHECK_GE(index, 0); | 2616 DCHECK_GE(index, 0); |
2617 DCHECK_LT(index, array->length()); | 2617 DCHECK_LT(index, array->length()); |
2618 DCHECK(!array->GetHeap()->InNewSpace(value)); | 2618 DCHECK(!array->GetHeap()->InNewSpace(value)); |
2619 WRITE_FIELD(array, kHeaderSize + index * kPointerSize, value); | 2619 NOBARRIER_WRITE_FIELD(array, kHeaderSize + index * kPointerSize, value); |
2620 } | 2620 } |
2621 | 2621 |
2622 void FixedArray::set_undefined(int index) { | 2622 void FixedArray::set_undefined(int index) { |
2623 set_undefined(GetIsolate(), index); | 2623 set_undefined(GetIsolate(), index); |
2624 } | 2624 } |
2625 | 2625 |
2626 void FixedArray::set_undefined(Isolate* isolate, int index) { | 2626 void FixedArray::set_undefined(Isolate* isolate, int index) { |
2627 FixedArray::NoWriteBarrierSet(this, index, | 2627 FixedArray::NoWriteBarrierSet(this, index, |
2628 isolate->heap()->undefined_value()); | 2628 isolate->heap()->undefined_value()); |
2629 } | 2629 } |
(...skipping 5806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8436 #undef WRITE_INT64_FIELD | 8436 #undef WRITE_INT64_FIELD |
8437 #undef READ_BYTE_FIELD | 8437 #undef READ_BYTE_FIELD |
8438 #undef WRITE_BYTE_FIELD | 8438 #undef WRITE_BYTE_FIELD |
8439 #undef NOBARRIER_READ_BYTE_FIELD | 8439 #undef NOBARRIER_READ_BYTE_FIELD |
8440 #undef NOBARRIER_WRITE_BYTE_FIELD | 8440 #undef NOBARRIER_WRITE_BYTE_FIELD |
8441 | 8441 |
8442 } // namespace internal | 8442 } // namespace internal |
8443 } // namespace v8 | 8443 } // namespace v8 |
8444 | 8444 |
8445 #endif // V8_OBJECTS_INL_H_ | 8445 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |