| 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 #ifndef V8_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
| 6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 | 665 |
| 666 static bool RootIsImmortalImmovable(int root_index); | 666 static bool RootIsImmortalImmovable(int root_index); |
| 667 | 667 |
| 668 // Checks whether the space is valid. | 668 // Checks whether the space is valid. |
| 669 static bool IsValidAllocationSpace(AllocationSpace space); | 669 static bool IsValidAllocationSpace(AllocationSpace space); |
| 670 | 670 |
| 671 // Generated code can embed direct references to non-writable roots if | 671 // Generated code can embed direct references to non-writable roots if |
| 672 // they are in new space. | 672 // they are in new space. |
| 673 static bool RootCanBeWrittenAfterInitialization(RootListIndex root_index); | 673 static bool RootCanBeWrittenAfterInitialization(RootListIndex root_index); |
| 674 | 674 |
| 675 static bool IsUnmodifiedHeapObject(Object** p); |
| 676 |
| 675 // Zapping is needed for verify heap, and always done in debug builds. | 677 // Zapping is needed for verify heap, and always done in debug builds. |
| 676 static inline bool ShouldZapGarbage() { | 678 static inline bool ShouldZapGarbage() { |
| 677 #ifdef DEBUG | 679 #ifdef DEBUG |
| 678 return true; | 680 return true; |
| 679 #else | 681 #else |
| 680 #ifdef VERIFY_HEAP | 682 #ifdef VERIFY_HEAP |
| 681 return FLAG_verify_heap; | 683 return FLAG_verify_heap; |
| 682 #else | 684 #else |
| 683 return false; | 685 return false; |
| 684 #endif | 686 #endif |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 | 781 |
| 780 // Used in CreateAllocationSiteStub and the (de)serializer. | 782 // Used in CreateAllocationSiteStub and the (de)serializer. |
| 781 Object** allocation_sites_list_address() { return &allocation_sites_list_; } | 783 Object** allocation_sites_list_address() { return &allocation_sites_list_; } |
| 782 | 784 |
| 783 void set_encountered_weak_collections(Object* weak_collection) { | 785 void set_encountered_weak_collections(Object* weak_collection) { |
| 784 encountered_weak_collections_ = weak_collection; | 786 encountered_weak_collections_ = weak_collection; |
| 785 } | 787 } |
| 786 Object* encountered_weak_collections() const { | 788 Object* encountered_weak_collections() const { |
| 787 return encountered_weak_collections_; | 789 return encountered_weak_collections_; |
| 788 } | 790 } |
| 791 void VisitEncounteredWeakCollections(ObjectVisitor* visitor) { |
| 792 visitor->VisitPointer(&encountered_weak_collections_); |
| 793 } |
| 789 | 794 |
| 790 void set_encountered_weak_cells(Object* weak_cell) { | 795 void set_encountered_weak_cells(Object* weak_cell) { |
| 791 encountered_weak_cells_ = weak_cell; | 796 encountered_weak_cells_ = weak_cell; |
| 792 } | 797 } |
| 793 Object* encountered_weak_cells() const { return encountered_weak_cells_; } | 798 Object* encountered_weak_cells() const { return encountered_weak_cells_; } |
| 794 | 799 |
| 795 void set_encountered_transition_arrays(Object* transition_array) { | 800 void set_encountered_transition_arrays(Object* transition_array) { |
| 796 encountered_transition_arrays_ = transition_array; | 801 encountered_transition_arrays_ = transition_array; |
| 797 } | 802 } |
| 798 Object* encountered_transition_arrays() const { | 803 Object* encountered_transition_arrays() const { |
| (...skipping 1837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2636 friend class LargeObjectSpace; | 2641 friend class LargeObjectSpace; |
| 2637 friend class NewSpace; | 2642 friend class NewSpace; |
| 2638 friend class PagedSpace; | 2643 friend class PagedSpace; |
| 2639 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2644 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
| 2640 }; | 2645 }; |
| 2641 | 2646 |
| 2642 } // namespace internal | 2647 } // namespace internal |
| 2643 } // namespace v8 | 2648 } // namespace v8 |
| 2644 | 2649 |
| 2645 #endif // V8_HEAP_HEAP_H_ | 2650 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |