Chromium Code Reviews| 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 6568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6579 | 6579 |
| 6580 | 6580 |
| 6581 bool JSArrayBuffer::is_shared() { return IsShared::decode(bit_field()); } | 6581 bool JSArrayBuffer::is_shared() { return IsShared::decode(bit_field()); } |
| 6582 | 6582 |
| 6583 | 6583 |
| 6584 void JSArrayBuffer::set_is_shared(bool value) { | 6584 void JSArrayBuffer::set_is_shared(bool value) { |
| 6585 set_bit_field(IsShared::update(bit_field(), value)); | 6585 set_bit_field(IsShared::update(bit_field(), value)); |
| 6586 } | 6586 } |
| 6587 | 6587 |
| 6588 | 6588 |
| 6589 // static | |
| 6590 template <typename StaticVisitor> | |
| 6591 void JSArrayBuffer::BodyDescriptor::IterateBody(Heap* heap, HeapObject* obj) { | |
| 6592 StaticVisitor::VisitPointers( | |
| 6593 heap, obj, | |
| 6594 HeapObject::RawField(obj, JSArrayBuffer::BodyDescriptor::kStartOffset), | |
|
jochen (gone - plz use gerrit)
2015/09/14 10:04:36
I wouldn't use constants here, just visit the leng
fedor.indutny
2015/09/14 17:08:16
Acknowledged.
| |
| 6595 HeapObject::RawField(obj, JSArrayBuffer::kBackingStoreOffset)); | |
| 6596 StaticVisitor::VisitPointers( | |
| 6597 heap, obj, HeapObject::RawField( | |
| 6598 obj, JSArrayBuffer::kBackingStoreOffset + kPointerSize), | |
| 6599 HeapObject::RawField(obj, JSArrayBuffer::kSizeWithInternalFields)); | |
| 6600 } | |
| 6601 | |
| 6602 | |
| 6603 void JSArrayBuffer::BodyDescriptor::IterateBody(HeapObject* obj, | |
| 6604 ObjectVisitor* v) { | |
| 6605 v->VisitPointers( | |
| 6606 HeapObject::RawField(obj, JSArrayBuffer::BodyDescriptor::kStartOffset), | |
| 6607 HeapObject::RawField(obj, JSArrayBuffer::kBackingStoreOffset)); | |
| 6608 v->VisitPointers( | |
| 6609 HeapObject::RawField(obj, | |
| 6610 JSArrayBuffer::kBackingStoreOffset + kPointerSize), | |
| 6611 HeapObject::RawField(obj, JSArrayBuffer::kSizeWithInternalFields)); | |
| 6612 } | |
| 6613 | |
| 6614 | |
| 6589 Object* JSArrayBufferView::byte_offset() const { | 6615 Object* JSArrayBufferView::byte_offset() const { |
| 6590 if (WasNeutered()) return Smi::FromInt(0); | 6616 if (WasNeutered()) return Smi::FromInt(0); |
| 6591 return Object::cast(READ_FIELD(this, kByteOffsetOffset)); | 6617 return Object::cast(READ_FIELD(this, kByteOffsetOffset)); |
| 6592 } | 6618 } |
| 6593 | 6619 |
| 6594 | 6620 |
| 6595 void JSArrayBufferView::set_byte_offset(Object* value, WriteBarrierMode mode) { | 6621 void JSArrayBufferView::set_byte_offset(Object* value, WriteBarrierMode mode) { |
| 6596 WRITE_FIELD(this, kByteOffsetOffset, value); | 6622 WRITE_FIELD(this, kByteOffsetOffset, value); |
| 6597 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kByteOffsetOffset, value, mode); | 6623 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kByteOffsetOffset, value, mode); |
| 6598 } | 6624 } |
| (...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7905 #undef READ_INT64_FIELD | 7931 #undef READ_INT64_FIELD |
| 7906 #undef WRITE_INT64_FIELD | 7932 #undef WRITE_INT64_FIELD |
| 7907 #undef READ_BYTE_FIELD | 7933 #undef READ_BYTE_FIELD |
| 7908 #undef WRITE_BYTE_FIELD | 7934 #undef WRITE_BYTE_FIELD |
| 7909 #undef NOBARRIER_READ_BYTE_FIELD | 7935 #undef NOBARRIER_READ_BYTE_FIELD |
| 7910 #undef NOBARRIER_WRITE_BYTE_FIELD | 7936 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7911 | 7937 |
| 7912 } } // namespace v8::internal | 7938 } } // namespace v8::internal |
| 7913 | 7939 |
| 7914 #endif // V8_OBJECTS_INL_H_ | 7940 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |