| 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 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1910 | 1910 |
| 1911 | 1911 |
| 1912 void WeakCell::clear() { | 1912 void WeakCell::clear() { |
| 1913 DCHECK(GetHeap()->gc_state() == Heap::MARK_COMPACT); | 1913 DCHECK(GetHeap()->gc_state() == Heap::MARK_COMPACT); |
| 1914 WRITE_FIELD(this, kValueOffset, Smi::FromInt(0)); | 1914 WRITE_FIELD(this, kValueOffset, Smi::FromInt(0)); |
| 1915 } | 1915 } |
| 1916 | 1916 |
| 1917 | 1917 |
| 1918 void WeakCell::initialize(HeapObject* val) { | 1918 void WeakCell::initialize(HeapObject* val) { |
| 1919 WRITE_FIELD(this, kValueOffset, val); | 1919 WRITE_FIELD(this, kValueOffset, val); |
| 1920 WRITE_BARRIER(GetHeap(), this, kValueOffset, val); | 1920 Heap* heap = GetHeap(); |
| 1921 // We just have to execute the generational barrier here because we never |
| 1922 // mark through a weak cell and collect evacuation candidates when we process |
| 1923 // all weak cells. |
| 1924 if (heap->InNewSpace(val)) { |
| 1925 heap->RecordWrite(address(), kValueOffset); |
| 1926 } |
| 1921 } | 1927 } |
| 1922 | 1928 |
| 1923 | 1929 |
| 1924 bool WeakCell::cleared() const { return value() == Smi::FromInt(0); } | 1930 bool WeakCell::cleared() const { return value() == Smi::FromInt(0); } |
| 1925 | 1931 |
| 1926 | 1932 |
| 1927 Object* WeakCell::next() const { return READ_FIELD(this, kNextOffset); } | 1933 Object* WeakCell::next() const { return READ_FIELD(this, kNextOffset); } |
| 1928 | 1934 |
| 1929 | 1935 |
| 1930 void WeakCell::set_next(Object* val, WriteBarrierMode mode) { | 1936 void WeakCell::set_next(Object* val, WriteBarrierMode mode) { |
| (...skipping 5678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7609 #undef READ_SHORT_FIELD | 7615 #undef READ_SHORT_FIELD |
| 7610 #undef WRITE_SHORT_FIELD | 7616 #undef WRITE_SHORT_FIELD |
| 7611 #undef READ_BYTE_FIELD | 7617 #undef READ_BYTE_FIELD |
| 7612 #undef WRITE_BYTE_FIELD | 7618 #undef WRITE_BYTE_FIELD |
| 7613 #undef NOBARRIER_READ_BYTE_FIELD | 7619 #undef NOBARRIER_READ_BYTE_FIELD |
| 7614 #undef NOBARRIER_WRITE_BYTE_FIELD | 7620 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7615 | 7621 |
| 7616 } } // namespace v8::internal | 7622 } } // namespace v8::internal |
| 7617 | 7623 |
| 7618 #endif // V8_OBJECTS_INL_H_ | 7624 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |