Commit 61b97001 authored by ggaren@apple.com's avatar ggaren@apple.com

Renamed

        WeakHeap => WeakSet
        HandleHeap => HandleSet

Reviewed by Sam Weinig.

These sets do have internal allocators, but it's confusing to call them
heaps because they're sub-objects of an object called "heap".

* heap/HandleHeap.cpp: Removed.
* heap/HandleHeap.h: Removed.
* heap/HandleSet.cpp: Copied from JavaScriptCore/heap/HandleHeap.cpp.
* heap/WeakHeap.cpp: Removed.
* heap/WeakHeap.h: Removed.
* heap/WeakSet.cpp: Copied from JavaScriptCore/heap/WeakHeap.cpp.
* heap/WeakSet.h: Copied from JavaScriptCore/heap/WeakHeap.h.

Plus global rename using grep.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113508 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fc327d64
......@@ -65,7 +65,7 @@ void JSCallbackObjectData::finalize(Handle<Unknown> handle, void* context)
for (; jsClass; jsClass = jsClass->parentClass)
if (JSObjectFinalizeCallback finalize = jsClass->finalize)
finalize(thisRef);
WeakHeap::deallocate(WeakImpl::asWeakImpl(handle.slot()));
WeakSet::deallocate(WeakImpl::asWeakImpl(handle.slot()));
}
} // namespace JSC
......@@ -104,7 +104,7 @@ void JSCallbackObject<Parent>::init(ExecState* exec)
for (JSClassRef jsClassPtr = classRef(); jsClassPtr; jsClassPtr = jsClassPtr->parentClass) {
if (jsClassPtr->finalize) {
exec->globalData().heap.weakHeap()->allocate(this, m_callbackObjectData.get(), classRef());
exec->globalData().heap.weakSet()->allocate(this, m_callbackObjectData.get(), classRef());
break;
}
}
......
......@@ -88,7 +88,7 @@ SET(JavaScriptCore_SOURCES
heap/CopiedSpace.cpp
heap/ConservativeRoots.cpp
heap/DFGCodeBlocks.cpp
heap/HandleHeap.cpp
heap/HandleSet.cpp
heap/HandleStack.cpp
heap/Heap.cpp
heap/MachineStackMarker.cpp
......@@ -96,7 +96,7 @@ SET(JavaScriptCore_SOURCES
heap/MarkedBlock.cpp
heap/MarkedSpace.cpp
heap/MarkStack.cpp
heap/WeakHeap.cpp
heap/WeakSet.cpp
heap/WeakHandleOwner.cpp
heap/WeakBlock.cpp
......
2012-04-06 Geoffrey Garen <ggaren@apple.com>
Renamed
WeakHeap => WeakSet
HandleHeap => HandleSet
Reviewed by Sam Weinig.
These sets do have internal allocators, but it's confusing to call them
heaps because they're sub-objects of an object called "heap".
* heap/HandleHeap.cpp: Removed.
* heap/HandleHeap.h: Removed.
* heap/HandleSet.cpp: Copied from JavaScriptCore/heap/HandleHeap.cpp.
* heap/WeakHeap.cpp: Removed.
* heap/WeakHeap.h: Removed.
* heap/WeakSet.cpp: Copied from JavaScriptCore/heap/WeakHeap.cpp.
* heap/WeakSet.h: Copied from JavaScriptCore/heap/WeakHeap.h.
Plus global rename using grep.
2012-04-06 Dan Bernstein <mitz@apple.com>
<rdar://problem/10912476> HiDPI: Have canvas use a hidpi backing store, but downsample upon access
......@@ -218,8 +218,8 @@ javascriptcore_sources += \
Source/JavaScriptCore/heap/DFGCodeBlocks.h \
Source/JavaScriptCore/heap/GCAssertions.h \
Source/JavaScriptCore/heap/Handle.h \
Source/JavaScriptCore/heap/HandleHeap.cpp \
Source/JavaScriptCore/heap/HandleHeap.h \
Source/JavaScriptCore/heap/HandleSet.cpp \
Source/JavaScriptCore/heap/HandleSet.h \
Source/JavaScriptCore/heap/HeapBlock.h \
Source/JavaScriptCore/heap/SlotVisitor.h \
Source/JavaScriptCore/heap/HandleStack.cpp \
......@@ -251,7 +251,7 @@ javascriptcore_sources += \
Source/JavaScriptCore/heap/VTableSpectrum.h \
Source/JavaScriptCore/heap/Weak.h \
Source/JavaScriptCore/heap/WeakBlock.cpp \
Source/JavaScriptCore/heap/WeakHeap.cpp \
Source/JavaScriptCore/heap/WeakSet.cpp \
Source/JavaScriptCore/heap/WeakHandleOwner.cpp \
Source/JavaScriptCore/heap/WeakReferenceHarvester.h \
Source/JavaScriptCore/heap/WriteBarrierSupport.cpp \
......
......@@ -34,7 +34,7 @@
'heap/ConservativeRoots.h',
'heap/GCAssertions.h',
'heap/Handle.h',
'heap/HandleHeap.h',
'heap/HandleSet.h',
'heap/HeapBlock.h',
'heap/SlotVisitor.h',
'heap/HandleStack.h',
......@@ -217,10 +217,10 @@
'bytecompiler/NodesCodegen.cpp',
'bytecompiler/RegisterID.h',
'heap/ConservativeRoots.cpp',
'heap/WeakHeap.cpp',
'heap/WeakSet.cpp',
'heap/WeakHandleOwner.cpp',
'heap/WeakBlock.cpp',
'heap/HandleHeap.cpp',
'heap/HandleSet.cpp',
'heap/HandleStack.cpp',
'heap/Heap.cpp',
'heap/MachineStackMarker.cpp',
......
......@@ -180,7 +180,7 @@ EXPORTS
?fastZeroedMalloc@WTF@@YAPAXI@Z
?fillGetterPropertySlot@JSObject@JSC@@AAEXAAVPropertySlot@2@PAV?$WriteBarrierBase@W4Unknown@JSC@@@2@@Z
?finalize@WeakHandleOwner@JSC@@UAEXV?$Handle@W4Unknown@JSC@@@2@PAX@Z
?findAllocator@WeakHeap@JSC@@AAEPAUFreeCell@WeakBlock@2@XZ
?findAllocator@WeakSet@JSC@@AAEPAUFreeCell@WeakBlock@2@XZ
?finishCreation@DateInstance@JSC@@IAEXAAVJSGlobalData@2@N@Z
?finishCreation@InternalFunction@JSC@@IAEXAAVJSGlobalData@2@ABVIdentifier@2@@Z
?finishCreation@JSArray@JSC@@IAEXAAVJSGlobalData@2@I@Z
......@@ -218,7 +218,7 @@ EXPORTS
?getter@PropertyDescriptor@JSC@@QBE?AVJSValue@2@XZ
?globalExec@JSGlobalObject@JSC@@QAEPAVExecState@2@XZ
?globalObjectCount@Heap@JSC@@QAEIXZ
?grow@HandleHeap@JSC@@AAEXXZ
?grow@HandleSet@JSC@@AAEXXZ
?hasInstance@JSObject@JSC@@SA_NPAV12@PAVExecState@2@VJSValue@2@2@Z
?hasProperty@JSObject@JSC@@QBE_NPAVExecState@2@ABVIdentifier@2@@Z
?hasProperty@JSObject@JSC@@QBE_NPAVExecState@2@I@Z
......@@ -372,7 +372,7 @@ EXPORTS
?waitForThreadCompletion@WTF@@YAHI@Z
?waitForThreadCompletion@WTF@@YAHIPAPAX@Z
?writable@PropertyDescriptor@JSC@@QBE_NXZ
?writeBarrier@HandleHeap@JSC@@QAEXPAVJSValue@2@ABV32@@Z
?writeBarrier@HandleSet@JSC@@QAEXPAVJSValue@2@ABV32@@Z
?yield@WTF@@YAXXZ
WTFGetBacktrace
WTFInvokeCrashHook
......
......@@ -2130,11 +2130,11 @@
>
</File>
<File
RelativePath="..\..\heap\HandleHeap.cpp"
RelativePath="..\..\heap\HandleSet.cpp"
>
</File>
<File
RelativePath="..\..\heap\HandleHeap.h"
RelativePath="..\..\heap\HandleSet.h"
>
</File>
<File
......@@ -2146,11 +2146,11 @@
>
</File>
<File
RelativePath="..\..\heap\WeakHeap.cpp"
RelativePath="..\..\heap\WeakSet.cpp"
>
</File>
<File
RelativePath="..\..\heap\WeakHeap.h"
RelativePath="..\..\heap\WeakSet.h"
>
</File>
<File
......
......@@ -226,8 +226,8 @@
142D6F1113539A4100B02E86 /* MarkStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142D6F0E13539A4100B02E86 /* MarkStack.cpp */; };
142D6F1213539A4100B02E86 /* MarkStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 142D6F0F13539A4100B02E86 /* MarkStack.h */; settings = {ATTRIBUTES = (Private, ); }; };
142E3134134FF0A600AFADB5 /* Handle.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E312B134FF0A600AFADB5 /* Handle.h */; settings = {ATTRIBUTES = (Private, ); }; };
142E3135134FF0A600AFADB5 /* HandleHeap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142E312C134FF0A600AFADB5 /* HandleHeap.cpp */; };
142E3136134FF0A600AFADB5 /* HandleHeap.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E312D134FF0A600AFADB5 /* HandleHeap.h */; settings = {ATTRIBUTES = (Private, ); }; };
142E3135134FF0A600AFADB5 /* HandleSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142E312C134FF0A600AFADB5 /* HandleSet.cpp */; };
142E3136134FF0A600AFADB5 /* HandleSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E312D134FF0A600AFADB5 /* HandleSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
142E3137134FF0A600AFADB5 /* HandleStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 142E312E134FF0A600AFADB5 /* HandleStack.cpp */; };
142E3138134FF0A600AFADB5 /* HandleStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E312F134FF0A600AFADB5 /* HandleStack.h */; settings = {ATTRIBUTES = (Private, ); }; };
142E3139134FF0A600AFADB5 /* Local.h in Headers */ = {isa = PBXBuildFile; fileRef = 142E3130134FF0A600AFADB5 /* Local.h */; };
......@@ -325,8 +325,8 @@
14D2F3DB139F4BE200491031 /* MarkedSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D2F3D9139F4BE200491031 /* MarkedSpace.h */; settings = {ATTRIBUTES = (Private, ); }; };
14E84F9E14EE1ACC00D6D5D4 /* WeakBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14E84F9914EE1ACC00D6D5D4 /* WeakBlock.cpp */; };
14E84F9F14EE1ACC00D6D5D4 /* WeakBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E84F9A14EE1ACC00D6D5D4 /* WeakBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
14E84FA014EE1ACC00D6D5D4 /* WeakHeap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14E84F9B14EE1ACC00D6D5D4 /* WeakHeap.cpp */; };
14E84FA114EE1ACC00D6D5D4 /* WeakHeap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E84F9C14EE1ACC00D6D5D4 /* WeakHeap.h */; settings = {ATTRIBUTES = (Private, ); }; };
14E84FA014EE1ACC00D6D5D4 /* WeakSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14E84F9B14EE1ACC00D6D5D4 /* WeakSet.cpp */; };
14E84FA114EE1ACC00D6D5D4 /* WeakSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E84F9C14EE1ACC00D6D5D4 /* WeakSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
14E84FA214EE1ACC00D6D5D4 /* WeakImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E84F9D14EE1ACC00D6D5D4 /* WeakImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
14E9D17B107EC469004DDA21 /* JSGlobalObjectFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC756FC60E2031B200DE7D12 /* JSGlobalObjectFunctions.cpp */; };
14F7256514EE265E00B1652B /* WeakHandleOwner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14F7256314EE265E00B1652B /* WeakHandleOwner.cpp */; };
......@@ -881,8 +881,8 @@
142D6F0E13539A4100B02E86 /* MarkStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkStack.cpp; sourceTree = "<group>"; };
142D6F0F13539A4100B02E86 /* MarkStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkStack.h; sourceTree = "<group>"; };
142E312B134FF0A600AFADB5 /* Handle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Handle.h; sourceTree = "<group>"; };
142E312C134FF0A600AFADB5 /* HandleHeap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HandleHeap.cpp; sourceTree = "<group>"; };
142E312D134FF0A600AFADB5 /* HandleHeap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HandleHeap.h; sourceTree = "<group>"; };
142E312C134FF0A600AFADB5 /* HandleSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HandleSet.cpp; sourceTree = "<group>"; };
142E312D134FF0A600AFADB5 /* HandleSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HandleSet.h; sourceTree = "<group>"; };
142E312E134FF0A600AFADB5 /* HandleStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HandleStack.cpp; sourceTree = "<group>"; };
142E312F134FF0A600AFADB5 /* HandleStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HandleStack.h; sourceTree = "<group>"; };
142E3130134FF0A600AFADB5 /* Local.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Local.h; sourceTree = "<group>"; };
......@@ -954,8 +954,8 @@
14DE0D680D02431400AACCA2 /* JSGlobalObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObject.cpp; sourceTree = "<group>"; };
14E84F9914EE1ACC00D6D5D4 /* WeakBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WeakBlock.cpp; sourceTree = "<group>"; };
14E84F9A14EE1ACC00D6D5D4 /* WeakBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakBlock.h; sourceTree = "<group>"; };
14E84F9B14EE1ACC00D6D5D4 /* WeakHeap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WeakHeap.cpp; sourceTree = "<group>"; };
14E84F9C14EE1ACC00D6D5D4 /* WeakHeap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakHeap.h; sourceTree = "<group>"; };
14E84F9B14EE1ACC00D6D5D4 /* WeakSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WeakSet.cpp; sourceTree = "<group>"; };
14E84F9C14EE1ACC00D6D5D4 /* WeakSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakSet.h; sourceTree = "<group>"; };
14E84F9D14EE1ACC00D6D5D4 /* WeakImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakImpl.h; sourceTree = "<group>"; };
14F252560D08DD8D004ECFFF /* JSVariableObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVariableObject.h; sourceTree = "<group>"; };
14F7256314EE265E00B1652B /* WeakHandleOwner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WeakHandleOwner.cpp; sourceTree = "<group>"; };
......@@ -1572,8 +1572,8 @@
0F2C556E14738F2E00121E4F /* DFGCodeBlocks.h */,
BCBE2CAD14E985AA000593AD /* GCAssertions.h */,
142E312B134FF0A600AFADB5 /* Handle.h */,
142E312C134FF0A600AFADB5 /* HandleHeap.cpp */,
142E312D134FF0A600AFADB5 /* HandleHeap.h */,
142E312C134FF0A600AFADB5 /* HandleSet.cpp */,
142E312D134FF0A600AFADB5 /* HandleSet.h */,
142E312E134FF0A600AFADB5 /* HandleStack.cpp */,
142E312F134FF0A600AFADB5 /* HandleStack.h */,
146FA5A81378F6B0003627A3 /* HandleTypes.h */,
......@@ -1608,8 +1608,8 @@
14E84F9A14EE1ACC00D6D5D4 /* WeakBlock.h */,
14F7256314EE265E00B1652B /* WeakHandleOwner.cpp */,
14F7256414EE265E00B1652B /* WeakHandleOwner.h */,
14E84F9B14EE1ACC00D6D5D4 /* WeakHeap.cpp */,
14E84F9C14EE1ACC00D6D5D4 /* WeakHeap.h */,
14E84F9B14EE1ACC00D6D5D4 /* WeakSet.cpp */,
14E84F9C14EE1ACC00D6D5D4 /* WeakSet.h */,
14E84F9D14EE1ACC00D6D5D4 /* WeakImpl.h */,
0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */,
0FC8150814043BCA00CFA603 /* WriteBarrierSupport.cpp */,
......@@ -2315,7 +2315,7 @@
BC18C4050E16F5CD00B34460 /* FunctionPrototype.h in Headers */,
DDF7ABD411F60ED200108E36 /* GCActivityCallback.h in Headers */,
142E3134134FF0A600AFADB5 /* Handle.h in Headers */,
142E3136134FF0A600AFADB5 /* HandleHeap.h in Headers */,
142E3136134FF0A600AFADB5 /* HandleSet.h in Headers */,
142E3138134FF0A600AFADB5 /* HandleStack.h in Headers */,
1478297B1379E8A800A7C2A3 /* HandleTypes.h in Headers */,
14BA7A9813AADFF8005B7C2C /* Heap.h in Headers */,
......@@ -2552,7 +2552,7 @@
0FFFC96014EF90BD00C72532 /* DFGVirtualRegisterAllocationPhase.h in Headers */,
1497209114EB831500FEB1B7 /* PassWeak.h in Headers */,
14E84F9F14EE1ACC00D6D5D4 /* WeakBlock.h in Headers */,
14E84FA114EE1ACC00D6D5D4 /* WeakHeap.h in Headers */,
14E84FA114EE1ACC00D6D5D4 /* WeakSet.h in Headers */,
14E84FA214EE1ACC00D6D5D4 /* WeakImpl.h in Headers */,
14F7256614EE265E00B1652B /* WeakHandleOwner.h in Headers */,
0FB5467714F59B5C002C2989 /* LazyOperandValueProfile.h in Headers */,
......@@ -2978,7 +2978,7 @@
147F39CC107EC37600427A48 /* FunctionPrototype.cpp in Sources */,
DDF7ABD511F60ED200108E36 /* GCActivityCallbackCF.cpp in Sources */,
14280855107EC0E70013E7B2 /* GetterSetter.cpp in Sources */,
142E3135134FF0A600AFADB5 /* HandleHeap.cpp in Sources */,
142E3135134FF0A600AFADB5 /* HandleSet.cpp in Sources */,
142E3137134FF0A600AFADB5 /* HandleStack.cpp in Sources */,
14BA7A9713AADFF8005B7C2C /* Heap.cpp in Sources */,
147F39CE107EC37600427A48 /* Identifier.cpp in Sources */,
......@@ -3113,7 +3113,7 @@
C2B916C514DA040C00CBAC86 /* MarkedAllocator.cpp in Sources */,
0F9FC8C314E1B5FE00D52AE0 /* PolymorphicPutByIdList.cpp in Sources */,
14E84F9E14EE1ACC00D6D5D4 /* WeakBlock.cpp in Sources */,
14E84FA014EE1ACC00D6D5D4 /* WeakHeap.cpp in Sources */,
14E84FA014EE1ACC00D6D5D4 /* WeakSet.cpp in Sources */,
14F7256514EE265E00B1652B /* WeakHandleOwner.cpp in Sources */,
0FFFC95714EF90A000C72532 /* DFGCFAPhase.cpp in Sources */,
0FFFC95914EF90A600C72532 /* DFGCSEPhase.cpp in Sources */,
......
......@@ -71,10 +71,10 @@ SOURCES += \
heap/CopiedSpace.cpp \
heap/ConservativeRoots.cpp \
heap/DFGCodeBlocks.cpp \
heap/WeakHeap.cpp \
heap/WeakSet.cpp \
heap/WeakHandleOwner.cpp \
heap/WeakBlock.cpp \
heap/HandleHeap.cpp \
heap/HandleSet.cpp \
heap/HandleStack.cpp \
heap/Heap.cpp \
heap/MachineStackMarker.cpp \
......
......@@ -48,7 +48,7 @@ template<typename KeyType, typename MappedType, typename FinalizerCallback, type
class HandleBase {
template <typename T> friend class Weak;
friend class HandleHeap;
friend class HandleSet;
friend struct JSCallbackObjectData;
template <typename KeyType, typename MappedType, typename FinalizerCallback, typename HashArg, typename KeyTraitsArg> friend class WeakGCMap;
......@@ -133,7 +133,7 @@ protected:
}
private:
friend class HandleHeap;
friend class HandleSet;
friend class WeakBlock;
static Handle<T> wrapSlot(HandleSlot slot)
......
......@@ -24,21 +24,21 @@
*/
#include "config.h"
#include "HandleHeap.h"
#include "HandleSet.h"
#include "HeapRootVisitor.h"
#include "JSObject.h"
namespace JSC {
HandleHeap::HandleHeap(JSGlobalData* globalData)
HandleSet::HandleSet(JSGlobalData* globalData)
: m_globalData(globalData)
, m_nextToFinalize(0)
{
grow();
}
void HandleHeap::grow()
void HandleSet::grow()
{
Node* block = m_blockStack.grow();
for (int i = m_blockStack.blockLength - 1; i >= 0; --i) {
......@@ -48,7 +48,7 @@ void HandleHeap::grow()
}
}
void HandleHeap::visitStrongHandles(HeapRootVisitor& heapRootVisitor)
void HandleSet::visitStrongHandles(HeapRootVisitor& heapRootVisitor)
{
Node* end = m_strongList.end();
for (Node* node = m_strongList.begin(); node != end; node = node->next()) {
......@@ -60,7 +60,7 @@ void HandleHeap::visitStrongHandles(HeapRootVisitor& heapRootVisitor)
}
}
void HandleHeap::writeBarrier(HandleSlot slot, const JSValue& value)
void HandleSet::writeBarrier(HandleSlot slot, const JSValue& value)
{
// Forbid assignment to handles during the finalization phase, since it would violate many GC invariants.
// File a bug with stack trace if you hit this.
......@@ -88,7 +88,7 @@ void HandleHeap::writeBarrier(HandleSlot slot, const JSValue& value)
#endif
}
unsigned HandleHeap::protectedGlobalObjectCount()
unsigned HandleSet::protectedGlobalObjectCount()
{
unsigned count = 0;
Node* end = m_strongList.end();
......@@ -101,7 +101,7 @@ unsigned HandleHeap::protectedGlobalObjectCount()
}
#if ENABLE(GC_VALIDATION) || !ASSERT_DISABLED
bool HandleHeap::isLiveNode(Node* node)
bool HandleSet::isLiveNode(Node* node)
{
if (node->prev()->next() != node)
return false;
......
......@@ -23,8 +23,8 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef HandleHeap_h
#define HandleHeap_h
#ifndef HandleSet_h
#define HandleSet_h
#include <wtf/BlockStack.h>
#include "Handle.h"
......@@ -34,17 +34,17 @@
namespace JSC {
class HandleHeap;
class HandleSet;
class HeapRootVisitor;
class JSGlobalData;
class JSValue;
class SlotVisitor;
class HandleHeap {
class HandleSet {
public:
static HandleHeap* heapFor(HandleSlot);
static HandleSet* heapFor(HandleSlot);
HandleHeap(JSGlobalData*);
HandleSet(JSGlobalData*);
JSGlobalData* globalData();
......@@ -63,10 +63,10 @@ private:
class Node {
public:
Node(WTF::SentinelTag);
Node(HandleHeap*);
Node(HandleSet*);
HandleSlot slot();
HandleHeap* handleHeap();
HandleSet* handleSet();
void setPrev(Node*);
Node* prev();
......@@ -76,7 +76,7 @@ private:
private:
JSValue m_value;
HandleHeap* m_handleHeap;
HandleSet* m_handleSet;
Node* m_prev;
Node* m_next;
};
......@@ -99,27 +99,27 @@ private:
Node* m_nextToFinalize;
};
inline HandleHeap* HandleHeap::heapFor(HandleSlot handle)
inline HandleSet* HandleSet::heapFor(HandleSlot handle)
{
return toNode(handle)->handleHeap();
return toNode(handle)->handleSet();
}
inline JSGlobalData* HandleHeap::globalData()
inline JSGlobalData* HandleSet::globalData()
{
return m_globalData;
}
inline HandleSlot HandleHeap::toHandle(Node* node)
inline HandleSlot HandleSet::toHandle(Node* node)
{
return reinterpret_cast<HandleSlot>(node);
}
inline HandleHeap::Node* HandleHeap::toNode(HandleSlot handle)
inline HandleSet::Node* HandleSet::toNode(HandleSlot handle)
{
return reinterpret_cast<Node*>(handle);
}
inline HandleSlot HandleHeap::allocate()
inline HandleSlot HandleSet::allocate()
{
// Forbid assignment to handles during the finalization phase, since it would violate many GC invariants.
// File a bug with stack trace if you hit this.
......@@ -134,7 +134,7 @@ inline HandleSlot HandleHeap::allocate()
return toHandle(node);
}
inline void HandleHeap::deallocate(HandleSlot handle)
inline void HandleSet::deallocate(HandleSlot handle)
{
Node* node = toNode(handle);
if (node == m_nextToFinalize) {
......@@ -146,51 +146,51 @@ inline void HandleHeap::deallocate(HandleSlot handle)
m_freeList.push(node);
}
inline HandleHeap::Node::Node(HandleHeap* handleHeap)
: m_handleHeap(handleHeap)
inline HandleSet::Node::Node(HandleSet* handleSet)
: m_handleSet(handleSet)
, m_prev(0)
, m_next(0)
{
}
inline HandleHeap::Node::Node(WTF::SentinelTag)
: m_handleHeap(0)
inline HandleSet::Node::Node(WTF::SentinelTag)
: m_handleSet(0)
, m_prev(0)
, m_next(0)
{
}
inline HandleSlot HandleHeap::Node::slot()
inline HandleSlot HandleSet::Node::slot()
{
return &m_value;
}
inline HandleHeap* HandleHeap::Node::handleHeap()
inline HandleSet* HandleSet::Node::handleSet()
{
return m_handleHeap;
return m_handleSet;
}
inline void HandleHeap::Node::setPrev(Node* prev)
inline void HandleSet::Node::setPrev(Node* prev)
{
m_prev = prev;
}
inline HandleHeap::Node* HandleHeap::Node::prev()
inline HandleSet::Node* HandleSet::Node::prev()
{
return m_prev;
}
inline void HandleHeap::Node::setNext(Node* next)
inline void HandleSet::Node::setNext(Node* next)
{
m_next = next;
}
inline HandleHeap::Node* HandleHeap::Node::next()
inline HandleSet::Node* HandleSet::Node::next()
{
return m_next;
}
template<typename Functor> void HandleHeap::forEachStrongHandle(Functor& functor, const HashCountedSet<JSCell*>& skipSet)
template<typename Functor> void HandleSet::forEachStrongHandle(Functor& functor, const HashCountedSet<JSCell*>& skipSet)
{
Node* end = m_strongList.end();
for (Node* node = m_strongList.begin(); node != end; node = node->next()) {
......
......@@ -323,8 +323,8 @@ Heap::Heap(JSGlobalData* globalData, HeapSize heapSize)
, m_machineThreads(this)
, m_sharedData(globalData)
, m_slotVisitor(m_sharedData)
, m_weakHeap(this)
, m_handleHeap(globalData)
, m_weakSet(this)
, m_handleSet(globalData)
, m_isSafeToCollect(false)
, m_globalData(globalData)
, m_lastGCLength(0)
......@@ -375,7 +375,7 @@ void Heap::destroy()
canonicalizeCellLivenessData();
clearMarks();
m_weakHeap.finalizeAll();
m_weakSet.finalizeAll();
m_globalData->smallStrings.finalizeSmallStrings();
shrink();
m_storageSpace.destroy();
......@@ -660,7 +660,7 @@ void Heap::markRoots(bool fullGC)
{
GCPHASE(VisitStrongHandles);
m_handleHeap.visitStrongHandles(heapRootVisitor);
m_handleSet.visitStrongHandles(heapRootVisitor);
visitor.donateAndDrain();
}
......@@ -689,7 +689,7 @@ void Heap::markRoots(bool fullGC)
{
GCPHASE(VisitingLiveWeakHandles);
while (true) {
m_weakHeap.visitLiveWeakImpls(heapRootVisitor);
m_weakSet.visitLiveWeakImpls(heapRootVisitor);
harvestWeakReferences();
if (visitor.isEmpty())
break;
......@@ -705,7 +705,7 @@ void Heap::markRoots(bool fullGC)
{
GCPHASE(VisitingDeadWeakHandles);
m_weakHeap.visitDeadWeakImpls(heapRootVisitor);
m_weakSet.visitDeadWeakImpls(heapRootVisitor);
}
GCCOUNTER(VisitedValueCount, visitor.visitCount());
......@@ -818,7 +818,7 @@ void Heap::collect(SweepToggle sweepToggle)
{
GCPHASE(FinalizeWeakHandles);
m_weakHeap.sweep();
m_weakSet.sweep();
m_globalData->smallStrings.finalizeSmallStrings();
}
......@@ -866,7 +866,7 @@ void Heap::canonicalizeCellLivenessData()
void Heap::resetAllocators()
{
m_objectSpace.resetAllocators();
m_weakHeap.resetAllocator();
m_weakSet.resetAllocator();
}
void Heap::setActivityCallback(PassOwnPtr<GCActivityCallback> activityCallback)
......@@ -927,7 +927,7 @@ void Heap::releaseFreeBlocks()
void Heap::addFinalizer(JSCell* cell, Finalizer finalizer)
{
weakHeap()->allocate(cell, &m_finalizerOwner, reinterpret_cast<void*>(finalizer)); // Balanced by FinalizerOwner::finalize().
weakSet()->allocate(cell, &m_finalizerOwner, reinterpret_cast<void*>(finalizer)); // Balanced by FinalizerOwner::finalize().
}
void Heap::FinalizerOwner::finalize(Handle<Unknown> handle, void* context)
......@@ -935,7 +935,7 @@ void Heap::FinalizerOwner::finalize(Handle<Unknown> handle, void* context)
HandleSlot slot = handle.slot();
Finalizer finalizer = reinterpret_cast<Finalizer>(context);
finalizer(slot->asCell());
WeakHeap::deallocate(WeakImpl::asWeakImpl(slot));
WeakSet::deallocate(WeakImpl::asWeakImpl(slot));
}
void Heap::addFunctionExecutable(FunctionExecutable* executable)
......
......@@ -23,7 +23,7 @@
#define Heap_h
#include "DFGCodeBlocks.h"
#include "HandleHeap.h"
#include "HandleSet.h"
#include "HandleStack.h"
#include "MarkedAllocator.h"
#include "MarkedBlock.h"
......@@ -31,7 +31,7 @@
#include "MarkedSpace.h"
#include "SlotVisitor.h"
#include "WeakHandleOwner.h"