Rolled back in a piece of <http://trac.webkit.org/changeset/127293>.
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Sep 2012 00:08:18 +0000 (00:08 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Sep 2012 00:08:18 +0000 (00:08 +0000)
    Shrink activation objects by half
    https://bugs.webkit.org/show_bug.cgi?id=95591

    Reviewed by Sam Weinig.

* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::MarkedBlock):
* heap/MarkedBlock.h:
(MarkedBlock):
(JSC::MarkedBlock::globalData):
(JSC):
* heap/WeakSet.cpp:
(JSC::WeakSet::addAllocator):
* heap/WeakSet.h:
(WeakSet):
(JSC::WeakSet::WeakSet):
(JSC::WeakSet::globalData):
* runtime/JSGlobalData.h:
(JSC::WeakSet::heap):
(JSC):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127338 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/heap/MarkedBlock.cpp
Source/JavaScriptCore/heap/MarkedBlock.h
Source/JavaScriptCore/heap/WeakSet.cpp
Source/JavaScriptCore/heap/WeakSet.h
Source/JavaScriptCore/runtime/JSGlobalData.h

index 6d5ac88..6921d04 100644 (file)
@@ -1,3 +1,28 @@
+2012-08-31  Geoffrey Garen  <ggaren@apple.com>
+
+        Rolled back in a piece of <http://trac.webkit.org/changeset/127293>.
+
+            Shrink activation objects by half
+            https://bugs.webkit.org/show_bug.cgi?id=95591
+
+            Reviewed by Sam Weinig.
+
+        * heap/MarkedBlock.cpp:
+        (JSC::MarkedBlock::MarkedBlock):
+        * heap/MarkedBlock.h:
+        (MarkedBlock):
+        (JSC::MarkedBlock::globalData):
+        (JSC):
+        * heap/WeakSet.cpp:
+        (JSC::WeakSet::addAllocator):
+        * heap/WeakSet.h:
+        (WeakSet):
+        (JSC::WeakSet::WeakSet):
+        (JSC::WeakSet::globalData):
+        * runtime/JSGlobalData.h:
+        (JSC::WeakSet::heap):
+        (JSC):
+
 2012-08-31  Mark Lam  <mark.lam@apple.com>
 
         Refactor LLInt and supporting code in preparation for the C Loop backend.
index 67ba518..b0f3b88 100644 (file)
@@ -45,7 +45,7 @@ MarkedBlock::MarkedBlock(const PageAllocationAligned& allocation, Heap* heap, si
     , m_cellsNeedDestruction(cellsNeedDestruction)
     , m_onlyContainsStructures(onlyContainsStructures)
     , m_state(New) // All cells start out unmarked.
-    , m_weakSet(heap)
+    , m_weakSet(heap->globalData())
 {
     ASSERT(heap);
     HEAP_LOG_BLOCK_STATE_TRANSITION(this);
index ab2abd7..a3e6b65 100644 (file)
@@ -121,6 +121,7 @@ namespace JSC {
         void lastChanceToFinalize();
 
         Heap* heap() const;
+        JSGlobalData* globalData() const;
         WeakSet& weakSet();
         
         enum SweepMode { SweepOnly, SweepToFreeList };
@@ -262,6 +263,11 @@ namespace JSC {
         return m_weakSet.heap();
     }
 
+    inline JSGlobalData* MarkedBlock::globalData() const
+    {
+        return m_weakSet.globalData();
+    }
+
     inline WeakSet& MarkedBlock::weakSet()
     {
         return m_weakSet;
index 4a510b8..2804968 100644 (file)
@@ -27,6 +27,7 @@
 #include "WeakSet.h"
 
 #include "Heap.h"
+#include "JSGlobalData.h"
 
 namespace JSC {
 
@@ -73,7 +74,7 @@ WeakBlock::FreeCell* WeakSet::tryFindAllocator()
 WeakBlock::FreeCell* WeakSet::addAllocator()
 {
     WeakBlock* block = WeakBlock::create();
-    m_heap->didAllocate(WeakBlock::blockSize);
+    heap()->didAllocate(WeakBlock::blockSize);
     m_blocks.append(block);
     WeakBlock::SweepResult sweepResult = block->takeSweepResult();
     ASSERT(!sweepResult.isNull() && sweepResult.freeList);
index 291d0ae..06514eb 100644 (file)
@@ -38,11 +38,12 @@ public:
     static WeakImpl* allocate(JSValue, WeakHandleOwner* = 0, void* context = 0);
     static void deallocate(WeakImpl*);
 
-    WeakSet(Heap*);
+    WeakSet(JSGlobalData*);
     ~WeakSet();
     void lastChanceToFinalize();
 
     Heap* heap() const;
+    JSGlobalData* globalData() const;
 
     bool isEmpty() const;
 
@@ -61,19 +62,19 @@ private:
     WeakBlock::FreeCell* m_allocator;
     WeakBlock* m_nextAllocator;
     DoublyLinkedList<WeakBlock> m_blocks;
-    Heap* m_heap;
+    JSGlobalData* m_globalData;
 };
 
-inline WeakSet::WeakSet(Heap* heap)
+inline WeakSet::WeakSet(JSGlobalData* globalData)
     : m_allocator(0)
     , m_nextAllocator(0)
-    , m_heap(heap)
+    , m_globalData(globalData)
 {
 }
 
-inline Heap* WeakSet::heap() const
+inline JSGlobalData* WeakSet::globalData() const
 {
-    return m_heap;
+    return m_globalData;
 }
 
 inline bool WeakSet::isEmpty() const
index 980cb69..326e49c 100644 (file)
@@ -474,6 +474,11 @@ namespace JSC {
     }
 #endif
 
+    inline Heap* WeakSet::heap() const
+    {
+        return &m_globalData->heap;
+    }
+
 } // namespace JSC
 
 #endif // JSGlobalData_h