Ignore:
Timestamp:
Jan 20, 2019, 12:39:33 PM (7 years ago)
Author:
[email protected]
Message:

[JSC] Shrink data structure size in JSC/heap
https://bugs.webkit.org/show_bug.cgi?id=193612

Reviewed by Saam Barati.

This patch reduces the size of data structures in JSC/heap. Basically, we reorder the members to remove paddings.

For Subspace, we drop CellAttributes m_attributes. Instead, we use heapCellType->attributes(). And we use
FreeList::cellSize() instead of holding m_cellSize in LocalAllocator.

This change reduces the size of JSC::VM too since it includes JSC::Heap. The size of VM becomes from 78208 to 76696.

  • heap/BlockDirectory.cpp:
  • heap/BlockDirectory.h:
  • heap/CollectionScope.h:
  • heap/CompleteSubspace.cpp:

(JSC::CompleteSubspace::allocatorForSlow):

  • heap/FreeList.h:

(JSC::FreeList::offsetOfCellSize):
(JSC::FreeList::cellSize const):

  • heap/Heap.cpp:

(JSC::Heap::Heap):
(JSC::Heap::updateObjectCounts):
(JSC::Heap::addToRememberedSet):
(JSC::Heap::runBeginPhase):
(JSC::Heap::willStartCollection):
(JSC::Heap::pruneStaleEntriesFromWeakGCMaps):
(JSC::Heap::deleteSourceProviderCaches):
(JSC::Heap::notifyIncrementalSweeper):
(JSC::Heap::updateAllocationLimits):

  • heap/Heap.h:
  • heap/IsoAlignedMemoryAllocator.h:
  • heap/LargeAllocation.cpp:
  • heap/LocalAllocator.cpp:

(JSC::LocalAllocator::LocalAllocator):

  • heap/LocalAllocator.h:

(JSC::LocalAllocator::cellSize const):
(JSC::LocalAllocator::offsetOfCellSize):

  • heap/MarkedSpace.cpp:

(JSC::MarkedSpace::MarkedSpace):

  • heap/MarkedSpace.h:
  • heap/MarkingConstraint.h:
  • heap/Subspace.cpp:

(JSC::Subspace::initialize):

  • heap/Subspace.h:

(JSC::Subspace::attributes const): Deleted.

  • heap/SubspaceInlines.h:

(JSC::Subspace::forEachMarkedCell):
(JSC::Subspace::forEachMarkedCellInParallel):
(JSC::Subspace::forEachLiveCell):
(JSC::Subspace::attributes const):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/MarkingConstraint.h

    r226783 r240216  
    8383    friend class MarkingConstraintSet; // So it can set m_index.
    8484   
    85     unsigned m_index { UINT_MAX };
    8685    CString m_abbreviatedName;
    8786    CString m_name;
     87    size_t m_lastVisitCount { 0 };
     88    unsigned m_index { UINT_MAX };
    8889    ConstraintVolatility m_volatility;
    8990    ConstraintConcurrency m_concurrency;
    9091    ConstraintParallelism m_parallelism;
    91     size_t m_lastVisitCount { 0 };
    9292    Lock m_lock;
    9393};
Note: See TracChangeset for help on using the changeset viewer.