| 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 2657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2668 | 2668 |
| 2669 protected: | 2669 protected: |
| 2670 virtual void VerifyObject(HeapObject* obj); | 2670 virtual void VerifyObject(HeapObject* obj); |
| 2671 | 2671 |
| 2672 public: | 2672 public: |
| 2673 TRACK_MEMORY("CellSpace") | 2673 TRACK_MEMORY("CellSpace") |
| 2674 }; | 2674 }; |
| 2675 | 2675 |
| 2676 | 2676 |
| 2677 // ----------------------------------------------------------------------------- | 2677 // ----------------------------------------------------------------------------- |
| 2678 // Old space for all global object property cell objects | |
| 2679 | |
| 2680 class PropertyCellSpace : public PagedSpace { | |
| 2681 public: | |
| 2682 // Creates a property cell space object with a maximum capacity. | |
| 2683 PropertyCellSpace(Heap* heap, intptr_t max_capacity, AllocationSpace id) | |
| 2684 : PagedSpace(heap, max_capacity, id, NOT_EXECUTABLE) {} | |
| 2685 | |
| 2686 virtual int RoundSizeDownToObjectAlignment(int size) { | |
| 2687 if (base::bits::IsPowerOfTwo32(PropertyCell::kSize)) { | |
| 2688 return RoundDown(size, PropertyCell::kSize); | |
| 2689 } else { | |
| 2690 return (size / PropertyCell::kSize) * PropertyCell::kSize; | |
| 2691 } | |
| 2692 } | |
| 2693 | |
| 2694 protected: | |
| 2695 virtual void VerifyObject(HeapObject* obj); | |
| 2696 | |
| 2697 public: | |
| 2698 TRACK_MEMORY("PropertyCellSpace") | |
| 2699 }; | |
| 2700 | |
| 2701 | |
| 2702 // ----------------------------------------------------------------------------- | |
| 2703 // Large objects ( > Page::kMaxHeapObjectSize ) are allocated and managed by | 2678 // Large objects ( > Page::kMaxHeapObjectSize ) are allocated and managed by |
| 2704 // the large object space. A large object is allocated from OS heap with | 2679 // the large object space. A large object is allocated from OS heap with |
| 2705 // extra padding bytes (Page::kPageSize + Page::kObjectStartOffset). | 2680 // extra padding bytes (Page::kPageSize + Page::kObjectStartOffset). |
| 2706 // A large object always starts at Page::kObjectStartOffset to a page. | 2681 // A large object always starts at Page::kObjectStartOffset to a page. |
| 2707 // Large objects do not move during garbage collections. | 2682 // Large objects do not move during garbage collections. |
| 2708 | 2683 |
| 2709 class LargeObjectSpace : public Space { | 2684 class LargeObjectSpace : public Space { |
| 2710 public: | 2685 public: |
| 2711 LargeObjectSpace(Heap* heap, intptr_t max_capacity, AllocationSpace id); | 2686 LargeObjectSpace(Heap* heap, intptr_t max_capacity, AllocationSpace id); |
| 2712 virtual ~LargeObjectSpace() {} | 2687 virtual ~LargeObjectSpace() {} |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2878 count = 0; | 2853 count = 0; |
| 2879 } | 2854 } |
| 2880 // Must be small, since an iteration is used for lookup. | 2855 // Must be small, since an iteration is used for lookup. |
| 2881 static const int kMaxComments = 64; | 2856 static const int kMaxComments = 64; |
| 2882 }; | 2857 }; |
| 2883 #endif | 2858 #endif |
| 2884 } | 2859 } |
| 2885 } // namespace v8::internal | 2860 } // namespace v8::internal |
| 2886 | 2861 |
| 2887 #endif // V8_HEAP_SPACES_H_ | 2862 #endif // V8_HEAP_SPACES_H_ |
| OLD | NEW |