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 1976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1987 this == GetHeap()->empty_weak_cell()); | 1987 this == GetHeap()->empty_weak_cell()); |
1988 WRITE_FIELD(this, kValueOffset, Smi::FromInt(0)); | 1988 WRITE_FIELD(this, kValueOffset, Smi::FromInt(0)); |
1989 } | 1989 } |
1990 | 1990 |
1991 | 1991 |
1992 void WeakCell::initialize(HeapObject* val) { | 1992 void WeakCell::initialize(HeapObject* val) { |
1993 WRITE_FIELD(this, kValueOffset, val); | 1993 WRITE_FIELD(this, kValueOffset, val); |
1994 // We just have to execute the generational barrier here because we never | 1994 // We just have to execute the generational barrier here because we never |
1995 // mark through a weak cell and collect evacuation candidates when we process | 1995 // mark through a weak cell and collect evacuation candidates when we process |
1996 // all weak cells. | 1996 // all weak cells. |
1997 WriteBarrierMode mode = Marking::IsBlack(ObjectMarking::MarkBitFrom(this)) | 1997 WriteBarrierMode mode = |
1998 ? UPDATE_WRITE_BARRIER | 1998 Page::FromAddress(this->address())->IsFlagSet(Page::BLACK_PAGE) |
1999 : UPDATE_WEAK_WRITE_BARRIER; | 1999 ? UPDATE_WRITE_BARRIER |
| 2000 : UPDATE_WEAK_WRITE_BARRIER; |
2000 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kValueOffset, val, mode); | 2001 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kValueOffset, val, mode); |
2001 } | 2002 } |
2002 | 2003 |
2003 | 2004 |
2004 bool WeakCell::cleared() const { return value() == Smi::FromInt(0); } | 2005 bool WeakCell::cleared() const { return value() == Smi::FromInt(0); } |
2005 | 2006 |
2006 | 2007 |
2007 Object* WeakCell::next() const { return READ_FIELD(this, kNextOffset); } | 2008 Object* WeakCell::next() const { return READ_FIELD(this, kNextOffset); } |
2008 | 2009 |
2009 | 2010 |
(...skipping 6107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8117 #undef WRITE_INT64_FIELD | 8118 #undef WRITE_INT64_FIELD |
8118 #undef READ_BYTE_FIELD | 8119 #undef READ_BYTE_FIELD |
8119 #undef WRITE_BYTE_FIELD | 8120 #undef WRITE_BYTE_FIELD |
8120 #undef NOBARRIER_READ_BYTE_FIELD | 8121 #undef NOBARRIER_READ_BYTE_FIELD |
8121 #undef NOBARRIER_WRITE_BYTE_FIELD | 8122 #undef NOBARRIER_WRITE_BYTE_FIELD |
8122 | 8123 |
8123 } // namespace internal | 8124 } // namespace internal |
8124 } // namespace v8 | 8125 } // namespace v8 |
8125 | 8126 |
8126 #endif // V8_OBJECTS_INL_H_ | 8127 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |