| 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 6946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6957 | 6957 |
| 6958 uint32_t JSArrayBuffer::bit_field() const { | 6958 uint32_t JSArrayBuffer::bit_field() const { |
| 6959 return READ_UINT32_FIELD(this, kBitFieldOffset); | 6959 return READ_UINT32_FIELD(this, kBitFieldOffset); |
| 6960 } | 6960 } |
| 6961 | 6961 |
| 6962 | 6962 |
| 6963 bool JSArrayBuffer::is_external() { return IsExternal::decode(bit_field()); } | 6963 bool JSArrayBuffer::is_external() { return IsExternal::decode(bit_field()); } |
| 6964 | 6964 |
| 6965 | 6965 |
| 6966 void JSArrayBuffer::set_is_external(bool value) { | 6966 void JSArrayBuffer::set_is_external(bool value) { |
| 6967 DCHECK(!value || !has_guard_region()); |
| 6967 set_bit_field(IsExternal::update(bit_field(), value)); | 6968 set_bit_field(IsExternal::update(bit_field(), value)); |
| 6968 } | 6969 } |
| 6969 | 6970 |
| 6970 | 6971 |
| 6971 bool JSArrayBuffer::is_neuterable() { | 6972 bool JSArrayBuffer::is_neuterable() { |
| 6972 return IsNeuterable::decode(bit_field()); | 6973 return IsNeuterable::decode(bit_field()); |
| 6973 } | 6974 } |
| 6974 | 6975 |
| 6975 | 6976 |
| 6976 void JSArrayBuffer::set_is_neuterable(bool value) { | 6977 void JSArrayBuffer::set_is_neuterable(bool value) { |
| 6977 set_bit_field(IsNeuterable::update(bit_field(), value)); | 6978 set_bit_field(IsNeuterable::update(bit_field(), value)); |
| 6978 } | 6979 } |
| 6979 | 6980 |
| 6980 | 6981 |
| 6981 bool JSArrayBuffer::was_neutered() { return WasNeutered::decode(bit_field()); } | 6982 bool JSArrayBuffer::was_neutered() { return WasNeutered::decode(bit_field()); } |
| 6982 | 6983 |
| 6983 | 6984 |
| 6984 void JSArrayBuffer::set_was_neutered(bool value) { | 6985 void JSArrayBuffer::set_was_neutered(bool value) { |
| 6985 set_bit_field(WasNeutered::update(bit_field(), value)); | 6986 set_bit_field(WasNeutered::update(bit_field(), value)); |
| 6986 } | 6987 } |
| 6987 | 6988 |
| 6988 | 6989 |
| 6989 bool JSArrayBuffer::is_shared() { return IsShared::decode(bit_field()); } | 6990 bool JSArrayBuffer::is_shared() { return IsShared::decode(bit_field()); } |
| 6990 | 6991 |
| 6991 | 6992 |
| 6992 void JSArrayBuffer::set_is_shared(bool value) { | 6993 void JSArrayBuffer::set_is_shared(bool value) { |
| 6993 set_bit_field(IsShared::update(bit_field(), value)); | 6994 set_bit_field(IsShared::update(bit_field(), value)); |
| 6994 } | 6995 } |
| 6995 | 6996 |
| 6997 bool JSArrayBuffer::has_guard_region() { |
| 6998 return HasGuardRegion::decode(bit_field()); |
| 6999 } |
| 7000 |
| 7001 void JSArrayBuffer::set_has_guard_region(bool value) { |
| 7002 set_bit_field(HasGuardRegion::update(bit_field(), value)); |
| 7003 } |
| 6996 | 7004 |
| 6997 Object* JSArrayBufferView::byte_offset() const { | 7005 Object* JSArrayBufferView::byte_offset() const { |
| 6998 if (WasNeutered()) return Smi::kZero; | 7006 if (WasNeutered()) return Smi::kZero; |
| 6999 return Object::cast(READ_FIELD(this, kByteOffsetOffset)); | 7007 return Object::cast(READ_FIELD(this, kByteOffsetOffset)); |
| 7000 } | 7008 } |
| 7001 | 7009 |
| 7002 | 7010 |
| 7003 void JSArrayBufferView::set_byte_offset(Object* value, WriteBarrierMode mode) { | 7011 void JSArrayBufferView::set_byte_offset(Object* value, WriteBarrierMode mode) { |
| 7004 WRITE_FIELD(this, kByteOffsetOffset, value); | 7012 WRITE_FIELD(this, kByteOffsetOffset, value); |
| 7005 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kByteOffsetOffset, value, mode); | 7013 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kByteOffsetOffset, value, mode); |
| (...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8420 #undef WRITE_INT64_FIELD | 8428 #undef WRITE_INT64_FIELD |
| 8421 #undef READ_BYTE_FIELD | 8429 #undef READ_BYTE_FIELD |
| 8422 #undef WRITE_BYTE_FIELD | 8430 #undef WRITE_BYTE_FIELD |
| 8423 #undef NOBARRIER_READ_BYTE_FIELD | 8431 #undef NOBARRIER_READ_BYTE_FIELD |
| 8424 #undef NOBARRIER_WRITE_BYTE_FIELD | 8432 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 8425 | 8433 |
| 8426 } // namespace internal | 8434 } // namespace internal |
| 8427 } // namespace v8 | 8435 } // namespace v8 |
| 8428 | 8436 |
| 8429 #endif // V8_OBJECTS_INL_H_ | 8437 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |