OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef V8_HEAP_SPACES_H_ | 5 #ifndef V8_HEAP_SPACES_H_ |
6 #define V8_HEAP_SPACES_H_ | 6 #define V8_HEAP_SPACES_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <memory> | 9 #include <memory> |
10 #include <unordered_set> | 10 #include <unordered_set> |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 | 545 |
546 MemoryChunk* next_chunk() { return next_chunk_.Value(); } | 546 MemoryChunk* next_chunk() { return next_chunk_.Value(); } |
547 | 547 |
548 MemoryChunk* prev_chunk() { return prev_chunk_.Value(); } | 548 MemoryChunk* prev_chunk() { return prev_chunk_.Value(); } |
549 | 549 |
550 void set_next_chunk(MemoryChunk* next) { next_chunk_.SetValue(next); } | 550 void set_next_chunk(MemoryChunk* next) { next_chunk_.SetValue(next); } |
551 | 551 |
552 void set_prev_chunk(MemoryChunk* prev) { prev_chunk_.SetValue(prev); } | 552 void set_prev_chunk(MemoryChunk* prev) { prev_chunk_.SetValue(prev); } |
553 | 553 |
554 Space* owner() const { | 554 Space* owner() const { |
555 if ((reinterpret_cast<intptr_t>(owner_) & kPageHeaderTagMask) == | 555 intptr_t owner_value = base::NoBarrierAtomicValue<intptr_t>::FromAddress( |
556 kPageHeaderTag) { | 556 const_cast<Address*>(&owner_)) |
557 return reinterpret_cast<Space*>(reinterpret_cast<intptr_t>(owner_) - | 557 ->Value(); |
558 kPageHeaderTag); | 558 if ((owner_value & kPageHeaderTagMask) == kPageHeaderTag) { |
| 559 return reinterpret_cast<Space*>(owner_value - kPageHeaderTag); |
559 } else { | 560 } else { |
560 return nullptr; | 561 return nullptr; |
561 } | 562 } |
562 } | 563 } |
563 | 564 |
564 void set_owner(Space* space) { | 565 void set_owner(Space* space) { |
565 DCHECK((reinterpret_cast<intptr_t>(space) & kPageHeaderTagMask) == 0); | 566 DCHECK((reinterpret_cast<intptr_t>(space) & kPageHeaderTagMask) == 0); |
566 owner_ = reinterpret_cast<Address>(space) + kPageHeaderTag; | 567 owner_ = reinterpret_cast<Address>(space) + kPageHeaderTag; |
567 DCHECK((reinterpret_cast<intptr_t>(owner_) & kPageHeaderTagMask) == | 568 DCHECK((reinterpret_cast<intptr_t>(owner_) & kPageHeaderTagMask) == |
568 kPageHeaderTag); | 569 kPageHeaderTag); |
(...skipping 2332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2901 PageIterator old_iterator_; | 2902 PageIterator old_iterator_; |
2902 PageIterator code_iterator_; | 2903 PageIterator code_iterator_; |
2903 PageIterator map_iterator_; | 2904 PageIterator map_iterator_; |
2904 LargePageIterator lo_iterator_; | 2905 LargePageIterator lo_iterator_; |
2905 }; | 2906 }; |
2906 | 2907 |
2907 } // namespace internal | 2908 } // namespace internal |
2908 } // namespace v8 | 2909 } // namespace v8 |
2909 | 2910 |
2910 #endif // V8_HEAP_SPACES_H_ | 2911 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |