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