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 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2029 | 2029 |
2030 void PropertyCell::set_property_details(PropertyDetails details) { | 2030 void PropertyCell::set_property_details(PropertyDetails details) { |
2031 set_property_details_raw(details.AsSmi()); | 2031 set_property_details_raw(details.AsSmi()); |
2032 } | 2032 } |
2033 | 2033 |
2034 | 2034 |
2035 Object* WeakCell::value() const { return READ_FIELD(this, kValueOffset); } | 2035 Object* WeakCell::value() const { return READ_FIELD(this, kValueOffset); } |
2036 | 2036 |
2037 | 2037 |
2038 void WeakCell::clear() { | 2038 void WeakCell::clear() { |
2039 DCHECK(GetHeap()->gc_state() == Heap::MARK_COMPACT); | 2039 DCHECK(GetHeap()->gc_state() == Heap::MARK_COMPACT || value()->IsUndefined()); |
Michael Starzinger
2015/11/27 10:06:40
I assume this exception is just here because of th
mvstanton
2015/12/01 11:28:15
Good idea, done.
| |
2040 WRITE_FIELD(this, kValueOffset, Smi::FromInt(0)); | 2040 WRITE_FIELD(this, kValueOffset, Smi::FromInt(0)); |
2041 } | 2041 } |
2042 | 2042 |
2043 | 2043 |
2044 void WeakCell::initialize(HeapObject* val) { | 2044 void WeakCell::initialize(HeapObject* val) { |
2045 WRITE_FIELD(this, kValueOffset, val); | 2045 WRITE_FIELD(this, kValueOffset, val); |
2046 Heap* heap = GetHeap(); | 2046 Heap* heap = GetHeap(); |
2047 // We just have to execute the generational barrier here because we never | 2047 // We just have to execute the generational barrier here because we never |
2048 // mark through a weak cell and collect evacuation candidates when we process | 2048 // mark through a weak cell and collect evacuation candidates when we process |
2049 // all weak cells. | 2049 // all weak cells. |
(...skipping 5841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7891 #undef WRITE_INT64_FIELD | 7891 #undef WRITE_INT64_FIELD |
7892 #undef READ_BYTE_FIELD | 7892 #undef READ_BYTE_FIELD |
7893 #undef WRITE_BYTE_FIELD | 7893 #undef WRITE_BYTE_FIELD |
7894 #undef NOBARRIER_READ_BYTE_FIELD | 7894 #undef NOBARRIER_READ_BYTE_FIELD |
7895 #undef NOBARRIER_WRITE_BYTE_FIELD | 7895 #undef NOBARRIER_WRITE_BYTE_FIELD |
7896 | 7896 |
7897 } // namespace internal | 7897 } // namespace internal |
7898 } // namespace v8 | 7898 } // namespace v8 |
7899 | 7899 |
7900 #endif // V8_OBJECTS_INL_H_ | 7900 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |