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 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 3033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3044 // Finds a large object page containing the given address, returns NULL | 3044 // Finds a large object page containing the given address, returns NULL |
3045 // if such a page doesn't exist. | 3045 // if such a page doesn't exist. |
3046 LargePage* FindPage(Address a); | 3046 LargePage* FindPage(Address a); |
3047 | 3047 |
3048 // Clears the marking state of live objects. | 3048 // Clears the marking state of live objects. |
3049 void ClearMarkingStateOfLiveObjects(); | 3049 void ClearMarkingStateOfLiveObjects(); |
3050 | 3050 |
3051 // Frees unmarked objects. | 3051 // Frees unmarked objects. |
3052 void FreeUnmarkedObjects(); | 3052 void FreeUnmarkedObjects(); |
3053 | 3053 |
3054 void InsertChunkMapEntries(LargePage* page); | |
3055 void RemoveChunkMapEntries(LargePage* page); | |
3056 void RemoveChunkMapEntries(LargePage* page, Address free_start); | |
3057 | |
3058 // Checks whether a heap object is in this space; O(1). | 3054 // Checks whether a heap object is in this space; O(1). |
3059 bool Contains(HeapObject* obj); | 3055 bool Contains(HeapObject* obj); |
3060 // Checks whether an address is in the object area in this space. Iterates | 3056 // Checks whether an address is in the object area in this space. Iterates |
3061 // all objects in the space. May be slow. | 3057 // all objects in the space. May be slow. |
3062 bool ContainsSlow(Address addr) { return FindObject(addr)->IsHeapObject(); } | 3058 bool ContainsSlow(Address addr) { return FindObject(addr)->IsHeapObject(); } |
3063 | 3059 |
3064 // Checks whether the space is empty. | 3060 // Checks whether the space is empty. |
3065 bool IsEmpty() { return first_page_ == NULL; } | 3061 bool IsEmpty() { return first_page_ == NULL; } |
3066 | 3062 |
3067 void AdjustLiveBytes(int by) { objects_size_ += by; } | 3063 void AdjustLiveBytes(int by) { objects_size_ += by; } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3151 count = 0; | 3147 count = 0; |
3152 } | 3148 } |
3153 // Must be small, since an iteration is used for lookup. | 3149 // Must be small, since an iteration is used for lookup. |
3154 static const int kMaxComments = 64; | 3150 static const int kMaxComments = 64; |
3155 }; | 3151 }; |
3156 #endif | 3152 #endif |
3157 } // namespace internal | 3153 } // namespace internal |
3158 } // namespace v8 | 3154 } // namespace v8 |
3159 | 3155 |
3160 #endif // V8_HEAP_SPACES_H_ | 3156 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |