Changeset 134080 in webkit for trunk/Source/JavaScriptCore/heap/MarkStack.h
- Timestamp:
- Nov 9, 2012, 9:58:19 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/MarkStack.h
r128084 r134080 51 51 #endif 52 52 53 #include "HeapBlock.h" 53 54 #include <wtf/StdLibExtras.h> 54 #include <wtf/TCSpinLock.h>55 55 56 56 namespace JSC { 57 57 58 class BlockAllocator; 59 class DeadBlock; 58 60 class JSCell; 59 61 60 struct MarkStackSegment { 61 MarkStackSegment* m_previous; 62 class MarkStackSegment : public HeapBlock<MarkStackSegment> { 63 public: 64 MarkStackSegment(Region* region) 65 : HeapBlock<MarkStackSegment>(region) 62 66 #if !ASSERT_DISABLED 63 size_t m_top;67 , m_top(0) 64 68 #endif 65 69 { 70 } 71 72 static MarkStackSegment* create(DeadBlock*); 73 66 74 const JSCell** data() 67 75 { … … 78 86 return sizeof(MarkStackSegment) + capacity * sizeof(const JSCell*); 79 87 } 80 };81 88 82 class MarkStackSegmentAllocator { 83 public: 84 MarkStackSegmentAllocator(); 85 ~MarkStackSegmentAllocator(); 86 87 MarkStackSegment* allocate(); 88 void release(MarkStackSegment*); 89 90 void shrinkReserve(); 91 92 private: 93 SpinLock m_lock; 94 MarkStackSegment* m_nextFreeSegment; 89 static const size_t blockSize = 4 * KB; 90 91 #if !ASSERT_DISABLED 92 size_t m_top; 93 #endif 95 94 }; 96 95 97 96 class MarkStackArray { 98 97 public: 99 MarkStackArray( MarkStackSegmentAllocator&);98 MarkStackArray(BlockAllocator&); 100 99 ~MarkStackArray(); 101 100 … … 123 122 void validatePrevious(); 124 123 125 MarkStackSegment* m_topSegment;126 MarkStackSegmentAllocator& m_allocator;124 DoublyLinkedList<MarkStackSegment> m_segments; 125 BlockAllocator& m_blockAllocator; 127 126 128 127 size_t m_segmentCapacity; 129 128 size_t m_top; 130 size_t m_numberOf PreviousSegments;129 size_t m_numberOfSegments; 131 130 132 131 };
Note:
See TracChangeset
for help on using the changeset viewer.