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 2042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2053 | 2053 |
2054 | 2054 |
2055 void WeakCell::set_next(Object* val, WriteBarrierMode mode) { | 2055 void WeakCell::set_next(Object* val, WriteBarrierMode mode) { |
2056 WRITE_FIELD(this, kNextOffset, val); | 2056 WRITE_FIELD(this, kNextOffset, val); |
2057 if (mode == UPDATE_WRITE_BARRIER) { | 2057 if (mode == UPDATE_WRITE_BARRIER) { |
2058 WRITE_BARRIER(GetHeap(), this, kNextOffset, val); | 2058 WRITE_BARRIER(GetHeap(), this, kNextOffset, val); |
2059 } | 2059 } |
2060 } | 2060 } |
2061 | 2061 |
2062 | 2062 |
2063 void WeakCell::clear_next(Heap* heap) { | 2063 void WeakCell::clear_next(Object* the_hole_value) { |
2064 set_next(heap->the_hole_value(), SKIP_WRITE_BARRIER); | 2064 DCHECK_EQ(GetHeap()->the_hole_value(), the_hole_value); |
| 2065 set_next(the_hole_value, SKIP_WRITE_BARRIER); |
2065 } | 2066 } |
2066 | 2067 |
2067 | 2068 |
2068 bool WeakCell::next_cleared() { return next()->IsTheHole(); } | 2069 bool WeakCell::next_cleared() { return next()->IsTheHole(); } |
2069 | 2070 |
2070 | 2071 |
2071 int JSObject::GetHeaderSize() { return GetHeaderSize(map()->instance_type()); } | 2072 int JSObject::GetHeaderSize() { return GetHeaderSize(map()->instance_type()); } |
2072 | 2073 |
2073 | 2074 |
2074 int JSObject::GetHeaderSize(InstanceType type) { | 2075 int JSObject::GetHeaderSize(InstanceType type) { |
(...skipping 3407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5482 void Map::set_prototype_info(Object* value, WriteBarrierMode mode) { | 5483 void Map::set_prototype_info(Object* value, WriteBarrierMode mode) { |
5483 DCHECK(is_prototype_map()); | 5484 DCHECK(is_prototype_map()); |
5484 WRITE_FIELD(this, Map::kTransitionsOrPrototypeInfoOffset, value); | 5485 WRITE_FIELD(this, Map::kTransitionsOrPrototypeInfoOffset, value); |
5485 CONDITIONAL_WRITE_BARRIER( | 5486 CONDITIONAL_WRITE_BARRIER( |
5486 GetHeap(), this, Map::kTransitionsOrPrototypeInfoOffset, value, mode); | 5487 GetHeap(), this, Map::kTransitionsOrPrototypeInfoOffset, value, mode); |
5487 } | 5488 } |
5488 | 5489 |
5489 | 5490 |
5490 void Map::SetBackPointer(Object* value, WriteBarrierMode mode) { | 5491 void Map::SetBackPointer(Object* value, WriteBarrierMode mode) { |
5491 DCHECK(instance_type() >= FIRST_JS_RECEIVER_TYPE); | 5492 DCHECK(instance_type() >= FIRST_JS_RECEIVER_TYPE); |
5492 DCHECK((value->IsUndefined() && GetBackPointer()->IsMap()) || | 5493 DCHECK((value->IsMap() && GetBackPointer()->IsUndefined())); |
5493 (value->IsMap() && GetBackPointer()->IsUndefined())); | |
5494 DCHECK(!value->IsMap() || | 5494 DCHECK(!value->IsMap() || |
5495 Map::cast(value)->GetConstructor() == constructor_or_backpointer()); | 5495 Map::cast(value)->GetConstructor() == constructor_or_backpointer()); |
5496 set_constructor_or_backpointer(value, mode); | 5496 set_constructor_or_backpointer(value, mode); |
5497 } | 5497 } |
5498 | 5498 |
5499 | 5499 |
5500 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) | 5500 ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) |
5501 ACCESSORS(Map, dependent_code, DependentCode, kDependentCodeOffset) | 5501 ACCESSORS(Map, dependent_code, DependentCode, kDependentCodeOffset) |
5502 ACCESSORS(Map, weak_cell_cache, Object, kWeakCellCacheOffset) | 5502 ACCESSORS(Map, weak_cell_cache, Object, kWeakCellCacheOffset) |
5503 ACCESSORS(Map, constructor_or_backpointer, Object, | 5503 ACCESSORS(Map, constructor_or_backpointer, Object, |
(...skipping 2359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7863 #undef WRITE_INT64_FIELD | 7863 #undef WRITE_INT64_FIELD |
7864 #undef READ_BYTE_FIELD | 7864 #undef READ_BYTE_FIELD |
7865 #undef WRITE_BYTE_FIELD | 7865 #undef WRITE_BYTE_FIELD |
7866 #undef NOBARRIER_READ_BYTE_FIELD | 7866 #undef NOBARRIER_READ_BYTE_FIELD |
7867 #undef NOBARRIER_WRITE_BYTE_FIELD | 7867 #undef NOBARRIER_WRITE_BYTE_FIELD |
7868 | 7868 |
7869 } // namespace internal | 7869 } // namespace internal |
7870 } // namespace v8 | 7870 } // namespace v8 |
7871 | 7871 |
7872 #endif // V8_OBJECTS_INL_H_ | 7872 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |