| 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 1987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1998 this == GetHeap()->empty_weak_cell()); | 1998 this == GetHeap()->empty_weak_cell()); |
| 1999 WRITE_FIELD(this, kValueOffset, Smi::kZero); | 1999 WRITE_FIELD(this, kValueOffset, Smi::kZero); |
| 2000 } | 2000 } |
| 2001 | 2001 |
| 2002 | 2002 |
| 2003 void WeakCell::initialize(HeapObject* val) { | 2003 void WeakCell::initialize(HeapObject* val) { |
| 2004 WRITE_FIELD(this, kValueOffset, val); | 2004 WRITE_FIELD(this, kValueOffset, val); |
| 2005 // We just have to execute the generational barrier here because we never | 2005 // We just have to execute the generational barrier here because we never |
| 2006 // mark through a weak cell and collect evacuation candidates when we process | 2006 // mark through a weak cell and collect evacuation candidates when we process |
| 2007 // all weak cells. | 2007 // all weak cells. |
| 2008 WriteBarrierMode mode = ObjectMarking::IsBlack(this) | 2008 WriteBarrierMode mode = |
| 2009 ? UPDATE_WRITE_BARRIER | 2009 ObjectMarking::IsBlack(this, MarkingState::Internal(this)) |
| 2010 : UPDATE_WEAK_WRITE_BARRIER; | 2010 ? UPDATE_WRITE_BARRIER |
| 2011 : UPDATE_WEAK_WRITE_BARRIER; |
| 2011 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kValueOffset, val, mode); | 2012 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kValueOffset, val, mode); |
| 2012 } | 2013 } |
| 2013 | 2014 |
| 2014 bool WeakCell::cleared() const { return value() == Smi::kZero; } | 2015 bool WeakCell::cleared() const { return value() == Smi::kZero; } |
| 2015 | 2016 |
| 2016 Object* WeakCell::next() const { return READ_FIELD(this, kNextOffset); } | 2017 Object* WeakCell::next() const { return READ_FIELD(this, kNextOffset); } |
| 2017 | 2018 |
| 2018 | 2019 |
| 2019 void WeakCell::set_next(Object* val, WriteBarrierMode mode) { | 2020 void WeakCell::set_next(Object* val, WriteBarrierMode mode) { |
| 2020 WRITE_FIELD(this, kNextOffset, val); | 2021 WRITE_FIELD(this, kNextOffset, val); |
| (...skipping 6217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8238 #undef WRITE_BYTE_FIELD | 8239 #undef WRITE_BYTE_FIELD |
| 8239 #undef NOBARRIER_READ_BYTE_FIELD | 8240 #undef NOBARRIER_READ_BYTE_FIELD |
| 8240 #undef NOBARRIER_WRITE_BYTE_FIELD | 8241 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 8241 | 8242 |
| 8242 } // namespace internal | 8243 } // namespace internal |
| 8243 } // namespace v8 | 8244 } // namespace v8 |
| 8244 | 8245 |
| 8245 #include "src/objects/object-macros-undef.h" | 8246 #include "src/objects/object-macros-undef.h" |
| 8246 | 8247 |
| 8247 #endif // V8_OBJECTS_INL_H_ | 8248 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |