Title: [115391] trunk/Source/_javascript_Core
Revision
115391
Author
[email protected]
Date
2012-04-26 17:51:47 -0700 (Thu, 26 Apr 2012)

Log Message

Allocating WeakImpl should not trigger GC, as that makes the world very tricksy.
https://bugs.webkit.org/show_bug.cgi?id=85020

Reviewed by Gavin Barraclough.

Now in the event that we are unable to find an allocator for a new handle, just
add a new allocator rather than trying to recover "dead" handles through a GC.

Find allocator is now much simpler, and addAllocator directly reports the
increased memory usage to the heap without causing any GC to happen immediately.

* heap/WeakSet.cpp:
(JSC::WeakSet::findAllocator):
(JSC::WeakSet::addAllocator):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (115390 => 115391)


--- trunk/Source/_javascript_Core/ChangeLog	2012-04-27 00:49:59 UTC (rev 115390)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-04-27 00:51:47 UTC (rev 115391)
@@ -1,5 +1,22 @@
 2012-04-26  Oliver Hunt  <[email protected]>
 
+        Allocating WeakImpl should not trigger GC, as that makes the world very tricksy.
+        https://bugs.webkit.org/show_bug.cgi?id=85020
+
+        Reviewed by Gavin Barraclough.
+
+        Now in the event that we are unable to find an allocator for a new handle, just
+        add a new allocator rather than trying to recover "dead" handles through a GC.
+
+        Find allocator is now much simpler, and addAllocator directly reports the
+        increased memory usage to the heap without causing any GC to happen immediately.
+
+        * heap/WeakSet.cpp:
+        (JSC::WeakSet::findAllocator):
+        (JSC::WeakSet::addAllocator):
+
+2012-04-26  Oliver Hunt  <[email protected]>
+
         Remove RegisterFile::end()/m_end
         https://bugs.webkit.org/show_bug.cgi?id=85011
 

Modified: trunk/Source/_javascript_Core/heap/WeakSet.cpp (115390 => 115391)


--- trunk/Source/_javascript_Core/heap/WeakSet.cpp	2012-04-27 00:49:59 UTC (rev 115390)
+++ trunk/Source/_javascript_Core/heap/WeakSet.cpp	2012-04-27 00:51:47 UTC (rev 115391)
@@ -95,16 +95,6 @@
     if (WeakBlock::FreeCell* allocator = tryFindAllocator())
         return allocator;
 
-    // FIXME: This reporting of the amount allocated isn't quite accurate and 
-    // probably should be reworked eventually.
-    m_heap->didAllocate(WeakBlock::blockSize);
-    if (m_heap->shouldCollect()) {
-        m_heap->collect(Heap::DoNotSweep);
-
-        if (WeakBlock::FreeCell* allocator = tryFindAllocator())
-            return allocator;
-    }
-
     return addAllocator();
 }
 
@@ -126,6 +116,7 @@
 WeakBlock::FreeCell* WeakSet::addAllocator()
 {
     WeakBlock* block = WeakBlock::create();
+    m_heap->didAllocate(WeakBlock::blockSize);
     m_blocks.append(block);
     WeakBlock::SweepResult sweepResult = block->takeSweepResult();
     ASSERT(!sweepResult.isNull() && sweepResult.freeList);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to