| 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 "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 2726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2737 int PageCount() { return page_count_; } | 2737 int PageCount() { return page_count_; } |
| 2738 | 2738 |
| 2739 // Finds an object for a given address, returns a Smi if it is not found. | 2739 // Finds an object for a given address, returns a Smi if it is not found. |
| 2740 // The function iterates through all objects in this space, may be slow. | 2740 // The function iterates through all objects in this space, may be slow. |
| 2741 Object* FindObject(Address a); | 2741 Object* FindObject(Address a); |
| 2742 | 2742 |
| 2743 // Finds a large object page containing the given address, returns NULL | 2743 // Finds a large object page containing the given address, returns NULL |
| 2744 // if such a page doesn't exist. | 2744 // if such a page doesn't exist. |
| 2745 LargePage* FindPage(Address a); | 2745 LargePage* FindPage(Address a); |
| 2746 | 2746 |
| 2747 // Clears the marking state of live objects. |
| 2748 void ClearMarkingStateOfLiveObjects(); |
| 2749 |
| 2747 // Frees unmarked objects. | 2750 // Frees unmarked objects. |
| 2748 void FreeUnmarkedObjects(); | 2751 void FreeUnmarkedObjects(); |
| 2749 | 2752 |
| 2750 // Checks whether a heap object is in this space; O(1). | 2753 // Checks whether a heap object is in this space; O(1). |
| 2751 bool Contains(HeapObject* obj); | 2754 bool Contains(HeapObject* obj); |
| 2752 | 2755 |
| 2753 // Checks whether the space is empty. | 2756 // Checks whether the space is empty. |
| 2754 bool IsEmpty() { return first_page_ == NULL; } | 2757 bool IsEmpty() { return first_page_ == NULL; } |
| 2755 | 2758 |
| 2756 LargePage* first_page() { return first_page_; } | 2759 LargePage* first_page() { return first_page_; } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2825 count = 0; | 2828 count = 0; |
| 2826 } | 2829 } |
| 2827 // Must be small, since an iteration is used for lookup. | 2830 // Must be small, since an iteration is used for lookup. |
| 2828 static const int kMaxComments = 64; | 2831 static const int kMaxComments = 64; |
| 2829 }; | 2832 }; |
| 2830 #endif | 2833 #endif |
| 2831 } | 2834 } |
| 2832 } // namespace v8::internal | 2835 } // namespace v8::internal |
| 2833 | 2836 |
| 2834 #endif // V8_HEAP_SPACES_H_ | 2837 #endif // V8_HEAP_SPACES_H_ |
| OLD | NEW |