Diff
Modified: trunk/Source/_javascript_Core/CMakeLists.txt (94460 => 94461)
--- trunk/Source/_javascript_Core/CMakeLists.txt 2011-09-02 23:25:15 UTC (rev 94460)
+++ trunk/Source/_javascript_Core/CMakeLists.txt 2011-09-02 23:33:28 UTC (rev 94461)
@@ -48,7 +48,6 @@
heap/MachineStackMarker.cpp
heap/MarkedBlock.cpp
heap/NewSpace.cpp
- heap/OldSpace.cpp
heap/ConservativeRoots.cpp
heap/MarkStack.cpp
Modified: trunk/Source/_javascript_Core/ChangeLog (94460 => 94461)
--- trunk/Source/_javascript_Core/ChangeLog 2011-09-02 23:25:15 UTC (rev 94460)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-09-02 23:33:28 UTC (rev 94461)
@@ -1,3 +1,24 @@
+2011-09-02 Oliver Hunt <[email protected]>
+
+ Remove OldSpace classes
+ https://bugs.webkit.org/show_bug.cgi?id=67533
+
+ Reviewed by Gavin Barraclough.
+
+ Remove the unused OldSpace classes
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * _javascript_Core.gypi:
+ * _javascript_Core.pro:
+ * _javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj:
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ * heap/Heap.cpp:
+ (JSC::Heap::writeBarrierSlowCase):
+ * heap/MarkedBlock.h:
+ * heap/OldSpace.cpp: Removed.
+ * heap/OldSpace.h: Removed.
+
2011-09-02 James Robinson <[email protected]>
Compile fix for mac build.
Modified: trunk/Source/_javascript_Core/GNUmakefile.list.am (94460 => 94461)
--- trunk/Source/_javascript_Core/GNUmakefile.list.am 2011-09-02 23:25:15 UTC (rev 94460)
+++ trunk/Source/_javascript_Core/GNUmakefile.list.am 2011-09-02 23:33:28 UTC (rev 94461)
@@ -146,8 +146,6 @@
Source/_javascript_Core/heap/TinyBloomFilter.h \
Source/_javascript_Core/heap/NewSpace.cpp \
Source/_javascript_Core/heap/NewSpace.h \
- Source/_javascript_Core/heap/OldSpace.cpp \
- Source/_javascript_Core/heap/OldSpace.h \
Source/_javascript_Core/heap/Strong.h \
Source/_javascript_Core/heap/VTableSpectrum.cpp \
Source/_javascript_Core/heap/VTableSpectrum.h \
Modified: trunk/Source/_javascript_Core/_javascript_Core.gypi (94460 => 94461)
--- trunk/Source/_javascript_Core/_javascript_Core.gypi 2011-09-02 23:25:15 UTC (rev 94460)
+++ trunk/Source/_javascript_Core/_javascript_Core.gypi 2011-09-02 23:33:28 UTC (rev 94461)
@@ -339,8 +339,6 @@
'heap/TinyBloomFilter.h',
'heap/NewSpace.cpp',
'heap/NewSpace.h',
- 'heap/OldSpace.cpp',
- 'heap/OldSpace.h',
'debugger/Debugger.cpp',
'debugger/DebuggerActivation.cpp',
'debugger/DebuggerCallFrame.cpp',
Modified: trunk/Source/_javascript_Core/_javascript_Core.pro (94460 => 94461)
--- trunk/Source/_javascript_Core/_javascript_Core.pro 2011-09-02 23:25:15 UTC (rev 94460)
+++ trunk/Source/_javascript_Core/_javascript_Core.pro 2011-09-02 23:33:28 UTC (rev 94461)
@@ -78,7 +78,6 @@
heap/MarkStack.cpp \
heap/MarkedBlock.cpp \
heap/NewSpace.cpp \
- heap/OldSpace.cpp \
heap/VTableSpectrum.cpp \
heap/WriteBarrierSupport.cpp \
debugger/DebuggerActivation.cpp \
Modified: trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj (94460 => 94461)
--- trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj 2011-09-02 23:25:15 UTC (rev 94460)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.vcproj 2011-09-02 23:33:28 UTC (rev 94461)
@@ -1906,14 +1906,6 @@
>
</File>
<File
- RelativePath="..\..\heap\OldSpace.cpp"
- >
- </File>
- <File
- RelativePath="..\..\heap\OldSpace.h"
- >
- </File>
- <File
RelativePath="..\..\heap\MarkStack.cpp"
>
</File>
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (94460 => 94461)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2011-09-02 23:25:15 UTC (rev 94460)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2011-09-02 23:33:28 UTC (rev 94461)
@@ -50,10 +50,10 @@
0BF28A2911A33DC300638F84 /* SizeLimits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0BF28A2811A33DC300638F84 /* SizeLimits.cpp */; };
0F7700921402FF3C0078EB39 /* SamplingCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F7700911402FF280078EB39 /* SamplingCounter.cpp */; };
0F963B3813FC6FE90002D9B2 /* ValueProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 0FC815151405119B00CFA603 /* VTableSpectrum.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC815141405118D00CFA603 /* VTableSpectrum.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 0FC81516140511B500CFA603 /* VTableSpectrum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC815121405118600CFA603 /* VTableSpectrum.cpp */; };
0FC8150A14043BF500CFA603 /* WriteBarrierSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC8150914043BD200CFA603 /* WriteBarrierSupport.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FC8150B14043C0E00CFA603 /* WriteBarrierSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC8150814043BCA00CFA603 /* WriteBarrierSupport.cpp */; };
+ 0FC815151405119B00CFA603 /* VTableSpectrum.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC815141405118D00CFA603 /* VTableSpectrum.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FC81516140511B500CFA603 /* VTableSpectrum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FC815121405118600CFA603 /* VTableSpectrum.cpp */; };
1400067712A6F7830064D123 /* OSAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1400067612A6F7830064D123 /* OSAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
1400069312A6F9E10064D123 /* OSAllocatorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1400069212A6F9E10064D123 /* OSAllocatorPosix.cpp */; };
140566C4107EC255005DBC8D /* JSAPIValueWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0894D50FAFBA2D00001865 /* JSAPIValueWrapper.cpp */; };
@@ -91,8 +91,6 @@
1429D8DE0ED2205B00B89619 /* CallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429D8DC0ED2205B00B89619 /* CallFrame.h */; settings = {ATTRIBUTES = (Private, ); }; };
1429D92F0ED22D7000B89619 /* JIT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D92D0ED22D7000B89619 /* JIT.cpp */; };
1429D9300ED22D7000B89619 /* JIT.h in Headers */ = {isa = PBXBuildFile; fileRef = 1429D92E0ED22D7000B89619 /* JIT.h */; };
- 142A1D8313A19C84009DA5FE /* OldSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142A1D8113A19C84009DA5FE /* OldSpace.cpp */; };
- 142A1D8413A19C84009DA5FE /* OldSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 142A1D8213A19C84009DA5FE /* OldSpace.h */; };
142D3939103E4560007DCB52 /* NumericStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 142D3938103E4560007DCB52 /* NumericStrings.h */; settings = {ATTRIBUTES = (Private, ); }; };
142D6F0813539A2800B02E86 /* MarkedBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142D6F0613539A2800B02E86 /* MarkedBlock.cpp */; };
142D6F0913539A2800B02E86 /* MarkedBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 142D6F0713539A2800B02E86 /* MarkedBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -757,10 +755,10 @@
0F77008E1402FDD60078EB39 /* SamplingCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SamplingCounter.h; sourceTree = "<group>"; };
0F7700911402FF280078EB39 /* SamplingCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SamplingCounter.cpp; sourceTree = "<group>"; };
0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueProfile.h; sourceTree = "<group>"; };
- 0FC815121405118600CFA603 /* VTableSpectrum.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VTableSpectrum.cpp; sourceTree = "<group>"; };
- 0FC815141405118D00CFA603 /* VTableSpectrum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VTableSpectrum.h; sourceTree = "<group>"; };
0FC8150814043BCA00CFA603 /* WriteBarrierSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WriteBarrierSupport.cpp; sourceTree = "<group>"; };
0FC8150914043BD200CFA603 /* WriteBarrierSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WriteBarrierSupport.h; sourceTree = "<group>"; };
+ 0FC815121405118600CFA603 /* VTableSpectrum.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VTableSpectrum.cpp; sourceTree = "<group>"; };
+ 0FC815141405118D00CFA603 /* VTableSpectrum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VTableSpectrum.h; sourceTree = "<group>"; };
1400067612A6F7830064D123 /* OSAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSAllocator.h; sourceTree = "<group>"; };
1400069212A6F9E10064D123 /* OSAllocatorPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OSAllocatorPosix.cpp; sourceTree = "<group>"; };
140D17D60E8AD4A9000CD17D /* JSBasePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBasePrivate.h; sourceTree = "<group>"; };
@@ -783,8 +781,6 @@
1429D8DC0ED2205B00B89619 /* CallFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallFrame.h; sourceTree = "<group>"; };
1429D92D0ED22D7000B89619 /* JIT.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JIT.cpp; sourceTree = "<group>"; };
1429D92E0ED22D7000B89619 /* JIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JIT.h; sourceTree = "<group>"; };
- 142A1D8113A19C84009DA5FE /* OldSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OldSpace.cpp; sourceTree = "<group>"; };
- 142A1D8213A19C84009DA5FE /* OldSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OldSpace.h; sourceTree = "<group>"; };
142D3938103E4560007DCB52 /* NumericStrings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumericStrings.h; sourceTree = "<group>"; };
142D6F0613539A2800B02E86 /* MarkedBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkedBlock.cpp; sourceTree = "<group>"; };
142D6F0713539A2800B02E86 /* MarkedBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkedBlock.h; sourceTree = "<group>"; };
@@ -1583,8 +1579,6 @@
142D6F0F13539A4100B02E86 /* MarkStack.h */,
14D2F3D8139F4BE200491031 /* NewSpace.cpp */,
14D2F3D9139F4BE200491031 /* NewSpace.h */,
- 142A1D8113A19C84009DA5FE /* OldSpace.cpp */,
- 142A1D8213A19C84009DA5FE /* OldSpace.h */,
14BA78F013AAB88F005B7C2C /* SlotVisitor.h */,
142E3132134FF0A600AFADB5 /* Strong.h */,
141448CC13A1783700F5BA1A /* TinyBloomFilter.h */,
@@ -2688,7 +2682,6 @@
14D2F3DB139F4BE200491031 /* NewSpace.h in Headers */,
141448CB13A176EC00F5BA1A /* MarkedBlockSet.h in Headers */,
141448CD13A1783700F5BA1A /* TinyBloomFilter.h in Headers */,
- 142A1D8413A19C84009DA5FE /* OldSpace.h in Headers */,
14BA78F113AAB88F005B7C2C /* SlotVisitor.h in Headers */,
14BA7A9813AADFF8005B7C2C /* Heap.h in Headers */,
A76F54A313B28AAB00EF2BCE /* JITWriteBarrier.h in Headers */,
@@ -3144,7 +3137,6 @@
7934BB7C1361979400CB99A1 /* ParallelJobsGeneric.cpp in Sources */,
86BB09C0138E381B0056702F /* DFGRepatch.cpp in Sources */,
14D2F3DA139F4BE200491031 /* NewSpace.cpp in Sources */,
- 142A1D8313A19C84009DA5FE /* OldSpace.cpp in Sources */,
14BA7A9713AADFF8005B7C2C /* Heap.cpp in Sources */,
C22C52F113FAF6EF00B7DC0D /* bignum-dtoa.cc in Sources */,
C22C52F313FAF6EF00B7DC0D /* bignum.cc in Sources */,
Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (94460 => 94461)
--- trunk/Source/_javascript_Core/heap/Heap.cpp 2011-09-02 23:25:15 UTC (rev 94460)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp 2011-09-02 23:33:28 UTC (rev 94461)
@@ -808,9 +808,6 @@
#if ENABLE(GGC)
void Heap::writeBarrierSlowCase(const JSCell* owner, JSCell* cell)
{
- if (!cell)
- return;
- MarkedBlock::blockFor(cell)->addOldSpaceOwner(owner, cell);
}
#else
Modified: trunk/Source/_javascript_Core/heap/MarkedBlock.h (94460 => 94461)
--- trunk/Source/_javascript_Core/heap/MarkedBlock.h 2011-09-02 23:25:15 UTC (rev 94460)
+++ trunk/Source/_javascript_Core/heap/MarkedBlock.h 2011-09-02 23:33:28 UTC (rev 94461)
@@ -84,24 +84,6 @@
void returnValue() { }
};
- class OwnerSet {
- public:
- OwnerSet();
-
- void add(const JSCell*);
- void clear();
-
- size_t size();
- bool didOverflow();
-
- const JSCell** owners();
-
- private:
- static const size_t capacity = 5;
- unsigned char m_size;
- const JSCell* m_owners[capacity];
- };
-
static MarkedBlock* create(Heap*, size_t cellSize);
static void destroy(MarkedBlock*);
@@ -153,8 +135,6 @@
bool testAndClearMarked(const void*);
void setMarked(const void*);
- void addOldSpaceOwner(const JSCell* owner, const JSCell*);
-
template <typename Functor> void forEachCell(Functor&);
private:
@@ -198,7 +178,6 @@
WTF::Bitmap<blockSize / atomSize> m_marks;
bool m_inNewSpace;
int8_t m_destructorState; // use getters/setters for this, particularly since we may want to compact this (effectively log(3)/log(2)-bit) field into other fields
- OwnerSet m_ownerSets[ownerSetsPerBlock];
PageAllocationAligned m_allocation;
Heap* m_heap;
MarkedBlock* m_prev;
@@ -330,46 +309,6 @@
return (reinterpret_cast<Bits>(cell) - reinterpret_cast<Bits>(this)) * ownerSetsPerBlock / blockSize;
}
- inline void MarkedBlock::addOldSpaceOwner(const JSCell* owner, const JSCell* cell)
- {
- OwnerSet& ownerSet = m_ownerSets[ownerSetNumber(cell)];
- ownerSet.add(owner);
- }
-
- inline MarkedBlock::OwnerSet::OwnerSet()
- : m_size(0)
- {
- }
-
- inline void MarkedBlock::OwnerSet::add(const JSCell* owner)
- {
- if (m_size < capacity) {
- m_owners[m_size++] = owner;
- return;
- }
- m_size = capacity + 1; // Signals overflow.
- }
-
- inline void MarkedBlock::OwnerSet::clear()
- {
- m_size = 0;
- }
-
- inline size_t MarkedBlock::OwnerSet::size()
- {
- return m_size;
- }
-
- inline bool MarkedBlock::OwnerSet::didOverflow()
- {
- return m_size > capacity;
- }
-
- inline const JSCell** MarkedBlock::OwnerSet::owners()
- {
- return m_owners;
- }
-
} // namespace JSC
namespace WTF {
Deleted: trunk/Source/_javascript_Core/heap/OldSpace.cpp (94460 => 94461)
--- trunk/Source/_javascript_Core/heap/OldSpace.cpp 2011-09-02 23:25:15 UTC (rev 94460)
+++ trunk/Source/_javascript_Core/heap/OldSpace.cpp 2011-09-02 23:33:28 UTC (rev 94461)
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "OldSpace.h"
-
-namespace JSC {
-
-OldSpace::OldSpace(Heap* heap)
- : m_heap(heap)
-{
-}
-
-void OldSpace::addBlock(MarkedBlock* block)
-{
- m_blocks.append(block);
- block->blessNewBlockForSlowPath();
-}
-
-void OldSpace::removeBlock(MarkedBlock* block)
-{
- m_blocks.remove(block);
-}
-
-} // namespace JSC
Deleted: trunk/Source/_javascript_Core/heap/OldSpace.h (94460 => 94461)
--- trunk/Source/_javascript_Core/heap/OldSpace.h 2011-09-02 23:25:15 UTC (rev 94460)
+++ trunk/Source/_javascript_Core/heap/OldSpace.h 2011-09-02 23:33:28 UTC (rev 94461)
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef OldSpace_h
-#define OldSpace_h
-
-#include "MarkedBlock.h"
-#include <wtf/DoublyLinkedList.h>
-#include <wtf/Noncopyable.h>
-
-namespace JSC {
-
-class Heap;
-
-class OldSpace {
- WTF_MAKE_NONCOPYABLE(OldSpace);
-public:
- OldSpace(Heap*);
-
- void addBlock(MarkedBlock*);
- void removeBlock(MarkedBlock*);
-
- template<typename Functor> typename Functor::ReturnType forEachBlock();
- template<typename Functor> typename Functor::ReturnType forEachBlock(Functor&);
-
-private:
- DoublyLinkedList<MarkedBlock> m_blocks;
- Heap* m_heap;
-};
-
-template <typename Functor> inline typename Functor::ReturnType OldSpace::forEachBlock(Functor& functor)
-{
- MarkedBlock* next;
- for (MarkedBlock* block = m_blocks.head(); block; block = next) {
- next = block->next();
- functor(block);
- }
-
- return functor.returnValue();
-}
-
-template <typename Functor> inline typename Functor::ReturnType OldSpace::forEachBlock()
-{
- Functor functor;
- return forEachBlock(functor);
-}
-
-} // namespace JSC
-
-#endif // OldSpace_h