Title: [295703] trunk/Source/_javascript_Core
Revision
295703
Author
[email protected]
Date
2022-06-21 16:57:05 -0700 (Tue, 21 Jun 2022)

Log 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

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/heap/GCIncomingRefCountedSet.h (295702 => 295703)


--- trunk/Source/_javascript_Core/heap/GCIncomingRefCountedSet.h	2022-06-21 23:51:24 UTC (rev 295702)
+++ trunk/Source/_javascript_Core/heap/GCIncomingRefCountedSet.h	2022-06-21 23:57:05 UTC (rev 295703)
@@ -44,7 +44,6 @@
     void sweep(VM&);
     
     size_t size() const { return m_bytes; };
-    void reduceSize(size_t);
     
 private:
     Vector<T*> m_vector;

Modified: trunk/Source/_javascript_Core/heap/GCIncomingRefCountedSetInlines.h (295702 => 295703)


--- trunk/Source/_javascript_Core/heap/GCIncomingRefCountedSetInlines.h	2022-06-21 23:51:24 UTC (rev 295702)
+++ trunk/Source/_javascript_Core/heap/GCIncomingRefCountedSetInlines.h	2022-06-21 23:57:05 UTC (rev 295703)
@@ -72,23 +72,6 @@
         m_vector[i--] = m_vector.last();
         m_vector.removeLast();
     }
-
-    constexpr bool verify = false;
-    if constexpr (verify) {
-        CheckedSize size;
-        for (size_t i = m_vector.size(); i--;) {
-            T* object = m_vector[i];
-            size += object->gcSizeEstimateInBytes();
-        }
-        ASSERT(m_bytes == size);
-    }
 }
 
-template<typename T>
-void GCIncomingRefCountedSet<T>::reduceSize(size_t bytes)
-{
-    ASSERT(m_bytes >= bytes);
-    m_bytes -= bytes;
-}
-
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (295702 => 295703)


--- trunk/Source/_javascript_Core/heap/Heap.cpp	2022-06-21 23:51:24 UTC (rev 295702)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp	2022-06-21 23:57:05 UTC (rev 295703)
@@ -659,11 +659,6 @@
     }
 }
 
-void Heap::reduceArrayBufferSize(size_t bytes)
-{
-    m_arrayBuffers.reduceSize(bytes);
-}
-
 template<typename CellType, typename CellSet>
 void Heap::finalizeMarkedUnconditionalFinalizers(CellSet& cellSet)
 {

Modified: trunk/Source/_javascript_Core/heap/Heap.h (295702 => 295703)


--- trunk/Source/_javascript_Core/heap/Heap.h	2022-06-21 23:51:24 UTC (rev 295702)
+++ trunk/Source/_javascript_Core/heap/Heap.h	2022-06-21 23:57:05 UTC (rev 295703)
@@ -439,7 +439,6 @@
     const JITStubRoutineSet& jitStubRoutines() { return *m_jitStubRoutines; }
     
     void addReference(JSCell*, ArrayBuffer*);
-    void reduceArrayBufferSize(size_t bytes);
     
     bool isDeferred() const { return !!m_deferralDepth; }
 

Modified: trunk/Source/_javascript_Core/runtime/ArrayBuffer.cpp (295702 => 295703)


--- trunk/Source/_javascript_Core/runtime/ArrayBuffer.cpp	2022-06-21 23:51:24 UTC (rev 295702)
+++ trunk/Source/_javascript_Core/runtime/ArrayBuffer.cpp	2022-06-21 23:57:05 UTC (rev 295703)
@@ -303,11 +303,8 @@
         return true;
     }
 
-    CheckedSize sizeReduced { gcSizeEstimateInBytes() };
     result = WTFMove(m_contents);
     notifyDetaching(vm);
-    sizeReduced -= gcSizeEstimateInBytes();
-    vm.heap.reduceArrayBufferSize(sizeReduced);
     return true;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to