Changeset 295703 in webkit for trunk/Source/JavaScriptCore/heap


Ignore:
Timestamp:
Jun 21, 2022, 4:57:05 PM (3 years ago)
Author:
[email protected]
Message:

Unreviewed, revert "The extraMemorySize() get wrong when transferring ArrayBuffer from Worker VM"
https://bugs.webkit.org/show_bug.cgi?id=241826
rdar://95384643

This reverts commit 71960bed2a3ee0917367bc4144911a9e8168deea.

m_extraMemorySize must be monotonically increasing during GC cycles until
full-collection happens. And after the full-collection, it is adjusted.
We already adjusted it in sweep of m_arrayBuffer, so, we should not reduce
that number. This is used for GC invocation scheduling. So, if we would like to
have a number which more precisely reflecting the current status,
then we should have yet another one. And we can still use extraMemorySize
since it will be adjusted after the full-collection. So we can consider
that transferred array-buffer is collected at the full-collection.

Canonical link: https://commits.webkit.org/251708@main

Location:
trunk/Source/JavaScriptCore/heap
Files:
4 edited

Legend:

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

    r295624 r295703  
    4545   
    4646    size_t size() const { return m_bytes; };
    47     void reduceSize(size_t);
    4847   
    4948private:
  • trunk/Source/JavaScriptCore/heap/GCIncomingRefCountedSetInlines.h

    r295624 r295703  
    7373        m_vector.removeLast();
    7474    }
    75 
    76     constexpr bool verify = false;
    77     if constexpr (verify) {
    78         CheckedSize size;
    79         for (size_t i = m_vector.size(); i--;) {
    80             T* object = m_vector[i];
    81             size += object->gcSizeEstimateInBytes();
    82         }
    83         ASSERT(m_bytes == size);
    84     }
    85 }
    86 
    87 template<typename T>
    88 void GCIncomingRefCountedSet<T>::reduceSize(size_t bytes)
    89 {
    90     ASSERT(m_bytes >= bytes);
    91     m_bytes -= bytes;
    9275}
    9376
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r295624 r295703  
    660660}
    661661
    662 void Heap::reduceArrayBufferSize(size_t bytes)
    663 {
    664     m_arrayBuffers.reduceSize(bytes);
    665 }
    666 
    667662template<typename CellType, typename CellSet>
    668663void Heap::finalizeMarkedUnconditionalFinalizers(CellSet& cellSet)
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r295624 r295703  
    440440   
    441441    void addReference(JSCell*, ArrayBuffer*);
    442     void reduceArrayBufferSize(size_t bytes);
    443442   
    444443    bool isDeferred() const { return !!m_deferralDepth; }
Note: See TracChangeset for help on using the changeset viewer.