Changeset 162017 in webkit for trunk/Source/JavaScriptCore/heap/CopiedBlockInlines.h
- Timestamp:
- Jan 14, 2014, 3:03:01 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/CopiedBlockInlines.h
r161615 r162017 27 27 #define CopiedBlockInlines_h 28 28 29 #include "ClassInfo.h" 29 30 #include "CopiedBlock.h" 30 31 #include "Heap.h" 32 #include "MarkedBlock.h" 31 33 32 34 namespace JSC { 33 35 34 inline void CopiedBlock::reportLiveBytes(JSCell* owner, CopyToken token, unsigned bytes)36 inline bool CopiedBlock::shouldReportLiveBytes(SpinLockHolder&, JSCell* owner) 35 37 { 36 #if ENABLE(PARALLEL_GC) 37 SpinLockHolder locker(&m_workListLock); 38 #endif 38 // We want to add to live bytes if the owner isn't part of the remembered set or 39 // if this block was allocated during the last cycle. 40 // If we always added live bytes we would double count for elements in the remembered 41 // set across collections. 42 // If we didn't always add live bytes to new blocks, we'd get too few. 43 bool ownerIsRemembered = MarkedBlock::blockFor(owner)->isRemembered(owner); 44 return !ownerIsRemembered || !m_isOld; 45 } 46 47 inline void CopiedBlock::reportLiveBytes(SpinLockHolder&, JSCell* owner, CopyToken token, unsigned bytes) 48 { 49 checkConsistency(); 39 50 #ifndef NDEBUG 40 checkConsistency();41 51 m_liveObjects++; 42 52 #endif 43 53 m_liveBytes += bytes; 54 checkConsistency(); 55 ASSERT(m_liveBytes <= CopiedBlock::blockSize); 44 56 45 57 if (isPinned()) … … 57 69 } 58 70 71 inline void CopiedBlock::reportLiveBytesDuringCopying(unsigned bytes) 72 { 73 checkConsistency(); 74 // This doesn't need to be locked because the thread that calls this function owns the current block. 75 m_isOld = true; 76 #ifndef NDEBUG 77 m_liveObjects++; 78 #endif 79 m_liveBytes += bytes; 80 checkConsistency(); 81 ASSERT(m_liveBytes <= CopiedBlock::blockSize); 82 } 83 59 84 } // namespace JSC 60 85
Note:
See TracChangeset
for help on using the changeset viewer.