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 2684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2695 // ----------------------------------------------------------------------------- | 2695 // ----------------------------------------------------------------------------- |
2696 // Large objects ( > Page::kMaxHeapObjectSize ) are allocated and managed by | 2696 // Large objects ( > Page::kMaxHeapObjectSize ) are allocated and managed by |
2697 // the large object space. A large object is allocated from OS heap with | 2697 // the large object space. A large object is allocated from OS heap with |
2698 // extra padding bytes (Page::kPageSize + Page::kObjectStartOffset). | 2698 // extra padding bytes (Page::kPageSize + Page::kObjectStartOffset). |
2699 // A large object always starts at Page::kObjectStartOffset to a page. | 2699 // A large object always starts at Page::kObjectStartOffset to a page. |
2700 // Large objects do not move during garbage collections. | 2700 // Large objects do not move during garbage collections. |
2701 | 2701 |
2702 class LargeObjectSpace : public Space { | 2702 class LargeObjectSpace : public Space { |
2703 public: | 2703 public: |
2704 LargeObjectSpace(Heap* heap, AllocationSpace id); | 2704 LargeObjectSpace(Heap* heap, AllocationSpace id); |
2705 virtual ~LargeObjectSpace() {} | 2705 virtual ~LargeObjectSpace(); |
2706 | 2706 |
2707 // Initializes internal data structures. | 2707 // Initializes internal data structures. |
2708 bool SetUp(); | 2708 bool SetUp(); |
2709 | 2709 |
2710 // Releases internal resources, frees objects in this space. | 2710 // Releases internal resources, frees objects in this space. |
2711 void TearDown(); | 2711 void TearDown(); |
2712 | 2712 |
2713 static intptr_t ObjectSizeFor(intptr_t chunk_size) { | 2713 static intptr_t ObjectSizeFor(intptr_t chunk_size) { |
2714 if (chunk_size <= (Page::kPageSize + Page::kObjectStartOffset)) return 0; | 2714 if (chunk_size <= (Page::kPageSize + Page::kObjectStartOffset)) return 0; |
2715 return chunk_size - Page::kPageSize - Page::kObjectStartOffset; | 2715 return chunk_size - Page::kPageSize - Page::kObjectStartOffset; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2825 count = 0; | 2825 count = 0; |
2826 } | 2826 } |
2827 // Must be small, since an iteration is used for lookup. | 2827 // Must be small, since an iteration is used for lookup. |
2828 static const int kMaxComments = 64; | 2828 static const int kMaxComments = 64; |
2829 }; | 2829 }; |
2830 #endif | 2830 #endif |
2831 } | 2831 } |
2832 } // namespace v8::internal | 2832 } // namespace v8::internal |
2833 | 2833 |
2834 #endif // V8_HEAP_SPACES_H_ | 2834 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |