| 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 6952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6963 | 6963 |
| 6964 uint32_t JSArrayBuffer::bit_field() const { | 6964 uint32_t JSArrayBuffer::bit_field() const { |
| 6965 return READ_UINT32_FIELD(this, kBitFieldOffset); | 6965 return READ_UINT32_FIELD(this, kBitFieldOffset); |
| 6966 } | 6966 } |
| 6967 | 6967 |
| 6968 | 6968 |
| 6969 bool JSArrayBuffer::is_external() { return IsExternal::decode(bit_field()); } | 6969 bool JSArrayBuffer::is_external() { return IsExternal::decode(bit_field()); } |
| 6970 | 6970 |
| 6971 | 6971 |
| 6972 void JSArrayBuffer::set_is_external(bool value) { | 6972 void JSArrayBuffer::set_is_external(bool value) { |
| 6973 DCHECK(!value || !has_guard_region()); |
| 6973 set_bit_field(IsExternal::update(bit_field(), value)); | 6974 set_bit_field(IsExternal::update(bit_field(), value)); |
| 6974 } | 6975 } |
| 6975 | 6976 |
| 6976 | 6977 |
| 6977 bool JSArrayBuffer::is_neuterable() { | 6978 bool JSArrayBuffer::is_neuterable() { |
| 6978 return IsNeuterable::decode(bit_field()); | 6979 return IsNeuterable::decode(bit_field()); |
| 6979 } | 6980 } |
| 6980 | 6981 |
| 6981 | 6982 |
| 6982 void JSArrayBuffer::set_is_neuterable(bool value) { | 6983 void JSArrayBuffer::set_is_neuterable(bool value) { |
| 6983 set_bit_field(IsNeuterable::update(bit_field(), value)); | 6984 set_bit_field(IsNeuterable::update(bit_field(), value)); |
| 6984 } | 6985 } |
| 6985 | 6986 |
| 6986 | 6987 |
| 6987 bool JSArrayBuffer::was_neutered() { return WasNeutered::decode(bit_field()); } | 6988 bool JSArrayBuffer::was_neutered() { return WasNeutered::decode(bit_field()); } |
| 6988 | 6989 |
| 6989 | 6990 |
| 6990 void JSArrayBuffer::set_was_neutered(bool value) { | 6991 void JSArrayBuffer::set_was_neutered(bool value) { |
| 6991 set_bit_field(WasNeutered::update(bit_field(), value)); | 6992 set_bit_field(WasNeutered::update(bit_field(), value)); |
| 6992 } | 6993 } |
| 6993 | 6994 |
| 6994 | 6995 |
| 6995 bool JSArrayBuffer::is_shared() { return IsShared::decode(bit_field()); } | 6996 bool JSArrayBuffer::is_shared() { return IsShared::decode(bit_field()); } |
| 6996 | 6997 |
| 6997 | 6998 |
| 6998 void JSArrayBuffer::set_is_shared(bool value) { | 6999 void JSArrayBuffer::set_is_shared(bool value) { |
| 6999 set_bit_field(IsShared::update(bit_field(), value)); | 7000 set_bit_field(IsShared::update(bit_field(), value)); |
| 7000 } | 7001 } |
| 7001 | 7002 |
| 7003 bool JSArrayBuffer::has_guard_region() { |
| 7004 return HasGuardRegion::decode(bit_field()); |
| 7005 } |
| 7006 |
| 7007 void JSArrayBuffer::set_has_guard_region(bool value) { |
| 7008 set_bit_field(HasGuardRegion::update(bit_field(), value)); |
| 7009 } |
| 7002 | 7010 |
| 7003 Object* JSArrayBufferView::byte_offset() const { | 7011 Object* JSArrayBufferView::byte_offset() const { |
| 7004 if (WasNeutered()) return Smi::kZero; | 7012 if (WasNeutered()) return Smi::kZero; |
| 7005 return Object::cast(READ_FIELD(this, kByteOffsetOffset)); | 7013 return Object::cast(READ_FIELD(this, kByteOffsetOffset)); |
| 7006 } | 7014 } |
| 7007 | 7015 |
| 7008 | 7016 |
| 7009 void JSArrayBufferView::set_byte_offset(Object* value, WriteBarrierMode mode) { | 7017 void JSArrayBufferView::set_byte_offset(Object* value, WriteBarrierMode mode) { |
| 7010 WRITE_FIELD(this, kByteOffsetOffset, value); | 7018 WRITE_FIELD(this, kByteOffsetOffset, value); |
| 7011 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kByteOffsetOffset, value, mode); | 7019 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kByteOffsetOffset, value, mode); |
| (...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8431 #undef WRITE_INT64_FIELD | 8439 #undef WRITE_INT64_FIELD |
| 8432 #undef READ_BYTE_FIELD | 8440 #undef READ_BYTE_FIELD |
| 8433 #undef WRITE_BYTE_FIELD | 8441 #undef WRITE_BYTE_FIELD |
| 8434 #undef NOBARRIER_READ_BYTE_FIELD | 8442 #undef NOBARRIER_READ_BYTE_FIELD |
| 8435 #undef NOBARRIER_WRITE_BYTE_FIELD | 8443 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 8436 | 8444 |
| 8437 } // namespace internal | 8445 } // namespace internal |
| 8438 } // namespace v8 | 8446 } // namespace v8 |
| 8439 | 8447 |
| 8440 #endif // V8_OBJECTS_INL_H_ | 8448 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |