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