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 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1889 byte Oddball::kind() const { | 1889 byte Oddball::kind() const { |
1890 return Smi::cast(READ_FIELD(this, kKindOffset))->value(); | 1890 return Smi::cast(READ_FIELD(this, kKindOffset))->value(); |
1891 } | 1891 } |
1892 | 1892 |
1893 | 1893 |
1894 void Oddball::set_kind(byte value) { | 1894 void Oddball::set_kind(byte value) { |
1895 WRITE_FIELD(this, kKindOffset, Smi::FromInt(value)); | 1895 WRITE_FIELD(this, kKindOffset, Smi::FromInt(value)); |
1896 } | 1896 } |
1897 | 1897 |
1898 | 1898 |
1899 Object* Cell::value() const { | 1899 ACCESSORS(Cell, value, Object, kValueOffset) |
1900 return READ_FIELD(this, kValueOffset); | |
1901 } | |
1902 | |
1903 | |
1904 void Cell::set_value(Object* val, WriteBarrierMode ignored) { | |
1905 // The write barrier is not used for global property cells. | |
1906 DCHECK(!val->IsPropertyCell() && !val->IsCell()); | |
1907 WRITE_FIELD(this, kValueOffset, val); | |
1908 } | |
1909 | |
1910 ACCESSORS(PropertyCell, dependent_code, DependentCode, kDependentCodeOffset) | 1900 ACCESSORS(PropertyCell, dependent_code, DependentCode, kDependentCodeOffset) |
1911 ACCESSORS(PropertyCell, value, Object, kValueOffset) | 1901 ACCESSORS(PropertyCell, value, Object, kValueOffset) |
1912 | 1902 |
1913 Object* WeakCell::value() const { return READ_FIELD(this, kValueOffset); } | 1903 Object* WeakCell::value() const { return READ_FIELD(this, kValueOffset); } |
1914 | 1904 |
1915 | 1905 |
1916 void WeakCell::clear() { | 1906 void WeakCell::clear() { |
1917 DCHECK(GetHeap()->gc_state() == Heap::MARK_COMPACT); | 1907 DCHECK(GetHeap()->gc_state() == Heap::MARK_COMPACT); |
1918 WRITE_FIELD(this, kValueOffset, Smi::FromInt(0)); | 1908 WRITE_FIELD(this, kValueOffset, Smi::FromInt(0)); |
1919 } | 1909 } |
(...skipping 5621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7541 #undef READ_SHORT_FIELD | 7531 #undef READ_SHORT_FIELD |
7542 #undef WRITE_SHORT_FIELD | 7532 #undef WRITE_SHORT_FIELD |
7543 #undef READ_BYTE_FIELD | 7533 #undef READ_BYTE_FIELD |
7544 #undef WRITE_BYTE_FIELD | 7534 #undef WRITE_BYTE_FIELD |
7545 #undef NOBARRIER_READ_BYTE_FIELD | 7535 #undef NOBARRIER_READ_BYTE_FIELD |
7546 #undef NOBARRIER_WRITE_BYTE_FIELD | 7536 #undef NOBARRIER_WRITE_BYTE_FIELD |
7547 | 7537 |
7548 } } // namespace v8::internal | 7538 } } // namespace v8::internal |
7549 | 7539 |
7550 #endif // V8_OBJECTS_INL_H_ | 7540 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |