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 859 matching lines...) Loading... |
870 // Destroys all memory allocated by the heap. | 870 // Destroys all memory allocated by the heap. |
871 void TearDown(); | 871 void TearDown(); |
872 | 872 |
873 // Returns whether SetUp has been called. | 873 // Returns whether SetUp has been called. |
874 bool HasBeenSetUp(); | 874 bool HasBeenSetUp(); |
875 | 875 |
876 // =========================================================================== | 876 // =========================================================================== |
877 // Getters for spaces. ======================================================= | 877 // Getters for spaces. ======================================================= |
878 // =========================================================================== | 878 // =========================================================================== |
879 | 879 |
880 // Return the starting address and a mask for the new space. And-masking an | |
881 // address with the mask will result in the start address of the new space | |
882 // for all addresses in either semispace. | |
883 Address NewSpaceStart() { return new_space_.start(); } | |
884 Address NewSpaceTop() { return new_space_.top(); } | 880 Address NewSpaceTop() { return new_space_.top(); } |
885 | 881 |
886 NewSpace* new_space() { return &new_space_; } | 882 NewSpace* new_space() { return &new_space_; } |
887 OldSpace* old_space() { return old_space_; } | 883 OldSpace* old_space() { return old_space_; } |
888 OldSpace* code_space() { return code_space_; } | 884 OldSpace* code_space() { return code_space_; } |
889 MapSpace* map_space() { return map_space_; } | 885 MapSpace* map_space() { return map_space_; } |
890 LargeObjectSpace* lo_space() { return lo_space_; } | 886 LargeObjectSpace* lo_space() { return lo_space_; } |
891 | 887 |
892 PagedSpace* paged_space(int idx) { | 888 PagedSpace* paged_space(int idx) { |
893 switch (idx) { | 889 switch (idx) { |
(...skipping 1760 matching lines...) Loading... |
2654 friend class LargeObjectSpace; | 2650 friend class LargeObjectSpace; |
2655 friend class NewSpace; | 2651 friend class NewSpace; |
2656 friend class PagedSpace; | 2652 friend class PagedSpace; |
2657 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2653 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2658 }; | 2654 }; |
2659 | 2655 |
2660 } // namespace internal | 2656 } // namespace internal |
2661 } // namespace v8 | 2657 } // namespace v8 |
2662 | 2658 |
2663 #endif // V8_HEAP_HEAP_H_ | 2659 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |