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