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 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2104 this == GetHeap()->empty_weak_cell()); | 2104 this == GetHeap()->empty_weak_cell()); |
2105 WRITE_FIELD(this, kValueOffset, Smi::kZero); | 2105 WRITE_FIELD(this, kValueOffset, Smi::kZero); |
2106 } | 2106 } |
2107 | 2107 |
2108 | 2108 |
2109 void WeakCell::initialize(HeapObject* val) { | 2109 void WeakCell::initialize(HeapObject* val) { |
2110 WRITE_FIELD(this, kValueOffset, val); | 2110 WRITE_FIELD(this, kValueOffset, val); |
2111 // We just have to execute the generational barrier here because we never | 2111 // We just have to execute the generational barrier here because we never |
2112 // mark through a weak cell and collect evacuation candidates when we process | 2112 // mark through a weak cell and collect evacuation candidates when we process |
2113 // all weak cells. | 2113 // all weak cells. |
2114 WriteBarrierMode mode = Marking::IsBlack(ObjectMarking::MarkBitFrom(this)) | 2114 WriteBarrierMode mode = ObjectMarking::IsBlack(this) |
2115 ? UPDATE_WRITE_BARRIER | 2115 ? UPDATE_WRITE_BARRIER |
2116 : UPDATE_WEAK_WRITE_BARRIER; | 2116 : UPDATE_WEAK_WRITE_BARRIER; |
2117 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kValueOffset, val, mode); | 2117 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kValueOffset, val, mode); |
2118 } | 2118 } |
2119 | 2119 |
2120 bool WeakCell::cleared() const { return value() == Smi::kZero; } | 2120 bool WeakCell::cleared() const { return value() == Smi::kZero; } |
2121 | 2121 |
2122 Object* WeakCell::next() const { return READ_FIELD(this, kNextOffset); } | 2122 Object* WeakCell::next() const { return READ_FIELD(this, kNextOffset); } |
2123 | 2123 |
2124 | 2124 |
(...skipping 6285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8410 #undef WRITE_INT64_FIELD | 8410 #undef WRITE_INT64_FIELD |
8411 #undef READ_BYTE_FIELD | 8411 #undef READ_BYTE_FIELD |
8412 #undef WRITE_BYTE_FIELD | 8412 #undef WRITE_BYTE_FIELD |
8413 #undef NOBARRIER_READ_BYTE_FIELD | 8413 #undef NOBARRIER_READ_BYTE_FIELD |
8414 #undef NOBARRIER_WRITE_BYTE_FIELD | 8414 #undef NOBARRIER_WRITE_BYTE_FIELD |
8415 | 8415 |
8416 } // namespace internal | 8416 } // namespace internal |
8417 } // namespace v8 | 8417 } // namespace v8 |
8418 | 8418 |
8419 #endif // V8_OBJECTS_INL_H_ | 8419 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |