[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

ggaren at apple.com ggaren at apple.com
Mon Feb 21 00:21:50 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 13bb8583391b01e42cd803adf91045bd485635f2
Author: ggaren at apple.com <ggaren at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Jan 30 06:11:07 2011 +0000

    2011-01-29  Geoffrey Garen  <ggaren at apple.com>
    
            Reviewed by Cameron Zwarich.
    
            Simplified heap destruction
            https://bugs.webkit.org/show_bug.cgi?id=53392
    
            * JavaScriptCore.exp:
            * runtime/Heap.cpp:
            (JSC::Heap::destroy):
            * runtime/Heap.h:
            * runtime/MarkedSpace.cpp:
            (JSC::MarkedSpace::destroy):
            * runtime/MarkedSpace.h: Don't go out of our way to destroy GC-protected
            cells last -- the difficult contortions required to do so just don't seem
            justified. We make no guarantees about GC protection after the client
            throws away JSGlobalData, and it doesn't seem like any meaningful
            guarantee is even possible.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77081 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index d52f914..29a475c 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,5 +1,24 @@
 2011-01-29  Geoffrey Garen  <ggaren at apple.com>
 
+        Reviewed by Cameron Zwarich.
+
+        Simplified heap destruction
+        https://bugs.webkit.org/show_bug.cgi?id=53392
+
+        * JavaScriptCore.exp:
+        * runtime/Heap.cpp:
+        (JSC::Heap::destroy):
+        * runtime/Heap.h:
+        * runtime/MarkedSpace.cpp:
+        (JSC::MarkedSpace::destroy):
+        * runtime/MarkedSpace.h: Don't go out of our way to destroy GC-protected
+        cells last -- the difficult contortions required to do so just don't seem
+        justified. We make no guarantees about GC protection after the client
+        throws away JSGlobalData, and it doesn't seem like any meaningful
+        guarantee is even possible.
+
+2011-01-29  Geoffrey Garen  <ggaren at apple.com>
+
         Reviewed by Maciej Stachowiak.
 
         Switched heap to use the Bitmap class and removed CollectorBitmap
diff --git a/Source/JavaScriptCore/JavaScriptCore.exp b/Source/JavaScriptCore/JavaScriptCore.exp
index 9547443..5f2eea1 100644
--- a/Source/JavaScriptCore/JavaScriptCore.exp
+++ b/Source/JavaScriptCore/JavaScriptCore.exp
@@ -196,7 +196,6 @@ __ZN3JSC19SourceProviderCacheD1Ev
 __ZN3JSC19initializeThreadingEv
 __ZN3JSC20MarkedArgumentBuffer10slowAppendENS_7JSValueE
 __ZN3JSC20createReferenceErrorEPNS_9ExecStateERKNS_7UStringE
-__ZN3JSC22globalMemoryStatisticsEv
 __ZN3JSC23AbstractSamplingCounter4dumpEv
 __ZN3JSC23objectProtoFuncToStringEPNS_9ExecStateE
 __ZN3JSC23setUpStaticFunctionSlotEPNS_9ExecStateEPKNS_9HashEntryEPNS_8JSObjectERKNS_10IdentifierERNS_12PropertySlotE
@@ -519,7 +518,6 @@ __ZNK3JSC18PropertyDescriptor8writableEv
 __ZNK3JSC19SourceProviderCache8byteSizeEv
 __ZNK3JSC24JSObjectWithGlobalObject12globalObjectEv
 __ZNK3JSC4Heap11objectCountEv
-__ZNK3JSC4Heap4sizeEv
 __ZNK3JSC4Heap8capacityEv
 __ZNK3JSC6JSCell11toPrimitiveEPNS_9ExecStateENS_22PreferredPrimitiveTypeE
 __ZNK3JSC6JSCell12toThisObjectEPNS_9ExecStateE
diff --git a/Source/JavaScriptCore/runtime/Heap.cpp b/Source/JavaScriptCore/runtime/Heap.cpp
index 7af0d3d..bdde63d 100644
--- a/Source/JavaScriptCore/runtime/Heap.cpp
+++ b/Source/JavaScriptCore/runtime/Heap.cpp
@@ -72,9 +72,7 @@ void Heap::destroy()
     delete m_markListSet;
     m_markListSet = 0;
 
-    ProtectCountSet protectedValuesCopy = m_protectedValues;
-    m_markedSpace.destroy(protectedValuesCopy);
-    ASSERT(!protectedObjectCount());
+    m_markedSpace.destroy();
 
     m_globalData = 0;
 }
diff --git a/Source/JavaScriptCore/runtime/Heap.h b/Source/JavaScriptCore/runtime/Heap.h
index bf8c317..42b5030 100644
--- a/Source/JavaScriptCore/runtime/Heap.h
+++ b/Source/JavaScriptCore/runtime/Heap.h
@@ -44,6 +44,7 @@ namespace JSC {
     class WeakGCHandlePool;
 
     typedef std::pair<JSValue, UString> ValueStringPair;
+    typedef HashCountedSet<JSCell*> ProtectCountSet;
 
     enum OperationInProgress { NoOperation, Allocation, Collection };
 
diff --git a/Source/JavaScriptCore/runtime/MarkedSpace.cpp b/Source/JavaScriptCore/runtime/MarkedSpace.cpp
index f26e4f2..9cf8dea 100644
--- a/Source/JavaScriptCore/runtime/MarkedSpace.cpp
+++ b/Source/JavaScriptCore/runtime/MarkedSpace.cpp
@@ -48,27 +48,10 @@ MarkedSpace::MarkedSpace(JSGlobalData* globalData)
     allocateBlock();
 }
 
-void MarkedSpace::destroy(ProtectCountSet& protectedValuesCopy)
+void MarkedSpace::destroy()
 {
-    clearMarkBits();
-    ProtectCountSet::iterator protectedValuesEnd = protectedValuesCopy.end();
-    for (ProtectCountSet::iterator it = protectedValuesCopy.begin(); it != protectedValuesEnd; ++it)
-        markCell(it->first);
-
-    m_heap.nextCell = 0;
-    m_heap.nextBlock = 0;
-    DeadObjectIterator it(m_heap, m_heap.nextBlock, m_heap.nextCell);
-    DeadObjectIterator end(m_heap, m_heap.usedBlocks);
-    for ( ; it != end; ++it)
-        (*it)->~JSCell();
-
-    protectedValuesEnd = protectedValuesCopy.end();
-    for (ProtectCountSet::iterator it = protectedValuesCopy.begin(); it != protectedValuesEnd; ++it)
-        it->first->~JSCell();
-
     for (size_t block = 0; block < m_heap.usedBlocks; ++block)
-        m_heap.blocks[block].deallocate();
-
+        freeBlock(block);
     fastFree(m_heap.blocks);
 
     memset(&m_heap, 0, sizeof(CollectorHeap));
diff --git a/Source/JavaScriptCore/runtime/MarkedSpace.h b/Source/JavaScriptCore/runtime/MarkedSpace.h
index a51e697..5f1633b 100644
--- a/Source/JavaScriptCore/runtime/MarkedSpace.h
+++ b/Source/JavaScriptCore/runtime/MarkedSpace.h
@@ -46,8 +46,6 @@ namespace JSC {
     const size_t BLOCK_SIZE = 256 * 1024; // 256k
 #endif
 
-    typedef HashCountedSet<JSCell*> ProtectCountSet;
-
     struct CollectorHeap {
         size_t nextBlock;
         size_t nextCell;
@@ -72,7 +70,7 @@ namespace JSC {
         static void markCell(JSCell*);
 
         MarkedSpace(JSGlobalData*);
-        void destroy(ProtectCountSet&);
+        void destroy();
 
         JSGlobalData* globalData() { return m_globalData; }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list