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" |
11 #include "src/base/atomic-utils.h" | 11 #include "src/base/atomic-utils.h" |
12 #include "src/base/atomicops.h" | 12 #include "src/base/atomicops.h" |
13 #include "src/base/bits.h" | 13 #include "src/base/bits.h" |
| 14 #include "src/base/hashmap.h" |
14 #include "src/base/platform/mutex.h" | 15 #include "src/base/platform/mutex.h" |
15 #include "src/flags.h" | 16 #include "src/flags.h" |
16 #include "src/hashmap.h" | |
17 #include "src/list.h" | 17 #include "src/list.h" |
18 #include "src/objects.h" | 18 #include "src/objects.h" |
19 #include "src/utils.h" | 19 #include "src/utils.h" |
20 | 20 |
21 namespace v8 { | 21 namespace v8 { |
22 namespace internal { | 22 namespace internal { |
23 | 23 |
24 class AllocationInfo; | 24 class AllocationInfo; |
25 class AllocationObserver; | 25 class AllocationObserver; |
26 class CompactionSpace; | 26 class CompactionSpace; |
(...skipping 3050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3077 void ReportStatistics(); | 3077 void ReportStatistics(); |
3078 #endif | 3078 #endif |
3079 | 3079 |
3080 private: | 3080 private: |
3081 // The head of the linked list of large object chunks. | 3081 // The head of the linked list of large object chunks. |
3082 LargePage* first_page_; | 3082 LargePage* first_page_; |
3083 intptr_t size_; // allocated bytes | 3083 intptr_t size_; // allocated bytes |
3084 int page_count_; // number of chunks | 3084 int page_count_; // number of chunks |
3085 intptr_t objects_size_; // size of objects | 3085 intptr_t objects_size_; // size of objects |
3086 // Map MemoryChunk::kAlignment-aligned chunks to large pages covering them | 3086 // Map MemoryChunk::kAlignment-aligned chunks to large pages covering them |
3087 HashMap chunk_map_; | 3087 base::HashMap chunk_map_; |
3088 | 3088 |
3089 friend class LargeObjectIterator; | 3089 friend class LargeObjectIterator; |
3090 }; | 3090 }; |
3091 | 3091 |
3092 | 3092 |
3093 class LargeObjectIterator : public ObjectIterator { | 3093 class LargeObjectIterator : public ObjectIterator { |
3094 public: | 3094 public: |
3095 explicit LargeObjectIterator(LargeObjectSpace* space); | 3095 explicit LargeObjectIterator(LargeObjectSpace* space); |
3096 | 3096 |
3097 HeapObject* Next(); | 3097 HeapObject* Next(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3148 count = 0; | 3148 count = 0; |
3149 } | 3149 } |
3150 // Must be small, since an iteration is used for lookup. | 3150 // Must be small, since an iteration is used for lookup. |
3151 static const int kMaxComments = 64; | 3151 static const int kMaxComments = 64; |
3152 }; | 3152 }; |
3153 #endif | 3153 #endif |
3154 } // namespace internal | 3154 } // namespace internal |
3155 } // namespace v8 | 3155 } // namespace v8 |
3156 | 3156 |
3157 #endif // V8_HEAP_SPACES_H_ | 3157 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |