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 3039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3050 | 3050 |
3051 // Checks whether a heap object is in this space; O(1). | 3051 // Checks whether a heap object is in this space; O(1). |
3052 bool Contains(HeapObject* obj); | 3052 bool Contains(HeapObject* obj); |
3053 // Checks whether an address is in the object area in this space. Iterates | 3053 // Checks whether an address is in the object area in this space. Iterates |
3054 // all objects in the space. May be slow. | 3054 // all objects in the space. May be slow. |
3055 bool ContainsSlow(Address addr) { return FindObject(addr)->IsHeapObject(); } | 3055 bool ContainsSlow(Address addr) { return FindObject(addr)->IsHeapObject(); } |
3056 | 3056 |
3057 // Checks whether the space is empty. | 3057 // Checks whether the space is empty. |
3058 bool IsEmpty() { return first_page_ == NULL; } | 3058 bool IsEmpty() { return first_page_ == NULL; } |
3059 | 3059 |
| 3060 void AdjustLiveBytes(int by) { objects_size_ += by; } |
| 3061 |
3060 LargePage* first_page() { return first_page_; } | 3062 LargePage* first_page() { return first_page_; } |
3061 | 3063 |
3062 #ifdef VERIFY_HEAP | 3064 #ifdef VERIFY_HEAP |
3063 virtual void Verify(); | 3065 virtual void Verify(); |
3064 #endif | 3066 #endif |
3065 | 3067 |
3066 #ifdef DEBUG | 3068 #ifdef DEBUG |
3067 void Print() override; | 3069 void Print() override; |
3068 void ReportStatistics(); | 3070 void ReportStatistics(); |
3069 void CollectCodeStatistics(); | 3071 void CollectCodeStatistics(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3142 count = 0; | 3144 count = 0; |
3143 } | 3145 } |
3144 // Must be small, since an iteration is used for lookup. | 3146 // Must be small, since an iteration is used for lookup. |
3145 static const int kMaxComments = 64; | 3147 static const int kMaxComments = 64; |
3146 }; | 3148 }; |
3147 #endif | 3149 #endif |
3148 } // namespace internal | 3150 } // namespace internal |
3149 } // namespace v8 | 3151 } // namespace v8 |
3150 | 3152 |
3151 #endif // V8_HEAP_SPACES_H_ | 3153 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |