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 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2073 | 2073 |
2074 | 2074 |
2075 void WeakCell::set_next(Object* val, WriteBarrierMode mode) { | 2075 void WeakCell::set_next(Object* val, WriteBarrierMode mode) { |
2076 WRITE_FIELD(this, kNextOffset, val); | 2076 WRITE_FIELD(this, kNextOffset, val); |
2077 if (mode == UPDATE_WRITE_BARRIER) { | 2077 if (mode == UPDATE_WRITE_BARRIER) { |
2078 WRITE_BARRIER(GetHeap(), this, kNextOffset, val); | 2078 WRITE_BARRIER(GetHeap(), this, kNextOffset, val); |
2079 } | 2079 } |
2080 } | 2080 } |
2081 | 2081 |
2082 | 2082 |
2083 void WeakCell::clear_next(Heap* heap) { | 2083 void WeakCell::clear_next(Object* the_hole_value) { |
2084 set_next(heap->the_hole_value(), SKIP_WRITE_BARRIER); | 2084 set_next(the_hole_value, SKIP_WRITE_BARRIER); |
Hannes Payer (out of office)
2015/12/08 14:19:41
Let's DCHECK that the_hole_value is the hole value
ulan
2015/12/08 16:25:04
Done.
| |
2085 } | 2085 } |
2086 | 2086 |
2087 | 2087 |
2088 bool WeakCell::next_cleared() { return next()->IsTheHole(); } | 2088 bool WeakCell::next_cleared() { return next()->IsTheHole(); } |
2089 | 2089 |
2090 | 2090 |
2091 int JSObject::GetHeaderSize() { return GetHeaderSize(map()->instance_type()); } | 2091 int JSObject::GetHeaderSize() { return GetHeaderSize(map()->instance_type()); } |
2092 | 2092 |
2093 | 2093 |
2094 int JSObject::GetHeaderSize(InstanceType type) { | 2094 int JSObject::GetHeaderSize(InstanceType type) { |
(...skipping 3404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5499 void Map::set_prototype_info(Object* value, WriteBarrierMode mode) { | 5499 void Map::set_prototype_info(Object* value, WriteBarrierMode mode) { |
5500 DCHECK(is_prototype_map()); | 5500 DCHECK(is_prototype_map()); |
5501 WRITE_FIELD(this, Map::kTransitionsOrPrototypeInfoOffset, value); | 5501 WRITE_FIELD(this, Map::kTransitionsOrPrototypeInfoOffset, value); |
5502 CONDITIONAL_WRITE_BARRIER( | 5502 CONDITIONAL_WRITE_BARRIER( |
5503 GetHeap(), this, Map::kTransitionsOrPrototypeInfoOffset, value, mode); | 5503 GetHeap(), this, Map::kTransitionsOrPrototypeInfoOffset, value, mode); |
5504 } | 5504 } |
5505 | 5505 |
5506 | 5506 |
5507 void Map::SetBackPointer(Object* value, WriteBarrierMode mode) { | 5507 void Map::SetBackPointer(Object* value, WriteBarrierMode mode) { |
5508 DCHECK(instance_type() >= FIRST_JS_RECEIVER_TYPE); | 5508 DCHECK(instance_type() >= FIRST_JS_RECEIVER_TYPE); |
5509 DCHECK((value->IsUndefined() && GetBackPointer()->IsMap()) || | 5509 DCHECK((value->IsMap() && GetBackPointer()->IsUndefined())); |
5510 (value->IsMap() && GetBackPointer()->IsUndefined())); | |
5511 DCHECK(!value->IsMap() || | 5510 DCHECK(!value->IsMap() || |
5512 Map::cast(value)->GetConstructor() == constructor_or_backpointer()); | 5511 Map::cast(value)->GetConstructor() == constructor_or_backpointer()); |
5513 set_constructor_or_backpointer(value, mode); | 5512 set_constructor_or_backpointer(value, mode); |
5514 } | 5513 } |
5515 | 5514 |
5516 | 5515 |
5517 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) | 5516 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) |
5518 ACCESSORS(Map, dependent_code, DependentCode, kDependentCodeOffset) | 5517 ACCESSORS(Map, dependent_code, DependentCode, kDependentCodeOffset) |
5519 ACCESSORS(Map, weak_cell_cache, Object, kWeakCellCacheOffset) | 5518 ACCESSORS(Map, weak_cell_cache, Object, kWeakCellCacheOffset) |
5520 ACCESSORS(Map, constructor_or_backpointer, Object, | 5519 ACCESSORS(Map, constructor_or_backpointer, Object, |
(...skipping 2348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7869 #undef WRITE_INT64_FIELD | 7868 #undef WRITE_INT64_FIELD |
7870 #undef READ_BYTE_FIELD | 7869 #undef READ_BYTE_FIELD |
7871 #undef WRITE_BYTE_FIELD | 7870 #undef WRITE_BYTE_FIELD |
7872 #undef NOBARRIER_READ_BYTE_FIELD | 7871 #undef NOBARRIER_READ_BYTE_FIELD |
7873 #undef NOBARRIER_WRITE_BYTE_FIELD | 7872 #undef NOBARRIER_WRITE_BYTE_FIELD |
7874 | 7873 |
7875 } // namespace internal | 7874 } // namespace internal |
7876 } // namespace v8 | 7875 } // namespace v8 |
7877 | 7876 |
7878 #endif // V8_OBJECTS_INL_H_ | 7877 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |