Remove CopiedSpace and use MarkedSpace instead
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Sep 2016 22:12:05 +0000 (22:12 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Sep 2016 22:12:05 +0000 (22:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=159658

Reviewed by Keith Miller.

This removes the final client of CopiedSpace, the overrides array of DirectArguments. That
is a simple change.

Then this stubs out some remaining internal debugging code that referenced CopiedSpace in
JSDollarVM and HeapVerifier. I filed FIXMEs to restore that debugging functionality.

The rest of this patch is deleting CopiedSpace.

* API/JSObjectRef.cpp:
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGOperations.cpp:
* heap/ConservativeRoots.cpp:
(JSC::ConservativeRoots::genericAddPointer):
* heap/CopiedAllocator.h: Removed.
* heap/CopiedBlock.cpp: Removed.
* heap/CopiedBlock.h: Removed.
* heap/CopiedBlockInlines.h: Removed.
* heap/CopiedSpace.cpp: Removed.
* heap/CopiedSpace.h: Removed.
* heap/CopiedSpaceInlines.h: Removed.
* heap/CopyBarrier.h: Removed.
* heap/CopyToken.h: Removed.
* heap/CopyVisitor.cpp: Removed.
* heap/CopyVisitor.h: Removed.
* heap/CopyVisitorInlines.h: Removed.
* heap/CopyWorkList.h: Removed.
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::isPagedOut):
(JSC::Heap::updateObjectCounts):
(JSC::Heap::size):
(JSC::Heap::capacity):
(JSC::Heap::collectImpl):
(JSC::Heap::stopAllocation):
(JSC::Heap::updateAllocationLimits):
(JSC::Heap::copyBackingStores): Deleted.
(JSC::Heap::threadBytesCopied): Deleted.
* heap/Heap.h:
(JSC::Heap::objectSpace):
(JSC::Heap::allocatorForAuxiliaryData):
(JSC::Heap::storageSpace): Deleted.
(JSC::Heap::storageAllocator): Deleted.
* heap/HeapCellInlines.h:
* heap/HeapInlines.h:
(JSC::Heap::tryAllocateStorage): Deleted.
(JSC::Heap::tryReallocateStorage): Deleted.
* heap/HeapVerifier.cpp:
(JSC::HeapVerifier::verifyButterflyIsInStorageSpace):
(JSC::HeapVerifier::reportObject):
(JSC::getButterflyDetails): Deleted.
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::copyLater): Deleted.
* heap/SlotVisitor.h:
* jit/AssemblyHelpers.h:
* jit/JITOpcodes.cpp:
* jsc.cpp:
* runtime/ArrayConstructor.cpp:
* runtime/ArrayPrototype.cpp:
* runtime/Butterfly.h:
* runtime/ButterflyInlines.h:
(JSC::Butterfly::createUninitializedDuringCollection): Deleted.
* runtime/ClassInfo.h:
* runtime/DirectArguments.cpp:
(JSC::DirectArguments::visitChildren):
(JSC::DirectArguments::overrideThings):
(JSC::DirectArguments::copyBackingStore): Deleted.
* runtime/DirectArguments.h:
* runtime/JSArray.cpp:
* runtime/JSCell.cpp:
(JSC::JSCell::copyBackingStore): Deleted.
* runtime/JSCell.h:
* runtime/JSLexicalEnvironment.h:
* runtime/JSObject.cpp:
* runtime/JSTypedArrays.cpp:
* runtime/LiteralParser.cpp:
* runtime/ObjectConstructor.cpp:
* runtime/RegExpObject.cpp:
* runtime/StringPrototype.cpp:
* runtime/WeakMapData.cpp:
* tools/JSDollarVMPrototype.cpp:
(JSC::JSDollarVMPrototype::isInStorageSpace):

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

49 files changed:
Source/JavaScriptCore/API/JSObjectRef.cpp
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/dfg/DFGOperations.cpp
Source/JavaScriptCore/heap/ConservativeRoots.cpp
Source/JavaScriptCore/heap/CopiedAllocator.h [deleted file]
Source/JavaScriptCore/heap/CopiedBlock.cpp [deleted file]
Source/JavaScriptCore/heap/CopiedBlock.h [deleted file]
Source/JavaScriptCore/heap/CopiedBlockInlines.h [deleted file]
Source/JavaScriptCore/heap/CopiedSpace.cpp [deleted file]
Source/JavaScriptCore/heap/CopiedSpace.h [deleted file]
Source/JavaScriptCore/heap/CopiedSpaceInlines.h [deleted file]
Source/JavaScriptCore/heap/CopyBarrier.h [deleted file]
Source/JavaScriptCore/heap/CopyToken.h [deleted file]
Source/JavaScriptCore/heap/CopyVisitor.cpp [deleted file]
Source/JavaScriptCore/heap/CopyVisitor.h [deleted file]
Source/JavaScriptCore/heap/CopyVisitorInlines.h [deleted file]
Source/JavaScriptCore/heap/CopyWorkList.h [deleted file]
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/heap/HeapCellInlines.h
Source/JavaScriptCore/heap/HeapInlines.h
Source/JavaScriptCore/heap/HeapVerifier.cpp
Source/JavaScriptCore/heap/SlotVisitor.cpp
Source/JavaScriptCore/heap/SlotVisitor.h
Source/JavaScriptCore/jit/AssemblyHelpers.h
Source/JavaScriptCore/jit/JITOpcodes.cpp
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/runtime/ArrayConstructor.cpp
Source/JavaScriptCore/runtime/ArrayPrototype.cpp
Source/JavaScriptCore/runtime/AuxiliaryBarrier.h
Source/JavaScriptCore/runtime/Butterfly.h
Source/JavaScriptCore/runtime/ButterflyInlines.h
Source/JavaScriptCore/runtime/ClassInfo.h
Source/JavaScriptCore/runtime/DirectArguments.cpp
Source/JavaScriptCore/runtime/DirectArguments.h
Source/JavaScriptCore/runtime/JSArray.cpp
Source/JavaScriptCore/runtime/JSCell.cpp
Source/JavaScriptCore/runtime/JSCell.h
Source/JavaScriptCore/runtime/JSLexicalEnvironment.h
Source/JavaScriptCore/runtime/JSObject.cpp
Source/JavaScriptCore/runtime/JSTypedArrays.cpp
Source/JavaScriptCore/runtime/LiteralParser.cpp
Source/JavaScriptCore/runtime/ObjectConstructor.cpp
Source/JavaScriptCore/runtime/RegExpObject.cpp
Source/JavaScriptCore/runtime/StringPrototype.cpp
Source/JavaScriptCore/runtime/WeakMapData.cpp
Source/JavaScriptCore/tools/JSDollarVMPrototype.cpp

index c1ddc32..86f2a9e 100644 (file)
@@ -32,7 +32,6 @@
 #include "APIUtils.h"
 #include "ButterflyInlines.h"
 #include "CodeBlock.h"
-#include "CopiedSpaceInlines.h"
 #include "DateConstructor.h"
 #include "ErrorConstructor.h"
 #include "Exception.h"
index 06feac6..f17ed63 100644 (file)
@@ -441,9 +441,6 @@ set(JavaScriptCore_SOURCES
     heap/AllocatorAttributes.cpp
     heap/CodeBlockSet.cpp
     heap/ConservativeRoots.cpp
-    heap/CopiedBlock.cpp
-    heap/CopiedSpace.cpp
-    heap/CopyVisitor.cpp
     heap/DeferGC.cpp
     heap/DestructionMode.cpp
     heap/EdenGCActivityCallback.cpp
index 49decaf..da5571a 100644 (file)
@@ -1,5 +1,95 @@
 2016-09-08  Filip Pizlo  <fpizlo@apple.com>
 
+        Remove CopiedSpace and use MarkedSpace instead
+        https://bugs.webkit.org/show_bug.cgi?id=159658
+
+        Reviewed by Keith Miller.
+        
+        This removes the final client of CopiedSpace, the overrides array of DirectArguments. That
+        is a simple change.
+        
+        Then this stubs out some remaining internal debugging code that referenced CopiedSpace in
+        JSDollarVM and HeapVerifier. I filed FIXMEs to restore that debugging functionality.
+        
+        The rest of this patch is deleting CopiedSpace.
+
+        * API/JSObjectRef.cpp:
+        * CMakeLists.txt:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * dfg/DFGOperations.cpp:
+        * heap/ConservativeRoots.cpp:
+        (JSC::ConservativeRoots::genericAddPointer):
+        * heap/CopiedAllocator.h: Removed.
+        * heap/CopiedBlock.cpp: Removed.
+        * heap/CopiedBlock.h: Removed.
+        * heap/CopiedBlockInlines.h: Removed.
+        * heap/CopiedSpace.cpp: Removed.
+        * heap/CopiedSpace.h: Removed.
+        * heap/CopiedSpaceInlines.h: Removed.
+        * heap/CopyBarrier.h: Removed.
+        * heap/CopyToken.h: Removed.
+        * heap/CopyVisitor.cpp: Removed.
+        * heap/CopyVisitor.h: Removed.
+        * heap/CopyVisitorInlines.h: Removed.
+        * heap/CopyWorkList.h: Removed.
+        * heap/Heap.cpp:
+        (JSC::Heap::Heap):
+        (JSC::Heap::isPagedOut):
+        (JSC::Heap::updateObjectCounts):
+        (JSC::Heap::size):
+        (JSC::Heap::capacity):
+        (JSC::Heap::collectImpl):
+        (JSC::Heap::stopAllocation):
+        (JSC::Heap::updateAllocationLimits):
+        (JSC::Heap::copyBackingStores): Deleted.
+        (JSC::Heap::threadBytesCopied): Deleted.
+        * heap/Heap.h:
+        (JSC::Heap::objectSpace):
+        (JSC::Heap::allocatorForAuxiliaryData):
+        (JSC::Heap::storageSpace): Deleted.
+        (JSC::Heap::storageAllocator): Deleted.
+        * heap/HeapCellInlines.h:
+        * heap/HeapInlines.h:
+        (JSC::Heap::tryAllocateStorage): Deleted.
+        (JSC::Heap::tryReallocateStorage): Deleted.
+        * heap/HeapVerifier.cpp:
+        (JSC::HeapVerifier::verifyButterflyIsInStorageSpace):
+        (JSC::HeapVerifier::reportObject):
+        (JSC::getButterflyDetails): Deleted.
+        * heap/SlotVisitor.cpp:
+        (JSC::SlotVisitor::copyLater): Deleted.
+        * heap/SlotVisitor.h:
+        * jit/AssemblyHelpers.h:
+        * jit/JITOpcodes.cpp:
+        * jsc.cpp:
+        * runtime/ArrayConstructor.cpp:
+        * runtime/ArrayPrototype.cpp:
+        * runtime/Butterfly.h:
+        * runtime/ButterflyInlines.h:
+        (JSC::Butterfly::createUninitializedDuringCollection): Deleted.
+        * runtime/ClassInfo.h:
+        * runtime/DirectArguments.cpp:
+        (JSC::DirectArguments::visitChildren):
+        (JSC::DirectArguments::overrideThings):
+        (JSC::DirectArguments::copyBackingStore): Deleted.
+        * runtime/DirectArguments.h:
+        * runtime/JSArray.cpp:
+        * runtime/JSCell.cpp:
+        (JSC::JSCell::copyBackingStore): Deleted.
+        * runtime/JSCell.h:
+        * runtime/JSLexicalEnvironment.h:
+        * runtime/JSObject.cpp:
+        * runtime/JSTypedArrays.cpp:
+        * runtime/LiteralParser.cpp:
+        * runtime/ObjectConstructor.cpp:
+        * runtime/RegExpObject.cpp:
+        * runtime/StringPrototype.cpp:
+        * runtime/WeakMapData.cpp:
+        * tools/JSDollarVMPrototype.cpp:
+        (JSC::JSDollarVMPrototype::isInStorageSpace):
+
+2016-09-08  Filip Pizlo  <fpizlo@apple.com>
+
         Heap version should be 32-bit
         https://bugs.webkit.org/show_bug.cgi?id=161751
 
index 536eca9..f3dc16d 100644 (file)
                0F5874EE194FEB1200AAB2C1 /* DFGMayExit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5874EC194FEB1200AAB2C1 /* DFGMayExit.h */; };
                0F5A1273192D9FDF008764A3 /* DFGDoesGC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5A1271192D9FDF008764A3 /* DFGDoesGC.cpp */; };
                0F5A1274192D9FDF008764A3 /* DFGDoesGC.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5A1272192D9FDF008764A3 /* DFGDoesGC.h */; };
-               0F5A52D017ADD717008ECB2D /* CopyToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5A52CF17ADD717008ECB2D /* CopyToken.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0F5A6283188C98D40072C9DF /* FTLValueRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5A6281188C98D40072C9DF /* FTLValueRange.cpp */; };
                0F5A6284188C98D40072C9DF /* FTLValueRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5A6282188C98D40072C9DF /* FTLValueRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0F5B4A331C84F0D600F1B17E /* SlowPathReturnType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5B4A321C84F0D600F1B17E /* SlowPathReturnType.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0F79085619A290B200F6310C /* DFGStructureRegistrationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F79085419A290B200F6310C /* DFGStructureRegistrationPhase.h */; };
                0F7B294B14C3CD2F007C3DB1 /* DFGCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD82E1F14172C2F00179C94 /* DFGCapabilities.h */; };
                0F7B294D14C3CD4C007C3DB1 /* DFGCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FC0977E1469EBC400CF2442 /* DFGCommon.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               0F7C11AD1BC3862C00C74CDB /* CopyBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7C11AC1BC3862C00C74CDB /* CopyBarrier.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0F7C39FB1C8F629300480151 /* RegExpInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7C39FA1C8F629300480151 /* RegExpInlines.h */; };
                0F7C39FD1C8F659500480151 /* RegExpObjectInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7C39FC1C8F659500480151 /* RegExpObjectInlines.h */; };
                0F7C39FF1C90C55B00480151 /* DFGOpInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7C39FE1C90C55B00480151 /* DFGOpInfo.h */; };
                0FB7F39C15ED8E4600F167B2 /* PropertyStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39015ED8E3800F167B2 /* PropertyStorage.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FB7F39D15ED8E4600F167B2 /* Reject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39115ED8E3800F167B2 /* Reject.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FB7F39E15ED8E4600F167B2 /* SparseArrayValueMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB7F39215ED8E3800F167B2 /* SparseArrayValueMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               0FBADF541BD1F4B800E073C1 /* CopiedBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FBADF531BD1F4B800E073C1 /* CopiedBlock.cpp */; };
                0FBC0AE71496C7C400D4FBDD /* DFGExitProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FBC0AE41496C7C100D4FBDD /* DFGExitProfile.cpp */; };
                0FBC0AE81496C7C700D4FBDD /* DFGExitProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBC0AE51496C7C100D4FBDD /* DFGExitProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FBD7E691447999600481315 /* CodeOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FBD7E671447998F00481315 /* CodeOrigin.h */; settings = {ATTRIBUTES = (Private, ); }; };
                C20BA92D16BB1C1500B3AEA2 /* StructureRareDataInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C20BA92C16BB1C1500B3AEA2 /* StructureRareDataInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
                C2160FE715F7E95E00942DFC /* SlotVisitorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB408515C0A3C30048932B /* SlotVisitorInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
                C2181FC218A948FB0025A235 /* JSExportTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = C2181FC118A948FB0025A235 /* JSExportTests.mm */; };
-               C218D1401655CFD50062BB81 /* CopyWorkList.h in Headers */ = {isa = PBXBuildFile; fileRef = C218D13F1655CFD50062BB81 /* CopyWorkList.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               C2239D1716262BDD005AC5FD /* CopyVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2239D1216262BDD005AC5FD /* CopyVisitor.cpp */; };
-               C2239D1816262BDD005AC5FD /* CopyVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = C2239D1316262BDD005AC5FD /* CopyVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               C2239D1916262BDD005AC5FD /* CopyVisitorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2239D1416262BDD005AC5FD /* CopyVisitorInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
                C225494315F7DBAA0065E898 /* SlotVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C225494215F7DBAA0065E898 /* SlotVisitor.cpp */; };
                C22B31B9140577D700DB475A /* SamplingCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F77008E1402FDD60078EB39 /* SamplingCounter.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               C240305514B404E60079EB64 /* CopiedSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C240305314B404C90079EB64 /* CopiedSpace.cpp */; };
                C24D31E2161CD695002AA4DB /* HeapStatistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C24D31E0161CD695002AA4DB /* HeapStatistics.cpp */; };
                C24D31E3161CD695002AA4DB /* HeapStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = C24D31E1161CD695002AA4DB /* HeapStatistics.h */; settings = {ATTRIBUTES = (Private, ); }; };
                C25D709B16DE99F400FCA6BC /* JSManagedValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = C25D709916DE99F400FCA6BC /* JSManagedValue.mm */; };
                C2B916C514DA040C00CBAC86 /* MarkedAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2B916C414DA040C00CBAC86 /* MarkedAllocator.cpp */; };
                C2C0F7CD17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2C0F7CB17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp */; };
                C2C0F7CE17BBFC5B00464FE4 /* DFGDesiredTransitions.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C0F7CC17BBFC5B00464FE4 /* DFGDesiredTransitions.h */; };
-               C2C8D02D14A3C6E000578E65 /* CopiedSpaceInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02B14A3C6B200578E65 /* CopiedSpaceInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               C2C8D03014A3CEFC00578E65 /* CopiedBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02E14A3CEFC00578E65 /* CopiedBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
                C2CF39C116E15A8100DD69BE /* JSAPIWrapperObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = C2CF39BF16E15A8100DD69BE /* JSAPIWrapperObject.mm */; };
                C2CF39C216E15A8100DD69BE /* JSAPIWrapperObject.h in Headers */ = {isa = PBXBuildFile; fileRef = C2CF39C016E15A8100DD69BE /* JSAPIWrapperObject.h */; };
                C2DA778318E259990066FCB6 /* HeapInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2DA778218E259990066FCB6 /* HeapInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
                C2E526BD1590EF000054E48D /* HeapTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2E526BB1590EF000054E48D /* HeapTimer.cpp */; };
                C2E526BE1590EF000054E48D /* HeapTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = C2E526BC1590EF000054E48D /* HeapTimer.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               C2EAA3FA149A835E00FCE112 /* CopiedSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = C2EAA3F8149A830800FCE112 /* CopiedSpace.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               C2EAD2FC14F0249800A4B159 /* CopiedAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = C2EAD2FB14F0249800A4B159 /* CopiedAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; };
                C2F0F2D116BAEEE900187C19 /* StructureRareData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2F0F2D016BAEEE900187C19 /* StructureRareData.cpp */; };
-               C2FC9BD316644DFB00810D33 /* CopiedBlockInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FC9BD216644DFB00810D33 /* CopiedBlockInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
                C2FCAE1017A9C24E0034C735 /* BytecodeBasicBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2FCAE0C17A9C24E0034C735 /* BytecodeBasicBlock.cpp */; };
                C2FCAE1117A9C24E0034C735 /* BytecodeBasicBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FCAE0D17A9C24E0034C735 /* BytecodeBasicBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
                C2FCAE1217A9C24E0034C735 /* BytecodeLivenessAnalysis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2FCAE0E17A9C24E0034C735 /* BytecodeLivenessAnalysis.cpp */; };
                0F5874EC194FEB1200AAB2C1 /* DFGMayExit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGMayExit.h; path = dfg/DFGMayExit.h; sourceTree = "<group>"; };
                0F5A1271192D9FDF008764A3 /* DFGDoesGC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDoesGC.cpp; path = dfg/DFGDoesGC.cpp; sourceTree = "<group>"; };
                0F5A1272192D9FDF008764A3 /* DFGDoesGC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDoesGC.h; path = dfg/DFGDoesGC.h; sourceTree = "<group>"; };
-               0F5A52CF17ADD717008ECB2D /* CopyToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopyToken.h; sourceTree = "<group>"; };
                0F5A6281188C98D40072C9DF /* FTLValueRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLValueRange.cpp; path = ftl/FTLValueRange.cpp; sourceTree = "<group>"; };
                0F5A6282188C98D40072C9DF /* FTLValueRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLValueRange.h; path = ftl/FTLValueRange.h; sourceTree = "<group>"; };
                0F5B4A321C84F0D600F1B17E /* SlowPathReturnType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlowPathReturnType.h; sourceTree = "<group>"; };
                0F7700911402FF280078EB39 /* SamplingCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SamplingCounter.cpp; sourceTree = "<group>"; };
                0F79085319A290B200F6310C /* DFGStructureRegistrationPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGStructureRegistrationPhase.cpp; path = dfg/DFGStructureRegistrationPhase.cpp; sourceTree = "<group>"; };
                0F79085419A290B200F6310C /* DFGStructureRegistrationPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGStructureRegistrationPhase.h; path = dfg/DFGStructureRegistrationPhase.h; sourceTree = "<group>"; };
-               0F7C11AC1BC3862C00C74CDB /* CopyBarrier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopyBarrier.h; sourceTree = "<group>"; };
                0F7C39FA1C8F629300480151 /* RegExpInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpInlines.h; sourceTree = "<group>"; };
                0F7C39FC1C8F659500480151 /* RegExpObjectInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpObjectInlines.h; sourceTree = "<group>"; };
                0F7C39FE1C90C55B00480151 /* DFGOpInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGOpInfo.h; path = dfg/DFGOpInfo.h; sourceTree = "<group>"; };
                0FB7F39015ED8E3800F167B2 /* PropertyStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertyStorage.h; sourceTree = "<group>"; };
                0FB7F39115ED8E3800F167B2 /* Reject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reject.h; sourceTree = "<group>"; };
                0FB7F39215ED8E3800F167B2 /* SparseArrayValueMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SparseArrayValueMap.h; sourceTree = "<group>"; };
-               0FBADF531BD1F4B800E073C1 /* CopiedBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CopiedBlock.cpp; sourceTree = "<group>"; };
                0FBC0AE41496C7C100D4FBDD /* DFGExitProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DFGExitProfile.cpp; sourceTree = "<group>"; };
                0FBC0AE51496C7C100D4FBDD /* DFGExitProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFGExitProfile.h; sourceTree = "<group>"; };
                0FBD7E671447998F00481315 /* CodeOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeOrigin.h; sourceTree = "<group>"; };
                C211B574176A224D000E2A23 /* APICallbackFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APICallbackFunction.h; sourceTree = "<group>"; };
                C2181FC018A948FB0025A235 /* JSExportTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSExportTests.h; path = API/tests/JSExportTests.h; sourceTree = "<group>"; };
                C2181FC118A948FB0025A235 /* JSExportTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = JSExportTests.mm; path = API/tests/JSExportTests.mm; sourceTree = "<group>"; };
-               C218D13F1655CFD50062BB81 /* CopyWorkList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopyWorkList.h; sourceTree = "<group>"; };
-               C2239D1216262BDD005AC5FD /* CopyVisitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CopyVisitor.cpp; sourceTree = "<group>"; };
-               C2239D1316262BDD005AC5FD /* CopyVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopyVisitor.h; sourceTree = "<group>"; };
-               C2239D1416262BDD005AC5FD /* CopyVisitorInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopyVisitorInlines.h; sourceTree = "<group>"; };
                C225494215F7DBAA0065E898 /* SlotVisitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SlotVisitor.cpp; sourceTree = "<group>"; };
-               C240305314B404C90079EB64 /* CopiedSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CopiedSpace.cpp; sourceTree = "<group>"; };
                C24D31E0161CD695002AA4DB /* HeapStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeapStatistics.cpp; sourceTree = "<group>"; };
                C24D31E1161CD695002AA4DB /* HeapStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapStatistics.h; sourceTree = "<group>"; };
                C25D709916DE99F400FCA6BC /* JSManagedValue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JSManagedValue.mm; sourceTree = "<group>"; };
                C2B916C414DA040C00CBAC86 /* MarkedAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkedAllocator.cpp; sourceTree = "<group>"; };
                C2C0F7CB17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredTransitions.cpp; path = dfg/DFGDesiredTransitions.cpp; sourceTree = "<group>"; };
                C2C0F7CC17BBFC5B00464FE4 /* DFGDesiredTransitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDesiredTransitions.h; path = dfg/DFGDesiredTransitions.h; sourceTree = "<group>"; };
-               C2C8D02B14A3C6B200578E65 /* CopiedSpaceInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopiedSpaceInlines.h; sourceTree = "<group>"; };
-               C2C8D02E14A3CEFC00578E65 /* CopiedBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopiedBlock.h; sourceTree = "<group>"; };
                C2CF39BF16E15A8100DD69BE /* JSAPIWrapperObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JSAPIWrapperObject.mm; sourceTree = "<group>"; };
                C2CF39C016E15A8100DD69BE /* JSAPIWrapperObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAPIWrapperObject.h; sourceTree = "<group>"; };
                C2DA778218E259990066FCB6 /* HeapInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapInlines.h; sourceTree = "<group>"; };
                C2E526BB1590EF000054E48D /* HeapTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeapTimer.cpp; sourceTree = "<group>"; };
                C2E526BC1590EF000054E48D /* HeapTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapTimer.h; sourceTree = "<group>"; };
-               C2EAA3F8149A830800FCE112 /* CopiedSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopiedSpace.h; sourceTree = "<group>"; };
-               C2EAD2FB14F0249800A4B159 /* CopiedAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopiedAllocator.h; sourceTree = "<group>"; };
                C2F0F2D016BAEEE900187C19 /* StructureRareData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StructureRareData.cpp; sourceTree = "<group>"; };
-               C2FC9BD216644DFB00810D33 /* CopiedBlockInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopiedBlockInlines.h; sourceTree = "<group>"; };
                C2FCAE0C17A9C24E0034C735 /* BytecodeBasicBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BytecodeBasicBlock.cpp; sourceTree = "<group>"; };
                C2FCAE0D17A9C24E0034C735 /* BytecodeBasicBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BytecodeBasicBlock.h; sourceTree = "<group>"; };
                C2FCAE0E17A9C24E0034C735 /* BytecodeLivenessAnalysis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BytecodeLivenessAnalysis.cpp; sourceTree = "<group>"; };
                                0FD8A31217D4326C00CA2C40 /* CodeBlockSet.h */,
                                146B14DB12EB5B12001BEC1B /* ConservativeRoots.cpp */,
                                149DAAF212EB559D0083B12B /* ConservativeRoots.h */,
-                               C2EAD2FB14F0249800A4B159 /* CopiedAllocator.h */,
-                               0FBADF531BD1F4B800E073C1 /* CopiedBlock.cpp */,
-                               C2C8D02E14A3CEFC00578E65 /* CopiedBlock.h */,
-                               C2FC9BD216644DFB00810D33 /* CopiedBlockInlines.h */,
-                               C240305314B404C90079EB64 /* CopiedSpace.cpp */,
-                               C2EAA3F8149A830800FCE112 /* CopiedSpace.h */,
-                               C2C8D02B14A3C6B200578E65 /* CopiedSpaceInlines.h */,
-                               0F7C11AC1BC3862C00C74CDB /* CopyBarrier.h */,
-                               0F5A52CF17ADD717008ECB2D /* CopyToken.h */,
-                               C2239D1216262BDD005AC5FD /* CopyVisitor.cpp */,
-                               C2239D1316262BDD005AC5FD /* CopyVisitor.h */,
-                               C2239D1416262BDD005AC5FD /* CopyVisitorInlines.h */,
-                               C218D13F1655CFD50062BB81 /* CopyWorkList.h */,
                                2A7A58EE1808A4C40020BDF7 /* DeferGC.cpp */,
                                0F136D4B174AD69B0075B354 /* DeferGC.h */,
                                0F9630371D4192C3005609D9 /* DestructionMode.cpp */,
                                BC18C3F60E16F5CD00B34460 /* ConstructData.h in Headers */,
                                A57D23F21891B5B40031C7FA /* ContentSearchUtilities.h in Headers */,
                                52678F911A04177C006A306D /* ControlFlowProfiler.h in Headers */,
-                               C2EAD2FC14F0249800A4B159 /* CopiedAllocator.h in Headers */,
-                               C2C8D03014A3CEFC00578E65 /* CopiedBlock.h in Headers */,
-                               C2FC9BD316644DFB00810D33 /* CopiedBlockInlines.h in Headers */,
-                               C2EAA3FA149A835E00FCE112 /* CopiedSpace.h in Headers */,
-                               C2C8D02D14A3C6E000578E65 /* CopiedSpaceInlines.h in Headers */,
-                               0F7C11AD1BC3862C00C74CDB /* CopyBarrier.h in Headers */,
-                               0F5A52D017ADD717008ECB2D /* CopyToken.h in Headers */,
-                               C2239D1816262BDD005AC5FD /* CopyVisitor.h in Headers */,
                                53486BB71C1795C300F6F3AF /* JSTypedArray.h in Headers */,
-                               C2239D1916262BDD005AC5FD /* CopyVisitorInlines.h in Headers */,
-                               C218D1401655CFD50062BB81 /* CopyWorkList.h in Headers */,
                                C4F4B6F41A05C944005CAB76 /* cpp_generator.py in Headers */,
                                0F338E1C1BF286EA0013C88F /* B3BlockInsertionSet.h in Headers */,
                                0F9495881C57F47500413A48 /* B3StackSlot.h in Headers */,
                                1428082E107EC0570013E7B2 /* ConstructData.cpp in Sources */,
                                A57D23F11891B5B40031C7FA /* ContentSearchUtilities.cpp in Sources */,
                                52B717B51A0597E1007AF4F3 /* ControlFlowProfiler.cpp in Sources */,
-                               0FBADF541BD1F4B800E073C1 /* CopiedBlock.cpp in Sources */,
                                A5FC84B31D1DDAD9006B5C46 /* DebuggerLocation.cpp in Sources */,
-                               C240305514B404E60079EB64 /* CopiedSpace.cpp in Sources */,
                                0F6183301C45BF070072450B /* AirLowerMacros.cpp in Sources */,
-                               C2239D1716262BDD005AC5FD /* CopyVisitor.cpp in Sources */,
                                2A111245192FCE79005EE18D /* CustomGetterSetter.cpp in Sources */,
                                62E3D5F01B8D0B7300B868BB /* DataFormat.cpp in Sources */,
                                0F2B66DE17B6B5AB00A7AE3F /* DataView.cpp in Sources */,
index b28929c..2f9f329 100644 (file)
@@ -31,7 +31,6 @@
 #include "ClonedArguments.h"
 #include "CodeBlock.h"
 #include "CommonSlowPaths.h"
-#include "CopiedSpaceInlines.h"
 #include "DFGDriver.h"
 #include "DFGJITCode.h"
 #include "DFGOSRExit.h"
index 3846dc9..02397cf 100644 (file)
@@ -28,8 +28,6 @@
 
 #include "CodeBlock.h"
 #include "CodeBlockSet.h"
-#include "CopiedSpace.h"
-#include "CopiedSpaceInlines.h"
 #include "HeapInlines.h"
 #include "HeapUtil.h"
 #include "JITStubRoutineSet.h"
@@ -71,8 +69,6 @@ inline void ConservativeRoots::genericAddPointer(void* p, HeapVersion version, T
 {
     markHook.mark(p);
 
-    m_heap.storageSpace().pinIfNecessary(p);
-
     HeapUtil::findGCObjectPointersForMarking(
         m_heap, version, filter, p,
         [&] (void* p) {
diff --git a/Source/JavaScriptCore/heap/CopiedAllocator.h b/Source/JavaScriptCore/heap/CopiedAllocator.h
deleted file mode 100644 (file)
index 143117f..0000000
+++ /dev/null
@@ -1,165 +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. ``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
- * 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 CopiedAllocator_h
-#define CopiedAllocator_h
-
-#include "CopiedBlock.h"
-#include <wtf/CheckedBoolean.h>
-
-namespace JSC {
-
-class CopiedAllocator {
-public:
-    CopiedAllocator();
-    
-    bool fastPathShouldSucceed(size_t bytes) const;
-    CheckedBoolean tryAllocate(size_t bytes, void** outPtr);
-    CheckedBoolean tryAllocateDuringCopying(size_t bytes, void** outPtr);
-    CheckedBoolean tryReallocate(void *oldPtr, size_t oldBytes, size_t newBytes);
-    void* forceAllocate(size_t bytes);
-    CopiedBlock* resetCurrentBlock();
-    void setCurrentBlock(CopiedBlock*);
-    size_t currentCapacity();
-    
-    bool isValid() const { return !!m_currentBlock; }
-
-    CopiedBlock* currentBlock() { return m_currentBlock; }
-
-    // Yes, these are public. No, that doesn't mean you can play with them.
-    // If I had made them private then I'd have to list off all of the JIT
-    // classes and functions that are entitled to modify these directly, and
-    // that would have been gross.
-    size_t m_currentRemaining;
-    char* m_currentPayloadEnd;
-    CopiedBlock* m_currentBlock; 
-};
-
-inline CopiedAllocator::CopiedAllocator()
-    : m_currentRemaining(0)
-    , m_currentPayloadEnd(0)
-    , m_currentBlock(0)
-{
-}
-
-inline bool CopiedAllocator::fastPathShouldSucceed(size_t bytes) const
-{
-    ASSERT(is8ByteAligned(reinterpret_cast<void*>(bytes)));
-    
-    return bytes <= m_currentRemaining;
-}
-
-inline CheckedBoolean CopiedAllocator::tryAllocate(size_t bytes, void** outPtr)
-{
-    ASSERT(is8ByteAligned(reinterpret_cast<void*>(bytes)));
-    
-    // This code is written in a gratuitously low-level manner, in order to
-    // serve as a kind of template for what the JIT would do. Note that the
-    // way it's written it ought to only require one register, which doubles
-    // as the result, provided that the compiler does a minimal amount of
-    // control flow simplification and the bytes argument is a constant.
-    
-    size_t currentRemaining = m_currentRemaining;
-    if (bytes > currentRemaining)
-        return false;
-    currentRemaining -= bytes;
-    m_currentRemaining = currentRemaining;
-    *outPtr = m_currentPayloadEnd - currentRemaining - bytes;
-
-    ASSERT(is8ByteAligned(*outPtr));
-
-    return true;
-}
-
-inline CheckedBoolean CopiedAllocator::tryAllocateDuringCopying(size_t bytes, void** outPtr)
-{
-    if (!tryAllocate(bytes, outPtr))
-        return false;
-    m_currentBlock->reportLiveBytesDuringCopying(bytes);
-    return true;
-}
-
-inline CheckedBoolean CopiedAllocator::tryReallocate(
-    void* oldPtr, size_t oldBytes, size_t newBytes)
-{
-    ASSERT(is8ByteAligned(oldPtr));
-    ASSERT(is8ByteAligned(reinterpret_cast<void*>(oldBytes)));
-    ASSERT(is8ByteAligned(reinterpret_cast<void*>(newBytes)));
-    
-    ASSERT(newBytes > oldBytes);
-    
-    size_t additionalBytes = newBytes - oldBytes;
-    
-    size_t currentRemaining = m_currentRemaining;
-    if (m_currentPayloadEnd - currentRemaining - oldBytes != static_cast<char*>(oldPtr))
-        return false;
-    
-    if (additionalBytes > currentRemaining)
-        return false;
-    
-    m_currentRemaining = currentRemaining - additionalBytes;
-    
-    return true;
-}
-
-inline void* CopiedAllocator::forceAllocate(size_t bytes)
-{
-    void* result = 0; // Needed because compilers don't realize this will always be assigned.
-    CheckedBoolean didSucceed = tryAllocate(bytes, &result);
-    ASSERT(didSucceed);
-    return result;
-}
-
-inline CopiedBlock* CopiedAllocator::resetCurrentBlock()
-{
-    CopiedBlock* result = m_currentBlock;
-    if (result) {
-        result->m_remaining = m_currentRemaining;
-        m_currentBlock = 0;
-        m_currentRemaining = 0;
-        m_currentPayloadEnd = 0;
-    }
-    return result;
-}
-
-inline void CopiedAllocator::setCurrentBlock(CopiedBlock* newBlock)
-{
-    ASSERT(!m_currentBlock);
-    m_currentBlock = newBlock;
-    ASSERT(newBlock);
-    m_currentRemaining = newBlock->m_remaining;
-    m_currentPayloadEnd = newBlock->payloadEnd();
-}
-
-inline size_t CopiedAllocator::currentCapacity()
-{
-    if (!m_currentBlock)
-        return 0;
-    return m_currentBlock->capacity();
-}
-
-} // namespace JSC
-
-#endif
diff --git a/Source/JavaScriptCore/heap/CopiedBlock.cpp b/Source/JavaScriptCore/heap/CopiedBlock.cpp
deleted file mode 100644 (file)
index 13798a1..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2015 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. ``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
- * 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 "CopiedBlock.h"
-
-#include "JSCInlines.h"
-
-namespace JSC {
-
-static const bool computeBalance = false;
-static size_t balance;
-
-CopiedBlock* CopiedBlock::createNoZeroFill(Heap& heap, size_t capacity)
-{
-    if (computeBalance) {
-        balance++;
-        if (!(balance % 10))
-            dataLog("CopiedBlock Balance: ", balance, "\n");
-    }
-    CopiedBlock* block = new (NotNull, fastAlignedMalloc(CopiedBlock::blockSize, capacity)) CopiedBlock(capacity);
-    heap.didAllocateBlock(capacity);
-    return block;
-}
-
-void CopiedBlock::destroy(Heap& heap, CopiedBlock* copiedBlock)
-{
-    if (computeBalance) {
-        balance--;
-        if (!(balance % 10))
-            dataLog("CopiedBlock Balance: ", balance, "\n");
-    }
-    size_t capacity = copiedBlock->capacity();
-    copiedBlock->~CopiedBlock();
-    fastAlignedFree(copiedBlock);
-    heap.didFreeBlock(capacity);
-}
-
-CopiedBlock* CopiedBlock::create(Heap& heap, size_t capacity)
-{
-    CopiedBlock* newBlock = createNoZeroFill(heap, capacity);
-    newBlock->zeroFillWilderness();
-    return newBlock;
-}
-
-void CopiedBlock::zeroFillWilderness()
-{
-#if USE(JSVALUE64)
-    memset(wilderness(), 0, wildernessSize());
-#else
-    JSValue emptyValue;
-    JSValue* limit = reinterpret_cast_ptr<JSValue*>(wildernessEnd());
-    for (JSValue* currentValue = reinterpret_cast_ptr<JSValue*>(wilderness()); currentValue < limit; currentValue++)
-        *currentValue = emptyValue;
-#endif
-}
-
-CopiedBlock::CopiedBlock(size_t capacity)
-    : DoublyLinkedListNode<CopiedBlock>()
-    , m_capacity(capacity)
-    , m_remaining(payloadCapacity())
-    , m_isPinned(false)
-    , m_isOld(false)
-    , m_liveBytes(0)
-#ifndef NDEBUG
-    , m_liveObjects(0)
-#endif
-{
-    ASSERT(is8ByteAligned(reinterpret_cast<void*>(m_remaining)));
-}
-
-} // namespace JSC
diff --git a/Source/JavaScriptCore/heap/CopiedBlock.h b/Source/JavaScriptCore/heap/CopiedBlock.h
deleted file mode 100644 (file)
index 34f263a..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Copyright (C) 2011, 2015 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. ``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
- * 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 CopiedBlock_h
-#define CopiedBlock_h
-
-#include "CopyWorkList.h"
-#include "JSCJSValue.h"
-#include "Options.h"
-#include <wtf/DoublyLinkedList.h>
-#include <wtf/Lock.h>
-
-namespace JSC {
-
-class CopiedSpace;
-
-class CopiedBlock : public DoublyLinkedListNode<CopiedBlock> {
-    friend class WTF::DoublyLinkedListNode<CopiedBlock>;
-    friend class CopiedSpace;
-    friend class CopiedAllocator;
-public:
-    static CopiedBlock* create(Heap&, size_t = blockSize);
-    static CopiedBlock* createNoZeroFill(Heap&, size_t = blockSize);
-    static void destroy(Heap&, CopiedBlock*);
-
-    void pin();
-    bool isPinned();
-
-    bool isOld();
-    bool isOversize();
-    void didPromote();
-
-    unsigned liveBytes();
-    void reportLiveBytes(LockHolder&, JSCell*, CopyToken, unsigned);
-    void reportLiveBytesDuringCopying(unsigned);
-    void didSurviveGC();
-    void didEvacuateBytes(unsigned);
-    bool shouldEvacuate();
-    bool canBeRecycled();
-
-    // The payload is the region of the block that is usable for allocations.
-    char* payload();
-    char* payloadEnd();
-    size_t payloadCapacity();
-    
-    // The data is the region of the block that has been used for allocations.
-    char* data();
-    char* dataEnd();
-    size_t dataSize();
-    
-    // The wilderness is the region of the block that is usable for allocations
-    // but has not been so used.
-    char* wilderness();
-    char* wildernessEnd();
-    size_t wildernessSize();
-    
-    size_t size();
-    size_t capacity();
-
-    static const size_t blockSize = 64 * KB;
-
-    bool hasWorkList();
-    CopyWorkList& workList();
-    Lock& workListLock() { return m_workListLock; }
-
-private:
-    CopiedBlock(size_t);
-    void zeroFillWilderness(); // Can be called at any time to zero-fill to the end of the block.
-
-    void checkConsistency();
-
-    CopiedBlock* m_prev;
-    CopiedBlock* m_next;
-
-    size_t m_capacity;
-
-    Lock m_workListLock;
-    std::unique_ptr<CopyWorkList> m_workList;
-
-    size_t m_remaining;
-    bool m_isPinned : 1;
-    bool m_isOld : 1;
-    unsigned m_liveBytes;
-#ifndef NDEBUG
-    unsigned m_liveObjects;
-#endif
-};
-
-inline void CopiedBlock::didSurviveGC()
-{
-    checkConsistency();
-    ASSERT(isOld());
-    m_liveBytes = 0;
-#ifndef NDEBUG
-    m_liveObjects = 0;
-#endif
-    m_isPinned = false;
-    if (m_workList)
-        m_workList = nullptr;
-}
-
-inline void CopiedBlock::didEvacuateBytes(unsigned bytes)
-{
-    ASSERT(m_liveBytes >= bytes);
-    ASSERT(m_liveObjects);
-    checkConsistency();
-    m_liveBytes -= bytes;
-#ifndef NDEBUG
-    m_liveObjects--;
-#endif
-    checkConsistency();
-}
-
-inline bool CopiedBlock::canBeRecycled()
-{
-    checkConsistency();
-    return !m_liveBytes;
-}
-
-inline bool CopiedBlock::shouldEvacuate()
-{
-    checkConsistency();
-    return static_cast<double>(m_liveBytes) / static_cast<double>(payloadCapacity()) <= Options::minCopiedBlockUtilization();
-}
-
-inline void CopiedBlock::pin()
-{
-    m_isPinned = true;
-    if (m_workList)
-        m_workList = nullptr;
-}
-
-inline bool CopiedBlock::isPinned()
-{
-    return m_isPinned;
-}
-
-inline bool CopiedBlock::isOld()
-{
-    return m_isOld;
-}
-
-inline void CopiedBlock::didPromote()
-{
-    m_isOld = true;
-}
-
-inline bool CopiedBlock::isOversize()
-{
-    return m_capacity != blockSize;
-}
-
-inline unsigned CopiedBlock::liveBytes()
-{
-    checkConsistency();
-    return m_liveBytes;
-}
-
-inline char* CopiedBlock::payload()
-{
-    return reinterpret_cast<char*>(this) + WTF::roundUpToMultipleOf<sizeof(double)>(sizeof(CopiedBlock));
-}
-
-inline char* CopiedBlock::payloadEnd()
-{
-    return reinterpret_cast<char*>(this) + m_capacity;
-}
-
-inline size_t CopiedBlock::payloadCapacity()
-{
-    return payloadEnd() - payload();
-}
-
-inline char* CopiedBlock::data()
-{
-    return payload();
-}
-
-inline char* CopiedBlock::dataEnd()
-{
-    return payloadEnd() - m_remaining;
-}
-
-inline size_t CopiedBlock::dataSize()
-{
-    return dataEnd() - data();
-}
-
-inline char* CopiedBlock::wilderness()
-{
-    return dataEnd();
-}
-
-inline char* CopiedBlock::wildernessEnd()
-{
-    return payloadEnd();
-}
-
-inline size_t CopiedBlock::wildernessSize()
-{
-    return wildernessEnd() - wilderness();
-}
-
-inline size_t CopiedBlock::size()
-{
-    return dataSize();
-}
-
-inline size_t CopiedBlock::capacity()
-{
-    return m_capacity;
-}
-
-inline bool CopiedBlock::hasWorkList()
-{
-    return !!m_workList;
-}
-
-inline CopyWorkList& CopiedBlock::workList()
-{
-    return *m_workList;
-}
-
-inline void CopiedBlock::checkConsistency()
-{
-    ASSERT(!!m_liveBytes == !!m_liveObjects);
-}
-
-} // namespace JSC
-
-#endif
diff --git a/Source/JavaScriptCore/heap/CopiedBlockInlines.h b/Source/JavaScriptCore/heap/CopiedBlockInlines.h
deleted file mode 100644 (file)
index c6fb762..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2012, 2013, 2015 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 CopiedBlockInlines_h
-#define CopiedBlockInlines_h
-
-#include "CopiedBlock.h"
-#include "Heap.h"
-
-namespace JSC {
-
-inline void CopiedBlock::reportLiveBytes(LockHolder&, JSCell* owner, CopyToken token, unsigned bytes)
-{
-    checkConsistency();
-#ifndef NDEBUG
-    m_liveObjects++;
-#endif
-    m_liveBytes += bytes;
-    checkConsistency();
-    ASSERT(m_liveBytes <= m_capacity);
-
-    if (isPinned())
-        return;
-
-    if (!shouldEvacuate()) {
-        pin();
-        return;
-    }
-
-    if (!m_workList)
-        m_workList = std::make_unique<CopyWorkList>();
-
-    m_workList->append(CopyWorklistItem(owner, token));
-}
-
-inline void CopiedBlock::reportLiveBytesDuringCopying(unsigned bytes)
-{
-    checkConsistency();
-    // This doesn't need to be locked because the thread that calls this function owns the current block.
-    m_isOld = true;
-#ifndef NDEBUG
-    m_liveObjects++;
-#endif
-    m_liveBytes += bytes;
-    checkConsistency();
-    ASSERT(m_liveBytes <= CopiedBlock::blockSize);
-}
-
-} // namespace JSC
-
-#endif // CopiedBlockInlines_h
diff --git a/Source/JavaScriptCore/heap/CopiedSpace.cpp b/Source/JavaScriptCore/heap/CopiedSpace.cpp
deleted file mode 100644 (file)
index 47656ed..0000000
+++ /dev/null
@@ -1,350 +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. ``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
- * 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 "CopiedSpace.h"
-
-#include "CopiedSpaceInlines.h"
-#include "GCActivityCallback.h"
-#include "JSCInlines.h"
-
-namespace JSC {
-
-CopiedSpace::CopiedSpace(Heap* heap)
-    : m_heap(heap)
-    , m_inCopyingPhase(false)
-    , m_shouldDoCopyPhase(false)
-    , m_numberOfLoanedBlocks(0)
-    , m_bytesRemovedFromOldSpaceDueToReallocation(0)
-{
-}
-
-CopiedSpace::~CopiedSpace()
-{
-    while (!m_oldGen.toSpace->isEmpty())
-        CopiedBlock::destroy(*heap(), m_oldGen.toSpace->removeHead());
-
-    while (!m_oldGen.fromSpace->isEmpty())
-        CopiedBlock::destroy(*heap(), m_oldGen.fromSpace->removeHead());
-
-    while (!m_oldGen.oversizeBlocks.isEmpty())
-        CopiedBlock::destroy(*heap(), m_oldGen.oversizeBlocks.removeHead());
-
-    while (!m_newGen.toSpace->isEmpty())
-        CopiedBlock::destroy(*heap(), m_newGen.toSpace->removeHead());
-
-    while (!m_newGen.fromSpace->isEmpty())
-        CopiedBlock::destroy(*heap(), m_newGen.fromSpace->removeHead());
-
-    while (!m_newGen.oversizeBlocks.isEmpty())
-        CopiedBlock::destroy(*heap(), m_newGen.oversizeBlocks.removeHead());
-
-    ASSERT(m_oldGen.toSpace->isEmpty());
-    ASSERT(m_oldGen.fromSpace->isEmpty());
-    ASSERT(m_oldGen.oversizeBlocks.isEmpty());
-    ASSERT(m_newGen.toSpace->isEmpty());
-    ASSERT(m_newGen.fromSpace->isEmpty());
-    ASSERT(m_newGen.oversizeBlocks.isEmpty());
-}
-
-void CopiedSpace::init()
-{
-    m_oldGen.toSpace = &m_oldGen.blocks1;
-    m_oldGen.fromSpace = &m_oldGen.blocks2;
-    
-    m_newGen.toSpace = &m_newGen.blocks1;
-    m_newGen.fromSpace = &m_newGen.blocks2;
-
-    allocateBlock();
-}   
-
-CheckedBoolean CopiedSpace::tryAllocateSlowCase(size_t bytes, void** outPtr)
-{
-    if (isOversize(bytes))
-        return tryAllocateOversize(bytes, outPtr);
-    
-    ASSERT(m_heap->vm()->currentThreadIsHoldingAPILock());
-    m_heap->didAllocate(m_allocator.currentCapacity());
-
-    allocateBlock();
-
-    *outPtr = m_allocator.forceAllocate(bytes);
-    return true;
-}
-
-CheckedBoolean CopiedSpace::tryAllocateOversize(size_t bytes, void** outPtr)
-{
-    ASSERT(isOversize(bytes));
-    
-    CopiedBlock* block = CopiedBlock::create(*m_heap, WTF::roundUpToMultipleOf<sizeof(double)>(sizeof(CopiedBlock) + bytes));
-    m_newGen.oversizeBlocks.push(block);
-    m_newGen.blockFilter.add(reinterpret_cast<Bits>(block));
-    m_blockSet.add(block);
-    ASSERT(!block->isOld());
-    
-    CopiedAllocator allocator;
-    allocator.setCurrentBlock(block);
-    *outPtr = allocator.forceAllocate(bytes);
-    allocator.resetCurrentBlock();
-
-    m_heap->didAllocate(block->capacity());
-
-    return true;
-}
-
-CheckedBoolean CopiedSpace::tryReallocate(void** ptr, size_t oldSize, size_t newSize)
-{
-    if (oldSize >= newSize)
-        return true;
-    
-    void* oldPtr = *ptr;
-    ASSERT(!m_heap->vm()->isInitializingObject());
-    
-    if (CopiedSpace::blockFor(oldPtr)->isOversize() || isOversize(newSize))
-        return tryReallocateOversize(ptr, oldSize, newSize);
-    
-    if (m_allocator.tryReallocate(oldPtr, oldSize, newSize))
-        return true;
-
-    void* result = 0;
-    if (!tryAllocate(newSize, &result)) {
-        *ptr = 0;
-        return false;
-    }
-    memcpy(result, oldPtr, oldSize);
-    *ptr = result;
-    return true;
-}
-
-CheckedBoolean CopiedSpace::tryReallocateOversize(void** ptr, size_t oldSize, size_t newSize)
-{
-    ASSERT(isOversize(oldSize) || isOversize(newSize));
-    ASSERT(newSize > oldSize);
-
-    void* oldPtr = *ptr;
-    
-    void* newPtr = 0;
-    if (!tryAllocateOversize(newSize, &newPtr)) {
-        *ptr = 0;
-        return false;
-    }
-
-    memcpy(newPtr, oldPtr, oldSize);
-
-    CopiedBlock* oldBlock = CopiedSpace::blockFor(oldPtr);
-    if (oldBlock->isOversize()) {
-        // FIXME: Eagerly deallocating the old space block probably buys more confusion than
-        // value.
-        // https://bugs.webkit.org/show_bug.cgi?id=144750
-        if (oldBlock->isOld()) {
-            m_bytesRemovedFromOldSpaceDueToReallocation += oldBlock->size();
-            m_oldGen.oversizeBlocks.remove(oldBlock);
-        } else
-            m_newGen.oversizeBlocks.remove(oldBlock);
-        m_blockSet.remove(oldBlock);
-        CopiedBlock::destroy(*heap(), oldBlock);
-    }
-    
-    *ptr = newPtr;
-    return true;
-}
-
-void CopiedSpace::doneFillingBlock(CopiedBlock* block, CopiedBlock** exchange)
-{
-    ASSERT(m_inCopyingPhase);
-    
-    if (exchange)
-        *exchange = allocateBlockForCopyingPhase();
-
-    if (!block)
-        return;
-
-    if (!block->dataSize()) {
-        recycleBorrowedBlock(block);
-        return;
-    }
-
-    block->zeroFillWilderness();
-
-    {
-        // Always put the block into the old gen because it's being promoted!
-        LockHolder locker(&m_toSpaceLock);
-        m_oldGen.toSpace->push(block);
-        m_blockSet.add(block);
-        m_oldGen.blockFilter.add(reinterpret_cast<Bits>(block));
-    }
-
-    {
-        LockHolder locker(m_loanedBlocksLock);
-        ASSERT(m_numberOfLoanedBlocks > 0);
-        ASSERT(m_inCopyingPhase);
-        m_numberOfLoanedBlocks--;
-    }
-}
-
-void CopiedSpace::didStartFullCollection()
-{
-    ASSERT(heap()->operationInProgress() == FullCollection);
-    ASSERT(m_oldGen.fromSpace->isEmpty());
-    ASSERT(m_newGen.fromSpace->isEmpty());
-
-#ifndef NDEBUG
-    for (CopiedBlock* block = m_newGen.toSpace->head(); block; block = block->next())
-        ASSERT(!block->liveBytes());
-
-    for (CopiedBlock* block = m_newGen.oversizeBlocks.head(); block; block = block->next())
-        ASSERT(!block->liveBytes());
-#endif
-
-    for (CopiedBlock* block = m_oldGen.toSpace->head(); block; block = block->next())
-        block->didSurviveGC();
-
-    for (CopiedBlock* block = m_oldGen.oversizeBlocks.head(); block; block = block->next())
-        block->didSurviveGC();
-}
-
-void CopiedSpace::doneCopying()
-{
-    RELEASE_ASSERT(!m_numberOfLoanedBlocks);
-    RELEASE_ASSERT(m_inCopyingPhase == m_shouldDoCopyPhase);
-    m_inCopyingPhase = false;
-
-    DoublyLinkedList<CopiedBlock>* toSpace;
-    DoublyLinkedList<CopiedBlock>* fromSpace;
-    TinyBloomFilter* blockFilter;
-    if (heap()->operationInProgress() == FullCollection) {
-        toSpace = m_oldGen.toSpace;
-        fromSpace = m_oldGen.fromSpace;
-        blockFilter = &m_oldGen.blockFilter;
-    } else {
-        toSpace = m_newGen.toSpace;
-        fromSpace = m_newGen.fromSpace;
-        blockFilter = &m_newGen.blockFilter;
-    }
-
-    while (!fromSpace->isEmpty()) {
-        CopiedBlock* block = fromSpace->removeHead();
-        // We don't add the block to the blockSet because it was never removed.
-        ASSERT(m_blockSet.contains(block));
-        blockFilter->add(reinterpret_cast<Bits>(block));
-        block->didSurviveGC();
-        toSpace->push(block);
-    }
-
-    if (heap()->operationInProgress() == EdenCollection) {
-        m_oldGen.toSpace->append(*m_newGen.toSpace);
-        m_oldGen.oversizeBlocks.append(m_newGen.oversizeBlocks);
-        m_oldGen.blockFilter.add(m_newGen.blockFilter);
-        m_newGen.blockFilter.reset();
-    }
-
-    ASSERT(m_newGen.toSpace->isEmpty());
-    ASSERT(m_newGen.fromSpace->isEmpty());
-    ASSERT(m_newGen.oversizeBlocks.isEmpty());
-
-    allocateBlock();
-
-    m_shouldDoCopyPhase = false;
-}
-
-size_t CopiedSpace::size()
-{
-    size_t calculatedSize = 0;
-
-    for (CopiedBlock* block = m_oldGen.toSpace->head(); block; block = block->next())
-        calculatedSize += block->size();
-
-    for (CopiedBlock* block = m_oldGen.fromSpace->head(); block; block = block->next())
-        calculatedSize += block->size();
-
-    for (CopiedBlock* block = m_oldGen.oversizeBlocks.head(); block; block = block->next())
-        calculatedSize += block->size();
-
-    for (CopiedBlock* block = m_newGen.toSpace->head(); block; block = block->next())
-        calculatedSize += block->size();
-
-    for (CopiedBlock* block = m_newGen.fromSpace->head(); block; block = block->next())
-        calculatedSize += block->size();
-
-    for (CopiedBlock* block = m_newGen.oversizeBlocks.head(); block; block = block->next())
-        calculatedSize += block->size();
-
-    return calculatedSize;
-}
-
-size_t CopiedSpace::capacity()
-{
-    size_t calculatedCapacity = 0;
-
-    for (CopiedBlock* block = m_oldGen.toSpace->head(); block; block = block->next())
-        calculatedCapacity += block->capacity();
-
-    for (CopiedBlock* block = m_oldGen.fromSpace->head(); block; block = block->next())
-        calculatedCapacity += block->capacity();
-
-    for (CopiedBlock* block = m_oldGen.oversizeBlocks.head(); block; block = block->next())
-        calculatedCapacity += block->capacity();
-
-    for (CopiedBlock* block = m_newGen.toSpace->head(); block; block = block->next())
-        calculatedCapacity += block->capacity();
-
-    for (CopiedBlock* block = m_newGen.fromSpace->head(); block; block = block->next())
-        calculatedCapacity += block->capacity();
-
-    for (CopiedBlock* block = m_newGen.oversizeBlocks.head(); block; block = block->next())
-        calculatedCapacity += block->capacity();
-
-    return calculatedCapacity;
-}
-
-static bool isBlockListPagedOut(double deadline, DoublyLinkedList<CopiedBlock>* list)
-{
-    unsigned itersSinceLastTimeCheck = 0;
-    CopiedBlock* current = list->head();
-    while (current) {
-        current = current->next();
-        ++itersSinceLastTimeCheck;
-        if (itersSinceLastTimeCheck >= Heap::s_timeCheckResolution) {
-            double currentTime = WTF::monotonicallyIncreasingTime();
-            if (currentTime > deadline)
-                return true;
-            itersSinceLastTimeCheck = 0;
-        }
-    }
-
-    return false;
-}
-
-bool CopiedSpace::isPagedOut(double deadline)
-{
-    return isBlockListPagedOut(deadline, m_oldGen.toSpace) 
-        || isBlockListPagedOut(deadline, m_oldGen.fromSpace) 
-        || isBlockListPagedOut(deadline, &m_oldGen.oversizeBlocks)
-        || isBlockListPagedOut(deadline, m_newGen.toSpace) 
-        || isBlockListPagedOut(deadline, m_newGen.fromSpace) 
-        || isBlockListPagedOut(deadline, &m_newGen.oversizeBlocks);
-}
-
-} // namespace JSC
diff --git a/Source/JavaScriptCore/heap/CopiedSpace.h b/Source/JavaScriptCore/heap/CopiedSpace.h
deleted file mode 100644 (file)
index dfb720b..0000000
+++ /dev/null
@@ -1,146 +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. ``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
- * 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 CopiedSpace_h
-#define CopiedSpace_h
-
-#include "CopiedAllocator.h"
-#include "HeapOperation.h"
-#include "TinyBloomFilter.h"
-#include <wtf/Assertions.h>
-#include <wtf/CheckedBoolean.h>
-#include <wtf/DoublyLinkedList.h>
-#include <wtf/HashSet.h>
-#include <wtf/Lock.h>
-
-namespace JSC {
-
-class Heap;
-class CopiedBlock;
-
-class CopiedSpace {
-    friend class CopyVisitor;
-    friend class Heap;
-    friend class SlotVisitor;
-    friend class JIT;
-public:
-    CopiedSpace(Heap*);
-    ~CopiedSpace();
-    void init();
-
-    CheckedBoolean tryAllocate(size_t, void**);
-    CheckedBoolean tryReallocate(void**, size_t, size_t);
-    
-    CopiedAllocator& allocator() { return m_allocator; }
-
-    void didStartFullCollection();
-
-    template <HeapOperation collectionType>
-    void startedCopying();
-    void doneCopying();
-    bool isInCopyPhase() const { return m_inCopyingPhase; }
-
-    void pin(CopiedBlock*);
-    bool isPinned(void*);
-
-    bool contains(CopiedBlock*);
-    bool contains(void*, CopiedBlock*&);
-    
-    void pinIfNecessary(void* pointer);
-
-    size_t size();
-    size_t capacity();
-
-    bool isPagedOut(double deadline);
-    bool shouldDoCopyPhase() const { return m_shouldDoCopyPhase; }
-
-    static CopiedBlock* blockFor(void*);
-
-    Heap* heap() const { return m_heap; }
-    
-    size_t takeBytesRemovedFromOldSpaceDueToReallocation()
-    {
-        size_t result = 0;
-        std::swap(m_bytesRemovedFromOldSpaceDueToReallocation, result);
-        return result;
-    }
-
-private:
-    static bool isOversize(size_t);
-
-    JS_EXPORT_PRIVATE CheckedBoolean tryAllocateSlowCase(size_t, void**);
-    CheckedBoolean tryAllocateOversize(size_t, void**);
-    CheckedBoolean tryReallocateOversize(void**, size_t, size_t);
-    
-    void allocateBlock();
-    CopiedBlock* allocateBlockForCopyingPhase();
-
-    void doneFillingBlock(CopiedBlock*, CopiedBlock**);
-    void recycleEvacuatedBlock(CopiedBlock*, HeapOperation collectionType);
-    void recycleBorrowedBlock(CopiedBlock*);
-
-    Heap* m_heap;
-
-    CopiedAllocator m_allocator;
-
-    HashSet<CopiedBlock*> m_blockSet;
-
-    Lock m_toSpaceLock;
-
-    struct CopiedGeneration {
-        CopiedGeneration()
-            : toSpace(0)
-            , fromSpace(0)
-        {
-        }
-
-        DoublyLinkedList<CopiedBlock>* toSpace;
-        DoublyLinkedList<CopiedBlock>* fromSpace;
-        
-        DoublyLinkedList<CopiedBlock> blocks1;
-        DoublyLinkedList<CopiedBlock> blocks2;
-        DoublyLinkedList<CopiedBlock> oversizeBlocks;
-
-        TinyBloomFilter blockFilter;
-    };
-
-    CopiedGeneration m_oldGen;
-    CopiedGeneration m_newGen;
-
-    bool m_inCopyingPhase;
-    bool m_shouldDoCopyPhase;
-
-    Lock m_loanedBlocksLock;
-    size_t m_numberOfLoanedBlocks;
-    
-    size_t m_bytesRemovedFromOldSpaceDueToReallocation;
-
-    static const size_t s_maxAllocationSize = CopiedBlock::blockSize / 2;
-    static const size_t s_blockMask = ~(CopiedBlock::blockSize - 1);
-};
-
-} // namespace JSC
-
-#endif
diff --git a/Source/JavaScriptCore/heap/CopiedSpaceInlines.h b/Source/JavaScriptCore/heap/CopiedSpaceInlines.h
deleted file mode 100644 (file)
index 6509b07..0000000
+++ /dev/null
@@ -1,258 +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. ``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
- * 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 CopiedSpaceInlines_h
-#define CopiedSpaceInlines_h
-
-#include "CopiedBlock.h"
-#include "CopiedSpace.h"
-#include "Heap.h"
-#include "VM.h"
-
-namespace JSC {
-
-inline bool CopiedSpace::contains(CopiedBlock* block)
-{
-    return (!m_newGen.blockFilter.ruleOut(reinterpret_cast<Bits>(block)) || !m_oldGen.blockFilter.ruleOut(reinterpret_cast<Bits>(block)))
-        && m_blockSet.contains(block);
-}
-
-inline bool CopiedSpace::contains(void* ptr, CopiedBlock*& result)
-{
-    CopiedBlock* block = blockFor(ptr);
-    if (contains(block)) {
-        result = block;
-        return true;
-    }
-    result = 0;
-    return false;
-}
-
-inline void CopiedSpace::pin(CopiedBlock* block)
-{
-    block->pin();
-}
-
-inline void CopiedSpace::pinIfNecessary(void* opaquePointer)
-{
-    // Pointers into the copied space come in the following varieties:
-    // 1)  Pointers to the start of a span of memory. This is the most
-    //     natural though not necessarily the most common.
-    // 2)  Pointers to one value-sized (8 byte) word past the end of
-    //     a span of memory. This currently occurs with semi-butterflies
-    //     and should be fixed soon, once the other half of the
-    //     butterfly lands.
-    // 3)  Pointers to the innards arising from loop induction variable
-    //     optimizations (either manual ones or automatic, by the
-    //     compiler).
-    // 4)  Pointers to the end of a span of memory in arising from
-    //     induction variable optimizations combined with the
-    //     GC-to-compiler contract laid out in the C spec: a pointer to
-    //     the end of a span of memory must be considered to be a
-    //     pointer to that memory.
-    
-    EncodedJSValue* pointer = reinterpret_cast<EncodedJSValue*>(opaquePointer);
-    CopiedBlock* block;
-
-    // Handle (1) and (3).
-    if (contains(pointer, block))
-        pin(block);
-    
-    // Handle (4). We don't have to explicitly check and pin the block under this
-    // pointer because it cannot possibly point to something that cases (1) and
-    // (3) above or case (2) below wouldn't already catch.
-    pointer--;
-    
-    // Handle (2)
-    pointer--;
-    if (contains(pointer, block))
-        pin(block);
-}
-
-inline void CopiedSpace::recycleEvacuatedBlock(CopiedBlock* block, HeapOperation collectionType)
-{
-    ASSERT(block);
-    ASSERT(block->canBeRecycled());
-    ASSERT(!block->m_isPinned);
-    {
-        LockHolder locker(&m_toSpaceLock);
-        m_blockSet.remove(block);
-        if (collectionType == EdenCollection)
-            m_newGen.fromSpace->remove(block);
-        else
-            m_oldGen.fromSpace->remove(block);
-    }
-    CopiedBlock::destroy(*heap(), block);
-}
-
-inline void CopiedSpace::recycleBorrowedBlock(CopiedBlock* block)
-{
-    CopiedBlock::destroy(*heap(), block);
-
-    {
-        LockHolder locker(m_loanedBlocksLock);
-        ASSERT(m_numberOfLoanedBlocks > 0);
-        ASSERT(m_inCopyingPhase);
-        m_numberOfLoanedBlocks--;
-    }
-}
-
-inline CopiedBlock* CopiedSpace::allocateBlockForCopyingPhase()
-{
-    ASSERT(m_inCopyingPhase);
-    CopiedBlock* block = CopiedBlock::createNoZeroFill(*m_heap);
-
-    {
-        LockHolder locker(m_loanedBlocksLock);
-        m_numberOfLoanedBlocks++;
-    }
-
-    ASSERT(!block->dataSize());
-    return block;
-}
-
-inline void CopiedSpace::allocateBlock()
-{
-    m_heap->collectIfNecessaryOrDefer();
-
-    m_allocator.resetCurrentBlock();
-    
-    CopiedBlock* block = CopiedBlock::create(*m_heap);
-        
-    m_newGen.toSpace->push(block);
-    m_newGen.blockFilter.add(reinterpret_cast<Bits>(block));
-    m_blockSet.add(block);
-    m_allocator.setCurrentBlock(block);
-}
-
-inline CheckedBoolean CopiedSpace::tryAllocate(size_t bytes, void** outPtr)
-{
-    ASSERT(!m_heap->vm()->isInitializingObject());
-    ASSERT(bytes);
-
-    if (!m_allocator.tryAllocate(bytes, outPtr))
-        return tryAllocateSlowCase(bytes, outPtr);
-    
-    ASSERT(*outPtr);
-    return true;
-}
-
-inline bool CopiedSpace::isOversize(size_t bytes)
-{
-    return bytes > s_maxAllocationSize;
-}
-
-inline bool CopiedSpace::isPinned(void* ptr)
-{
-    return blockFor(ptr)->m_isPinned;
-}
-
-inline CopiedBlock* CopiedSpace::blockFor(void* ptr)
-{
-    return reinterpret_cast<CopiedBlock*>(reinterpret_cast<size_t>(ptr) & s_blockMask);
-}
-
-template <HeapOperation collectionType>
-inline void CopiedSpace::startedCopying()
-{
-    DoublyLinkedList<CopiedBlock>* fromSpace;
-    DoublyLinkedList<CopiedBlock>* oversizeBlocks;
-    TinyBloomFilter* blockFilter;
-    if (collectionType == FullCollection) {
-        ASSERT(m_oldGen.fromSpace->isEmpty());
-        ASSERT(m_newGen.fromSpace->isEmpty());
-
-        m_oldGen.toSpace->append(*m_newGen.toSpace);
-        m_oldGen.oversizeBlocks.append(m_newGen.oversizeBlocks);
-
-        ASSERT(m_newGen.toSpace->isEmpty());
-        ASSERT(m_newGen.fromSpace->isEmpty());
-        ASSERT(m_newGen.oversizeBlocks.isEmpty());
-
-        std::swap(m_oldGen.fromSpace, m_oldGen.toSpace);
-        fromSpace = m_oldGen.fromSpace;
-        oversizeBlocks = &m_oldGen.oversizeBlocks;
-        blockFilter = &m_oldGen.blockFilter;
-    } else {
-        std::swap(m_newGen.fromSpace, m_newGen.toSpace);
-        fromSpace = m_newGen.fromSpace;
-        oversizeBlocks = &m_newGen.oversizeBlocks;
-        blockFilter = &m_newGen.blockFilter;
-    }
-
-    blockFilter->reset();
-    m_allocator.resetCurrentBlock();
-
-    CopiedBlock* next = 0;
-    size_t totalLiveBytes = 0;
-    size_t totalUsableBytes = 0;
-    for (CopiedBlock* block = fromSpace->head(); block; block = next) {
-        next = block->next();
-        if (!block->isPinned() && block->canBeRecycled()) {
-            recycleEvacuatedBlock(block, collectionType);
-            continue;
-        }
-        ASSERT(block->liveBytes() <= CopiedBlock::blockSize);
-        totalLiveBytes += block->liveBytes();
-        totalUsableBytes += block->payloadCapacity();
-        block->didPromote();
-    }
-
-    CopiedBlock* block = oversizeBlocks->head();
-    while (block) {
-        CopiedBlock* next = block->next();
-        if (block->isPinned()) {
-            blockFilter->add(reinterpret_cast<Bits>(block));
-            totalLiveBytes += block->payloadCapacity();
-            totalUsableBytes += block->payloadCapacity();
-            block->didPromote();
-        } else {
-            oversizeBlocks->remove(block);
-            m_blockSet.remove(block);
-            CopiedBlock::destroy(*heap(), block);
-        } 
-        block = next;
-    }
-
-    double markedSpaceBytes = m_heap->objectSpace().capacity();
-    double totalUtilization = static_cast<double>(totalLiveBytes + markedSpaceBytes) / static_cast<double>(totalUsableBytes + markedSpaceBytes);
-    m_shouldDoCopyPhase = m_heap->operationInProgress() == EdenCollection || totalUtilization <= Options::minHeapUtilization();
-    if (!m_shouldDoCopyPhase) {
-        if (Options::logGC())
-            dataLog("Skipped copying, ");
-        return;
-    }
-
-    if (Options::logGC())
-        dataLogF("Did copy, ");
-    ASSERT(m_shouldDoCopyPhase);
-    ASSERT(!m_numberOfLoanedBlocks);
-    ASSERT(!m_inCopyingPhase);
-    m_inCopyingPhase = true;
-}
-
-} // namespace JSC
-
-#endif // CopiedSpaceInlines_h
diff --git a/Source/JavaScriptCore/heap/CopyBarrier.h b/Source/JavaScriptCore/heap/CopyBarrier.h
deleted file mode 100644 (file)
index 42a0d8b..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2014-2016 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 CopyBarrier_h
-#define CopyBarrier_h
-
-#include "Heap.h"
-#include "VM.h"
-
-namespace JSC {
-
-class CopyBarrierBase {
-public:
-    CopyBarrierBase()
-        : m_value(nullptr)
-    {
-    }
-    
-    explicit operator bool() const { return m_value; }
-
-    void* get() const
-    {
-        return m_value;
-    }
-
-    void clear() { m_value = nullptr; }
-
-protected:
-    CopyBarrierBase(VM& vm, const JSCell* owner, void* value)
-    {
-        this->set(vm, owner, value);
-    }
-    
-    void set(VM& vm, const JSCell* owner, void* value)
-    {
-        this->m_value = value;
-        vm.heap.writeBarrier(owner);
-    }
-    
-    void setWithoutBarrier(void* value)
-    {
-        this->m_value = value;
-    }
-
-private:
-    mutable void* m_value;
-};
-
-template <typename T>
-class CopyBarrier : public CopyBarrierBase {
-public:
-    CopyBarrier()
-    {
-    }
-    
-    CopyBarrier(VM& vm, const JSCell* owner, T& value)
-        : CopyBarrierBase(vm, owner, &value)
-    {
-    }
-    
-    CopyBarrier(VM& vm, const JSCell* owner, T* value)
-        : CopyBarrierBase(vm, owner, value)
-    {
-    }
-
-    T* get() const
-    {
-        return bitwise_cast<T*>(CopyBarrierBase::get());
-    }
-
-    void set(VM& vm, const JSCell* owner, T* value)
-    {
-        CopyBarrierBase::set(vm, owner, value);
-    }
-    
-    void setWithoutBarrier(T* value)
-    {
-        CopyBarrierBase::setWithoutBarrier(value);
-    }
-};
-
-} // namespace JSC
-
-#endif // CopyBarrier_h
diff --git a/Source/JavaScriptCore/heap/CopyToken.h b/Source/JavaScriptCore/heap/CopyToken.h
deleted file mode 100644 (file)
index 0159b43..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2013, 2015-2016 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 CopyToken_h
-#define CopyToken_h
-
-namespace JSC {
-
-enum CopyToken {
-    DirectArgumentsOverridesCopyToken
-};
-
-} // namespace JSC
-
-#endif // CopyToken_h
diff --git a/Source/JavaScriptCore/heap/CopyVisitor.cpp b/Source/JavaScriptCore/heap/CopyVisitor.cpp
deleted file mode 100644 (file)
index 2e7dd14..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2012, 2015 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 "CopyVisitor.h"
-
-#include "CopiedSpaceInlines.h"
-#include "CopyVisitorInlines.h"
-
-namespace JSC {
-
-CopyVisitor::CopyVisitor(Heap& heap)
-    : m_heap(heap)
-{
-    ASSERT(!m_copiedAllocator.isValid());
-    CopiedBlock* block = nullptr;
-    m_heap.m_storageSpace.doneFillingBlock(nullptr, &block);
-    m_copiedAllocator.setCurrentBlock(block);
-}
-
-CopyVisitor::~CopyVisitor()
-{
-    if (m_copiedAllocator.isValid())
-        m_heap.m_storageSpace.doneFillingBlock(m_copiedAllocator.resetCurrentBlock(), nullptr);
-    
-    WTF::releaseFastMallocFreeMemoryForThisThread();
-}
-
-} // namespace JSC
diff --git a/Source/JavaScriptCore/heap/CopyVisitor.h b/Source/JavaScriptCore/heap/CopyVisitor.h
deleted file mode 100644 (file)
index d0c255b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2012, 2015 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 CopyVisitor_h
-#define CopyVisitor_h
-
-#include "CopiedSpace.h"
-#include <wtf/Noncopyable.h>
-
-namespace JSC {
-
-class Heap;
-
-class CopyVisitor {
-    WTF_MAKE_NONCOPYABLE(CopyVisitor);
-public:
-    CopyVisitor(Heap&);
-    ~CopyVisitor();
-
-    void copyFromShared();
-
-    // Low-level API for copying, appropriate for cases where the object's heap references
-    // are discontiguous or if the object occurs frequently enough that you need to focus on
-    // performance. Use this with care as it is easy to shoot yourself in the foot.
-    bool checkIfShouldCopy(void*);
-    void* allocateNewSpace(size_t);
-    void didCopy(void*, size_t);
-
-private:
-    void* allocateNewSpaceSlow(size_t);
-    void visitItem(CopyWorklistItem);
-
-    Heap& m_heap;
-    CopiedAllocator m_copiedAllocator;
-};
-
-} // namespace JSC
-
-#endif
diff --git a/Source/JavaScriptCore/heap/CopyVisitorInlines.h b/Source/JavaScriptCore/heap/CopyVisitorInlines.h
deleted file mode 100644 (file)
index 70cc672..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2012 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 CopyVisitorInlines_h
-#define CopyVisitorInlines_h
-
-#include "CopyVisitor.h"
-#include "Heap.h"
-
-namespace JSC {
-
-inline bool CopyVisitor::checkIfShouldCopy(void* oldPtr)
-{
-    if (!oldPtr)
-        return false;
-    CopiedBlock* block = CopiedSpace::blockFor(oldPtr);
-    if (block->isOversize() || block->isPinned())
-        return false;
-    return true;
-}
-
-inline void* CopyVisitor::allocateNewSpace(size_t bytes)
-{
-    void* result = 0; // Compilers don't realize that this will be assigned.
-    if (LIKELY(m_copiedAllocator.tryAllocateDuringCopying(bytes, &result)))
-        return result;
-    
-    result = allocateNewSpaceSlow(bytes);
-    ASSERT(result);
-    return result;
-}       
-
-inline void* CopyVisitor::allocateNewSpaceSlow(size_t bytes)
-{
-    CopiedBlock* newBlock = 0;
-    m_heap.m_storageSpace.doneFillingBlock(m_copiedAllocator.resetCurrentBlock(), &newBlock);
-    m_copiedAllocator.setCurrentBlock(newBlock);
-
-    void* result = 0;
-    CheckedBoolean didSucceed = m_copiedAllocator.tryAllocateDuringCopying(bytes, &result);
-    ASSERT(didSucceed);
-    return result;
-}
-
-inline void CopyVisitor::didCopy(void* ptr, size_t bytes)
-{
-    CopiedBlock* block = CopiedSpace::blockFor(ptr);
-    ASSERT(!block->isOversize());
-    ASSERT(!block->isPinned());
-
-    block->didEvacuateBytes(bytes);
-}
-
-} // namespace JSC
-
-#endif // CopyVisitorInlines_h
diff --git a/Source/JavaScriptCore/heap/CopyWorkList.h b/Source/JavaScriptCore/heap/CopyWorkList.h
deleted file mode 100644 (file)
index f1921ce..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright (C) 2012, 2013 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 CopyWorkList_h
-#define CopyWorkList_h
-
-#include "CopyToken.h"
-#include <wtf/DoublyLinkedList.h>
-
-namespace JSC {
-
-class JSCell;
-
-class CopyWorklistItem {
-public:
-    CopyWorklistItem()
-        : m_value(0)
-    {
-    }
-
-    CopyWorklistItem(JSCell* cell, CopyToken token)
-        : m_value(bitwise_cast<uintptr_t>(cell) | static_cast<uintptr_t>(token))
-    {
-        ASSERT(!(bitwise_cast<uintptr_t>(cell) & static_cast<uintptr_t>(mask)));
-        ASSERT(static_cast<uintptr_t>(token) <= mask);
-    }
-    
-    JSCell* cell() const { return bitwise_cast<JSCell*>(m_value & ~static_cast<uintptr_t>(mask)); }
-    CopyToken token() const { return static_cast<CopyToken>(m_value & mask); }
-    
-private:
-    static const unsigned requiredAlignment = 8;
-    static const unsigned mask = requiredAlignment - 1;
-    
-    uintptr_t m_value;
-};
-
-class CopyWorkListSegment : public DoublyLinkedListNode<CopyWorkListSegment> {
-    friend class WTF::DoublyLinkedListNode<CopyWorkListSegment>;
-public:
-    static CopyWorkListSegment* create()
-    {
-        return new (NotNull, fastMalloc(blockSize)) CopyWorkListSegment();
-    }
-    
-    static void destroy(CopyWorkListSegment* segment)
-    {
-        segment->~CopyWorkListSegment();
-        fastFree(segment);
-    }
-
-    size_t size() { return m_size; }
-    bool isFull() { return reinterpret_cast<char*>(&data()[size()]) >= endOfBlock(); }
-    CopyWorklistItem get(size_t index) { return data()[index]; }
-
-    void append(CopyWorklistItem item)
-    {
-        ASSERT(!isFull());
-        data()[m_size] = item;
-        m_size += 1;
-    }
-
-    static const size_t blockSize = 512;
-
-private:
-    CopyWorkListSegment()
-        : DoublyLinkedListNode<CopyWorkListSegment>()
-        , m_size(0)
-    {
-    }
-
-    CopyWorklistItem* data() { return reinterpret_cast<CopyWorklistItem*>(this + 1); }
-    char* endOfBlock() { return reinterpret_cast<char*>(this) + blockSize; }
-
-    CopyWorkListSegment* m_prev;
-    CopyWorkListSegment* m_next;
-    size_t m_size;
-};
-
-class CopyWorkListIterator {
-    friend class CopyWorkList;
-public:
-    CopyWorklistItem get() { return m_currentSegment->get(m_currentIndex); }
-    CopyWorklistItem operator*() { return get(); }
-    CopyWorklistItem operator->() { return get(); }
-
-    CopyWorkListIterator& operator++()
-    {
-        m_currentIndex++;
-
-        if (m_currentIndex >= m_currentSegment->size()) {
-            m_currentIndex = 0;
-            m_currentSegment = m_currentSegment->next();
-        
-            ASSERT(!m_currentSegment || m_currentSegment->size());
-        }
-
-        return *this;
-    }
-
-    bool operator==(const CopyWorkListIterator& other) const
-    {
-        return m_currentSegment == other.m_currentSegment && m_currentIndex == other.m_currentIndex;
-    }
-    
-    bool operator!=(const CopyWorkListIterator& other) const
-    {
-        return !(*this == other);
-    }
-
-    CopyWorkListIterator()
-        : m_currentSegment(0)
-        , m_currentIndex(0)
-    {
-    }
-
-private:
-    CopyWorkListIterator(CopyWorkListSegment* startSegment, size_t startIndex)
-        : m_currentSegment(startSegment)
-        , m_currentIndex(startIndex)
-    {
-    }
-    
-    CopyWorkListSegment* m_currentSegment;
-    size_t m_currentIndex;
-};
-
-class CopyWorkList {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    typedef CopyWorkListIterator iterator;
-
-    CopyWorkList();
-    ~CopyWorkList();
-
-    void append(CopyWorklistItem);
-    iterator begin();
-    iterator end();
-
-private:
-    DoublyLinkedList<CopyWorkListSegment> m_segments;
-};
-
-inline CopyWorkList::CopyWorkList()
-{
-}
-
-inline CopyWorkList::~CopyWorkList()
-{
-    while (!m_segments.isEmpty())
-        CopyWorkListSegment::destroy(m_segments.removeHead());
-}
-
-inline void CopyWorkList::append(CopyWorklistItem item)
-{
-    if (m_segments.isEmpty() || m_segments.tail()->isFull())
-        m_segments.append(CopyWorkListSegment::create());
-
-    ASSERT(!m_segments.tail()->isFull());
-
-    m_segments.tail()->append(item);
-}
-
-inline CopyWorkList::iterator CopyWorkList::begin()
-{
-    return CopyWorkListIterator(m_segments.head(), 0);
-}
-
-inline CopyWorkList::iterator CopyWorkList::end()
-{
-    return CopyWorkListIterator();
-}
-
-} // namespace JSC
-
-#endif // CopyWorkList_h
index 1e69a07..5a18b18 100644 (file)
@@ -23,9 +23,6 @@
 
 #include "CodeBlock.h"
 #include "ConservativeRoots.h"
-#include "CopiedSpace.h"
-#include "CopiedSpaceInlines.h"
-#include "CopyVisitorInlines.h"
 #include "DFGWorklist.h"
 #include "EdenGCActivityCallback.h"
 #include "FullGCActivityCallback.h"
@@ -202,10 +199,8 @@ Heap::Heap(VM* vm, HeapType heapType)
     , m_maxHeapSize(m_minBytesPerCycle)
     , m_shouldDoFullCollection(false)
     , m_totalBytesVisited(0)
-    , m_totalBytesCopied(0)
     , m_operationInProgress(NoOperation)
     , m_objectSpace(this)
-    , m_storageSpace(this)
     , m_extraMemorySize(0)
     , m_deprecatedExtraMemorySize(0)
     , m_machineThreads(this)
@@ -233,7 +228,6 @@ Heap::Heap(VM* vm, HeapType heapType)
 #endif
     , m_helperClient(&heapHelperPool())
 {
-    m_storageSpace.init();
     if (Options::verifyHeap())
         m_verifier = std::make_unique<HeapVerifier>(this, Options::numberOfGCCyclesToRecordForVerification());
 }
@@ -246,7 +240,7 @@ Heap::~Heap()
 
 bool Heap::isPagedOut(double deadline)
 {
-    return m_objectSpace.isPagedOut(deadline) || m_storageSpace.isPagedOut(deadline);
+    return m_objectSpace.isPagedOut(deadline);
 }
 
 // The VM is being destroyed and the collector will never run again.
@@ -496,58 +490,6 @@ void Heap::markRoots(double gcStartTime, void* stackOrigin, void* stackTop, Mach
     resetVisitors();
 }
 
-void Heap::copyBackingStores()
-{
-    SuperSamplerScope superSamplerScope(false);
-    if (m_operationInProgress == EdenCollection)
-        m_storageSpace.startedCopying<EdenCollection>();
-    else {
-        ASSERT(m_operationInProgress == FullCollection);
-        m_storageSpace.startedCopying<FullCollection>();
-    }
-
-    if (m_storageSpace.shouldDoCopyPhase()) {
-        if (m_operationInProgress == EdenCollection) {
-            // Reset the vector to be empty, but don't throw away the backing store.
-            m_blocksToCopy.shrink(0);
-            for (CopiedBlock* block = m_storageSpace.m_newGen.fromSpace->head(); block; block = block->next())
-                m_blocksToCopy.append(block);
-        } else {
-            ASSERT(m_operationInProgress == FullCollection);
-            WTF::copyToVector(m_storageSpace.m_blockSet, m_blocksToCopy);
-        }
-
-        ParallelVectorIterator<Vector<CopiedBlock*>> iterator(
-            m_blocksToCopy, s_blockFragmentLength);
-
-        // Note that it's safe to use the [&] capture list here, even though we're creating a task
-        // that other threads run. That's because after runFunctionInParallel() returns, the task
-        // we have created is not going to be running anymore. Hence, everything on the stack here
-        // outlives the task.
-        m_helperClient.runFunctionInParallel(
-            [&] () {
-                CopyVisitor copyVisitor(*this);
-                
-                iterator.iterate(
-                    [&] (CopiedBlock* block) {
-                        if (!block->hasWorkList())
-                            return;
-                        
-                        CopyWorkList& workList = block->workList();
-                        for (CopyWorklistItem item : workList) {
-                            item.cell()->methodTable()->copyBackingStore(
-                                item.cell(), copyVisitor, item.token());
-                        }
-                        
-                        ASSERT(!block->liveBytes());
-                        m_storageSpace.recycleEvacuatedBlock(block, m_operationInProgress);
-                    });
-            });
-    }
-    
-    m_storageSpace.doneCopying();
-}
-
 void Heap::gatherStackRoots(ConservativeRoots& roots, void* stackOrigin, void* stackTop, MachineThreads::RegisterState& calleeSavedRegisters)
 {
     m_jitStubRoutines->clearMarks();
@@ -822,20 +764,12 @@ void Heap::updateObjectCounts(double gcStartTime)
         dataLogF("\nNumber of live Objects after GC %lu, took %.6f secs\n", static_cast<unsigned long>(visitCount), WTF::monotonicallyIncreasingTime() - gcStartTime);
     }
     
-    size_t bytesRemovedFromOldSpaceDueToReallocation =
-        m_storageSpace.takeBytesRemovedFromOldSpaceDueToReallocation();
-    
-    if (m_operationInProgress == FullCollection) {
+    if (m_operationInProgress == FullCollection)
         m_totalBytesVisited = 0;
-        m_totalBytesCopied = 0;
-    } else
-        m_totalBytesCopied -= bytesRemovedFromOldSpaceDueToReallocation;
 
     m_totalBytesVisitedThisCycle = m_slotVisitor.bytesVisited() + threadBytesVisited();
-    m_totalBytesCopiedThisCycle = m_slotVisitor.bytesCopied() + threadBytesCopied();
     
     m_totalBytesVisited += m_totalBytesVisitedThisCycle;
-    m_totalBytesCopied += m_totalBytesCopiedThisCycle;
 }
 
 void Heap::resetVisitors()
@@ -861,12 +795,12 @@ size_t Heap::extraMemorySize()
 
 size_t Heap::size()
 {
-    return m_objectSpace.size() + m_storageSpace.size() + extraMemorySize();
+    return m_objectSpace.size() + extraMemorySize();
 }
 
 size_t Heap::capacity()
 {
-    return m_objectSpace.capacity() + m_storageSpace.capacity() + extraMemorySize();
+    return m_objectSpace.capacity() + extraMemorySize();
 }
 
 size_t Heap::protectedGlobalObjectCount()
@@ -1107,7 +1041,6 @@ NEVER_INLINE void Heap::collectImpl(HeapOperation collectionType, void* stackOri
     pruneStaleEntriesFromWeakGCMaps();
     sweepArrayBuffers();
     snapshotMarkedSpace();
-    copyBackingStores();
     finalizeUnconditionalFinalizers();
     removeDeadCompilerWorklistEntries();
     deleteUnmarkedCompiledCode();
@@ -1205,8 +1138,6 @@ void Heap::flushWriteBarrierBuffer()
 void Heap::stopAllocation()
 {
     m_objectSpace.stopAllocating();
-    if (m_operationInProgress == FullCollection)
-        m_storageSpace.didStartFullCollection();
 }
 
 void Heap::prepareForMarking()
@@ -1310,9 +1241,7 @@ void Heap::updateAllocationLimits()
     // run another collection. This isn't the same as either size() or capacity(), though it should
     // be somewhere between the two. The key is to match the size calculations involved calls to
     // didAllocate(), while never dangerously underestimating capacity(). In extreme cases of
-    // fragmentation, we may have size() much smaller than capacity(). Our collector sometimes
-    // temporarily allows very high fragmentation because it doesn't defragment old blocks in copied
-    // space.
+    // fragmentation, we may have size() much smaller than capacity().
     size_t currentHeapSize = 0;
 
     // For marked space, we use the total number of bytes visited. This matches the logic for
@@ -1324,23 +1253,6 @@ void Heap::updateAllocationLimits()
     if (verbose)
         dataLog("totalBytesVisited = ", m_totalBytesVisited, ", currentHeapSize = ", currentHeapSize, "\n");
 
-    // For copied space, we use the capacity of storage space. This is because copied space may get
-    // badly fragmented between full collections. This arises when each eden collection evacuates
-    // much less than one CopiedBlock's worth of stuff. It can also happen when CopiedBlocks get
-    // pinned due to very short-lived objects. In such a case, we want to get to a full collection
-    // sooner rather than later. If we used m_totalBytesCopied, then for for each CopiedBlock that an
-    // eden allocation promoted, we would only deduct the one object's size from eden size. This
-    // would mean that we could "leak" many CopiedBlocks before we did a full collection and
-    // defragmented all of them. It would be great to use m_totalBytesCopied, but we'd need to
-    // augment it with something that accounts for those fragmented blocks.
-    // FIXME: Make it possible to compute heap size using m_totalBytesCopied rather than
-    // m_storageSpace.capacity()
-    // https://bugs.webkit.org/show_bug.cgi?id=150268
-    ASSERT(m_totalBytesCopied <= m_storageSpace.size());
-    currentHeapSize += m_storageSpace.capacity();
-    if (verbose)
-        dataLog("storageSpace.capacity() = ", m_storageSpace.capacity(), ", currentHeapSize = ", currentHeapSize, "\n");
-
     // It's up to the user to ensure that extraMemorySize() ends up corresponding to allocation-time
     // extra memory reporting.
     currentHeapSize += extraMemorySize();
@@ -1646,14 +1558,6 @@ size_t Heap::threadBytesVisited()
     return result;
 }
 
-size_t Heap::threadBytesCopied()
-{       
-    size_t result = 0;
-    for (auto& parallelVisitor : m_parallelSlotVisitors)
-        result += parallelVisitor->bytesCopied();
-    return result;
-}
-
 void Heap::forEachCodeBlockImpl(const ScopedLambda<bool(CodeBlock*)>& func)
 {
     // We don't know the full set of CodeBlocks until compilation has terminated.
index 3e5d794..378ba13 100644 (file)
@@ -23,7 +23,6 @@
 #define Heap_h
 
 #include "ArrayBuffer.h"
-#include "CopyVisitor.h"
 #include "GCIncomingRefCountedSet.h"
 #include "HandleSet.h"
 #include "HandleStack.h"
@@ -52,7 +51,6 @@ namespace JSC {
 
 class CodeBlock;
 class CodeBlockSet;
-class CopiedSpace;
 class EdenGCActivityCallback;
 class ExecutableBase;
 class FullGCActivityCallback;
@@ -120,7 +118,6 @@ public:
 
     VM* vm() const { return m_vm; }
     MarkedSpace& objectSpace() { return m_objectSpace; }
-    CopiedSpace& storageSpace() { return m_storageSpace; }
     MachineThreads& machineThreads() { return m_machineThreads; }
 
     const SlotVisitor& slotVisitor() const { return m_slotVisitor; }
@@ -150,12 +147,9 @@ public:
     MarkedAllocator* allocatorForObjectWithDestructor(size_t bytes) { return m_objectSpace.destructorAllocatorFor(bytes); }
     template<typename ClassType> MarkedAllocator* allocatorForObjectOfType(size_t bytes);
     MarkedAllocator* allocatorForAuxiliaryData(size_t bytes) { return m_objectSpace.auxiliaryAllocatorFor(bytes); }
-    CopiedAllocator& storageAllocator() { return m_storageSpace.allocator(); }
     void* allocateAuxiliary(JSCell* intendedOwner, size_t);
     void* tryAllocateAuxiliary(JSCell* intendedOwner, size_t);
     void* tryReallocateAuxiliary(JSCell* intendedOwner, void* oldBase, size_t oldSize, size_t newSize);
-    CheckedBoolean tryAllocateStorage(JSCell* intendedOwner, size_t, void**);
-    CheckedBoolean tryReallocateStorage(JSCell* intendedOwner, void**, size_t, size_t);
     void ascribeOwner(JSCell* intendedOwner, void*);
 
     typedef void (*Finalizer)(JSCell*);
@@ -263,7 +257,6 @@ public:
 
 private:
     friend class CodeBlock;
-    friend class CopiedBlock;
     friend class DeferGC;
     friend class DeferGCForAWhile;
     friend class GCAwareJITStubRoutine;
@@ -277,8 +270,6 @@ private:
     friend class MarkedSpace;
     friend class MarkedAllocator;
     friend class MarkedBlock;
-    friend class CopiedSpace;
-    friend class CopyVisitor;
     friend class SlotVisitor;
     friend class IncrementalSweeper;
     friend class HeapStatistics;
@@ -343,7 +334,6 @@ private:
     void notifyIncrementalSweeper();
     void writeBarrierCurrentlyExecutingCodeBlocks();
     void resetAllocators();
-    void copyBackingStores();
     void harvestWeakReferences();
     void finalizeUnconditionalFinalizers();
     void clearUnmarkedExecutables();
@@ -368,7 +358,6 @@ private:
 
     size_t threadVisitCount();
     size_t threadBytesVisited();
-    size_t threadBytesCopied();
     
     void forEachCodeBlockImpl(const ScopedLambda<bool(CodeBlock*)>&);
 
@@ -388,13 +377,10 @@ private:
     bool m_shouldDoFullCollection;
     size_t m_totalBytesVisited;
     size_t m_totalBytesVisitedThisCycle;
-    size_t m_totalBytesCopied;
-    size_t m_totalBytesCopiedThisCycle;
     
     HeapOperation m_operationInProgress;
     StructureIDTable m_structureIDTable;
     MarkedSpace m_objectSpace;
-    CopiedSpace m_storageSpace;
     GCIncomingRefCountedSet<ArrayBuffer> m_arrayBuffers;
     size_t m_extraMemorySize;
     size_t m_deprecatedExtraMemorySize;
@@ -464,7 +450,6 @@ private:
     Lock m_opaqueRootsMutex;
     HashSet<void*> m_opaqueRoots;
 
-    Vector<CopiedBlock*> m_blocksToCopy;
     static const size_t s_blockFragmentLength = 32;
 
     ListableHandler<WeakReferenceHarvester>::List m_weakReferenceHarvesters;
index dd36d12..c2d909f 100644 (file)
@@ -29,6 +29,7 @@
 #include "HeapCell.h"
 #include "LargeAllocation.h"
 #include "MarkedBlock.h"
+#include "VM.h"
 
 namespace JSC {
 
index 5e9e7d7..f278887 100644 (file)
@@ -26,7 +26,6 @@
 #ifndef HeapInlines_h
 #define HeapInlines_h
 
-#include "CopyBarrier.h"
 #include "Heap.h"
 #include "HeapCellInlines.h"
 #include "IndexingHeader.h"
@@ -294,31 +293,6 @@ inline void* Heap::tryReallocateAuxiliary(JSCell* intendedOwner, void* oldBase,
     return newBase;
 }
 
-inline CheckedBoolean Heap::tryAllocateStorage(JSCell* intendedOwner, size_t bytes, void** outPtr)
-{
-    CheckedBoolean result = m_storageSpace.tryAllocate(bytes, outPtr);
-#if ENABLE(ALLOCATION_LOGGING)
-    dataLogF("JSC GC allocating %lu bytes of storage for %p: %p.\n", bytes, intendedOwner, *outPtr);
-#else
-    UNUSED_PARAM(intendedOwner);
-#endif
-    return result;
-}
-
-inline CheckedBoolean Heap::tryReallocateStorage(JSCell* intendedOwner, void** ptr, size_t oldSize, size_t newSize)
-{
-#if ENABLE(ALLOCATION_LOGGING)
-    void* oldPtr = *ptr;
-#endif
-    CheckedBoolean result = m_storageSpace.tryReallocate(ptr, oldSize, newSize);
-#if ENABLE(ALLOCATION_LOGGING)
-    dataLogF("JSC GC reallocating %lu -> %lu bytes of storage for %p: %p -> %p.\n", oldSize, newSize, intendedOwner, oldPtr, *ptr);
-#else
-    UNUSED_PARAM(intendedOwner);
-#endif
-    return result;
-}
-
 inline void Heap::ascribeOwner(JSCell* intendedOwner, void* storage)
 {
 #if ENABLE(ALLOCATION_LOGGING)
index 451e77c..7b9d19a 100644 (file)
@@ -27,7 +27,6 @@
 #include "HeapVerifier.h"
 
 #include "ButterflyInlines.h"
-#include "CopiedSpaceInlines.h"
 #include "HeapIterationScope.h"
 #include "JSCInlines.h"
 #include "JSObject.h"
@@ -77,27 +76,6 @@ const char* HeapVerifier::phaseName(HeapVerifier::Phase phase)
     return nullptr; // Silencing a compiler warning.
 }
 
-static void getButterflyDetails(JSObject* obj, void*& butterflyBase, size_t& butterflyCapacityInBytes, CopiedBlock*& butterflyBlock)
-{
-    Structure* structure = obj->structure();
-    Butterfly* butterfly = obj->butterfly();
-    butterflyBase = butterfly->base(structure);
-    butterflyBlock = CopiedSpace::blockFor(butterflyBase);
-
-    size_t propertyCapacity = structure->outOfLineCapacity();
-    size_t preCapacity;
-    size_t indexingPayloadSizeInBytes;
-    bool hasIndexingHeader = obj->hasIndexingHeader();
-    if (UNLIKELY(hasIndexingHeader)) {
-        preCapacity = butterfly->indexingHeader()->preCapacity(structure);
-        indexingPayloadSizeInBytes = butterfly->indexingHeader()->indexingPayloadSizeInBytes(structure);
-    } else {
-        preCapacity = 0;
-        indexingPayloadSizeInBytes = 0;
-    }
-    butterflyCapacityInBytes = Butterfly::totalSize(preCapacity, propertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes);
-}
-
 void HeapVerifier::initializeGCCycle()
 {
     Heap* heap = m_heap;
@@ -197,42 +175,10 @@ void HeapVerifier::trimDeadObjects()
     }
 }
 
-bool HeapVerifier::verifyButterflyIsInStorageSpace(Phase phase, LiveObjectList& list)
+bool HeapVerifier::verifyButterflyIsInStorageSpace(Phase, LiveObjectList&)
 {
-    auto& liveObjects = list.liveObjects;
-
-    CopiedSpace& storageSpace = m_heap->m_storageSpace;
-    bool listNamePrinted = false;
-    bool success = true;
-    for (size_t i = 0; i < liveObjects.size(); i++) {
-        LiveObjectData& objectData = liveObjects[i];
-        if (objectData.isConfirmedDead)
-            continue;
-
-        JSObject* obj = objectData.obj;
-        Butterfly* butterfly = obj->butterfly();
-        if (butterfly) {
-            void* butterflyBase;
-            size_t butterflyCapacityInBytes;
-            CopiedBlock* butterflyBlock;
-            getButterflyDetails(obj, butterflyBase, butterflyCapacityInBytes, butterflyBlock);
-
-            if (!storageSpace.contains(butterflyBlock)) {
-                if (!listNamePrinted) {
-                    dataLogF("Verification @ phase %s FAILED in object list '%s' (size %zu)\n",
-                        phaseName(phase), list.name, liveObjects.size());
-                    listNamePrinted = true;
-                }
-
-                Structure* structure = obj->structure();
-                const char* structureClassName = structure->classInfo()->className;
-                dataLogF("    butterfly %p (base %p size %zu block %p) NOT in StorageSpace | obj %p type '%s'\n",
-                    butterfly, butterflyBase, butterflyCapacityInBytes, butterflyBlock, obj, structureClassName);
-                success = false;
-            }
-        }
-    }
-    return success;
+    // FIXME: Make this work again. https://bugs.webkit.org/show_bug.cgi?id=161752
+    return true;
 }
 
 void HeapVerifier::verify(HeapVerifier::Phase phase)
@@ -254,14 +200,11 @@ void HeapVerifier::reportObject(LiveObjectData& objData, int cycleIndex, HeapVer
 
     Structure* structure = obj->structure();
     Butterfly* butterfly = obj->butterfly();
-    void* butterflyBase;
-    size_t butterflyCapacityInBytes;
-    CopiedBlock* butterflyBlock;
-    getButterflyDetails(obj, butterflyBase, butterflyCapacityInBytes, butterflyBlock);
+    void* butterflyBase = butterfly->base(structure);
 
-    dataLogF("FOUND obj %p type '%s' butterfly %p (base %p size %zu block %p) in GC[%d] %s list '%s'\n",
+    dataLogF("FOUND obj %p type '%s' butterfly %p (base %p) in GC[%d] %s list '%s'\n",
         obj, structure->classInfo()->className,
-        butterfly, butterflyBase, butterflyCapacityInBytes, butterflyBlock,
+        butterfly, butterflyBase,
         cycleIndex, cycle.collectionTypeName(), list.name);
 }
 
index 1d4015f..1ddc290 100644 (file)
@@ -28,9 +28,6 @@
 #include "SlotVisitorInlines.h"
 
 #include "ConservativeRoots.h"
-#include "CopiedBlockInlines.h"
-#include "CopiedSpace.h"
-#include "CopiedSpaceInlines.h"
 #include "HeapCellInlines.h"
 #include "HeapProfiler.h"
 #include "HeapSnapshotBuilder.h"
@@ -492,36 +489,6 @@ void SlotVisitor::donateAndDrain()
     drain();
 }
 
-void SlotVisitor::copyLater(JSCell* owner, CopyToken token, void* ptr, size_t bytes)
-{
-    ASSERT(bytes);
-    CopiedBlock* block = CopiedSpace::blockFor(ptr);
-    if (block->isOversize()) {
-        ASSERT(bytes <= block->size());
-        // FIXME: We should be able to shrink the allocation if bytes went below the block size.
-        // For now, we just make sure that our accounting of how much memory we are actually using
-        // is correct.
-        // https://bugs.webkit.org/show_bug.cgi?id=144749
-        bytes = block->size();
-        m_heap.m_storageSpace.pin(block);
-    }
-
-    ASSERT(heap()->m_storageSpace.contains(block));
-
-    LockHolder locker(&block->workListLock());
-    // We always report live bytes, except if during an eden collection we see an old object pointing to an
-    // old backing store and the old object is being marked because of the remembered set. Note that if we
-    // ask the object itself, it will always tell us that it's an old black object - because even during an
-    // eden collection we have already indicated that the object is old. That's why we use the
-    // SlotVisitor's cache of the object's old state.
-    if (heap()->operationInProgress() == FullCollection
-        || !block->isOld()
-        || m_currentObjectCellStateBeforeVisiting != CellState::OldGrey) {
-        m_bytesCopied += bytes;
-        block->reportLiveBytes(locker, owner, token, bytes);
-    }
-}
-    
 void SlotVisitor::mergeOpaqueRoots()
 {
     ASSERT(!m_opaqueRoots.isEmpty()); // Should only be called when opaque roots are non-empty.
index b391b1b..205a214 100644 (file)
@@ -27,7 +27,6 @@
 #define SlotVisitor_h
 
 #include "CellState.h"
-#include "CopyToken.h"
 #include "HandleTypes.h"
 #include "MarkStack.h"
 #include "OpaqueRootSet.h"
@@ -113,8 +112,6 @@ public:
     // this then the space will be freed at end of GC.
     void markAuxiliary(const void* base);
 
-    void copyLater(JSCell*, CopyToken, void*, size_t);
-    
     void reportExtraMemoryVisited(size_t);
 #if ENABLE(RESOURCE_USAGE)
     void reportExternalMemoryVisited(size_t);
index 3822fcc..18312ef 100644 (file)
@@ -29,7 +29,6 @@
 #if ENABLE(JIT)
 
 #include "CodeBlock.h"
-#include "CopyBarrier.h"
 #include "FPRInfo.h"
 #include "GPRInfo.h"
 #include "Heap.h"
index fb33e45..2971ddc 100644 (file)
@@ -29,7 +29,6 @@
 #include "JIT.h"
 
 #include "BasicBlockLocation.h"
-#include "CopiedSpaceInlines.h"
 #include "Exception.h"
 #include "Heap.h"
 #include "Interpreter.h"
index fa1bcb5..f2d604d 100644 (file)
@@ -27,7 +27,6 @@
 #include "ButterflyInlines.h"
 #include "CodeBlock.h"
 #include "Completion.h"
-#include "CopiedSpaceInlines.h"
 #include "Disassembler.h"
 #include "Exception.h"
 #include "ExceptionHelpers.h"
index f74793b..e7aef53 100644 (file)
@@ -26,7 +26,6 @@
 
 #include "ArrayPrototype.h"
 #include "ButterflyInlines.h"
-#include "CopiedSpaceInlines.h"
 #include "Error.h"
 #include "ExceptionHelpers.h"
 #include "GetterSetter.h"
index 3ae9a84..2a98e5e 100644 (file)
@@ -29,7 +29,6 @@
 #include "BuiltinNames.h"
 #include "ButterflyInlines.h"
 #include "CodeBlock.h"
-#include "CopiedSpaceInlines.h"
 #include "Error.h"
 #include "GetterSetter.h"
 #include "Interpreter.h"
index 89c82da..498a145 100644 (file)
@@ -37,6 +37,7 @@ class VM;
 template<typename T>
 class AuxiliaryBarrier {
 public:
+    // This doesn't initialize m_value because I worry about performance on PLT, or something.
     AuxiliaryBarrier() { }
     
     template<typename U>
index 94e17a1..9aaee0b 100644 (file)
@@ -114,7 +114,6 @@ public:
 
     static Butterfly* create(VM&, JSCell* intendedOwner, size_t preCapacity, size_t propertyCapacity, bool hasIndexingHeader, const IndexingHeader&, size_t indexingPayloadSizeInBytes);
     static Butterfly* create(VM&, JSCell* intendedOwner, Structure*);
-    static Butterfly* createUninitializedDuringCollection(CopyVisitor&, size_t preCapacity, size_t propertyCapacity, bool hasIndexingHeader, size_t indexingPayloadSizeInBytes);
     
     IndexingHeader* indexingHeader() { return IndexingHeader::from(this); }
     const IndexingHeader* indexingHeader() const { return IndexingHeader::from(this); }
index b34ad0e..7aa62bf 100644 (file)
@@ -28,8 +28,6 @@
 
 #include "ArrayStorage.h"
 #include "Butterfly.h"
-#include "CopiedSpaceInlines.h"
-#include "CopyVisitor.h"
 #include "VM.h"
 #include "Structure.h"
 
@@ -87,15 +85,6 @@ inline Butterfly* Butterfly::create(VM& vm, JSCell* intendedOwner, Structure* st
         structure->hasIndexingHeader(intendedOwner), IndexingHeader(), 0);
 }
 
-inline Butterfly* Butterfly::createUninitializedDuringCollection(CopyVisitor& visitor, size_t preCapacity, size_t propertyCapacity, bool hasIndexingHeader, size_t indexingPayloadSizeInBytes)
-{
-    size_t size = totalSize(preCapacity, propertyCapacity, hasIndexingHeader, indexingPayloadSizeInBytes);
-    Butterfly* result = fromBase(
-        visitor.allocateNewSpace(size),
-        preCapacity, propertyCapacity);
-    return result;
-}
-
 inline void* Butterfly::base(Structure* structure)
 {
     return base(indexingHeader()->preCapacity(structure), structure->outOfLineCapacity());
index a1b95c0..0cc5f5a 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "CallFrame.h"
 #include "ConstructData.h"
-#include "CopyToken.h"
 #include "JSCell.h"
 
 namespace JSC {
@@ -41,9 +40,6 @@ struct MethodTable {
     typedef void (*VisitChildrenFunctionPtr)(JSCell*, SlotVisitor&);
     VisitChildrenFunctionPtr visitChildren;
 
-    typedef void (*CopyBackingStoreFunctionPtr)(JSCell*, CopyVisitor&, CopyToken);
-    CopyBackingStoreFunctionPtr copyBackingStore;
-
     typedef CallType (*GetCallDataFunctionPtr)(JSCell*, CallData&);
     GetCallDataFunctionPtr getCallData;
 
@@ -151,7 +147,6 @@ struct MethodTable {
 #define CREATE_METHOD_TABLE(ClassName) { \
         &ClassName::destroy, \
         &ClassName::visitChildren, \
-        &ClassName::copyBackingStore, \
         &ClassName::getCallData, \
         &ClassName::getConstructData, \
         &ClassName::put, \
index 01bab9e..e5b3fb5 100644 (file)
@@ -27,8 +27,6 @@
 #include "DirectArguments.h"
 
 #include "CodeBlock.h"
-#include "CopiedBlockInlines.h"
-#include "CopyVisitorInlines.h"
 #include "GenericArgumentsInlines.h"
 #include "JSCInlines.h"
 
@@ -43,6 +41,8 @@ DirectArguments::DirectArguments(VM& vm, Structure* structure, unsigned length,
     , m_length(length)
     , m_minCapacity(capacity)
 {
+    m_overrides.clear();
+    
     // When we construct the object from C++ code, we expect the capacity to be at least as large as
     // length. JIT-allocated DirectArguments objects play evil tricks, though.
     ASSERT(capacity >= length);
@@ -101,27 +101,8 @@ void DirectArguments::visitChildren(JSCell* thisCell, SlotVisitor& visitor)
     visitor.appendValues(thisObject->storage(), std::max(thisObject->m_length, thisObject->m_minCapacity));
     visitor.append(&thisObject->m_callee);
     
-    if (thisObject->m_overrides) {
-        visitor.copyLater(
-            thisObject, DirectArgumentsOverridesCopyToken,
-            thisObject->m_overrides.get(), thisObject->overridesSize());
-    }
-}
-
-void DirectArguments::copyBackingStore(JSCell* thisCell, CopyVisitor& visitor, CopyToken token)
-{
-    DirectArguments* thisObject = static_cast<DirectArguments*>(thisCell);
-    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    
-    RELEASE_ASSERT(token == DirectArgumentsOverridesCopyToken);
-    
-    void* oldOverrides = thisObject->m_overrides.get();
-    if (visitor.checkIfShouldCopy(oldOverrides)) {
-        bool* newOverrides = static_cast<bool*>(visitor.allocateNewSpace(thisObject->overridesSize()));
-        memcpy(newOverrides, oldOverrides, thisObject->m_length);
-        thisObject->m_overrides.setWithoutBarrier(newOverrides);
-        visitor.didCopy(oldOverrides, thisObject->overridesSize());
-    }
+    if (thisObject->m_overrides)
+        visitor.markAuxiliary(thisObject->m_overrides.get());
 }
 
 Structure* DirectArguments::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
@@ -137,8 +118,8 @@ void DirectArguments::overrideThings(VM& vm)
     putDirect(vm, vm.propertyNames->callee, m_callee.get(), DontEnum);
     putDirect(vm, vm.propertyNames->iteratorSymbol, globalObject()->arrayProtoValuesFunction(), DontEnum);
     
-    void* backingStore;
-    RELEASE_ASSERT(vm.heap.tryAllocateStorage(this, overridesSize(), &backingStore));
+    void* backingStore = vm.heap.tryAllocateAuxiliary(this, overridesSize());
+    RELEASE_ASSERT(backingStore);
     bool* overrides = static_cast<bool*>(backingStore);
     m_overrides.set(vm, this, overrides);
     for (unsigned i = m_length; i--;)
index 33bb0a3..e58e814 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef DirectArguments_h
 #define DirectArguments_h
 
-#include "CopyBarrier.h"
+#include "AuxiliaryBarrier.h"
 #include "DirectArgumentsOffset.h"
 #include "GenericArguments.h"
 
@@ -59,7 +59,6 @@ public:
 
     static size_t estimatedSize(JSCell*);
     static void visitChildren(JSCell*, SlotVisitor&);
-    static void copyBackingStore(JSCell*, CopyVisitor&, CopyToken);
     
     uint32_t internalLength() const
     {
@@ -150,7 +149,7 @@ private:
     WriteBarrier<JSFunction> m_callee;
     uint32_t m_length; // Always the actual length of captured arguments and never what was stored into the length property.
     uint32_t m_minCapacity; // The max of this and length determines the capacity of this object. It may be the actual capacity, or maybe something smaller. We arrange it this way to be kind to the JITs.
-    CopyBarrier<bool> m_overrides; // If non-null, it means that length, callee, and caller are fully materialized properties.
+    AuxiliaryBarrier<bool*> m_overrides; // If non-null, it means that length, callee, and caller are fully materialized properties.
 };
 
 } // namespace JSC
index fa3449b..f21a891 100644 (file)
@@ -26,7 +26,6 @@
 #include "ArrayPrototype.h"
 #include "ButterflyInlines.h"
 #include "CodeBlock.h"
-#include "CopiedSpace.h"
 #include "Error.h"
 #include "Executable.h"
 #include "GetterSetter.h"
index 73719d3..c8095e3 100644 (file)
@@ -61,10 +61,6 @@ size_t JSCell::estimatedSize(JSCell* cell)
     return cell->cellSize();
 }
 
-void JSCell::copyBackingStore(JSCell*, CopyVisitor&, CopyToken)
-{
-}
-
 void JSCell::heapSnapshot(JSCell*, HeapSnapshotBuilder&)
 {
 }
index 2fd7117..17ea136 100644 (file)
@@ -138,7 +138,6 @@ public:
     JS_EXPORT_PRIVATE static size_t estimatedSize(JSCell*);
 
     static void visitChildren(JSCell*, SlotVisitor&);
-    JS_EXPORT_PRIVATE static void copyBackingStore(JSCell*, CopyVisitor&, CopyToken);
 
     JS_EXPORT_PRIVATE static void heapSnapshot(JSCell*, HeapSnapshotBuilder&);
 
index b198e03..95a366e 100644 (file)
@@ -30,7 +30,6 @@
 #define JSLexicalEnvironment_h
 
 #include "CodeBlock.h"
-#include "CopiedSpaceInlines.h"
 #include "JSEnvironmentRecord.h"
 #include "SymbolTable.h"
 
index 03dc4e3..caf83b3 100644 (file)
 #include "JSObject.h"
 
 #include "ButterflyInlines.h"
-#include "CopiedBlockInlines.h"
-#include "CopiedSpaceInlines.h"
-#include "CopyVisitor.h"
-#include "CopyVisitorInlines.h"
 #include "CustomGetterSetter.h"
 #include "DatePrototype.h"
 #include "ErrorConstructor.h"
index 3a469ad..2064a6e 100644 (file)
@@ -26,8 +26,6 @@
 #include "config.h"
 #include "JSTypedArrays.h"
 
-#include "CopiedBlockInlines.h"
-#include "CopyVisitorInlines.h"
 #include "GenericTypedArrayViewInlines.h"
 #include "JSGenericTypedArrayViewInlines.h"
 #include "JSCInlines.h"
index b33cab9..4da3d07 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "ButterflyInlines.h"
 #include "CodeBlock.h"
-#include "CopiedSpaceInlines.h"
 #include "JSArray.h"
 #include "JSString.h"
 #include "Lexer.h"
index a7ba751..20c43b3 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "BuiltinNames.h"
 #include "ButterflyInlines.h"
-#include "CopiedSpaceInlines.h"
 #include "Error.h"
 #include "ExceptionHelpers.h"
 #include "JSArray.h"
index 5cc70fe..c48f4a4 100644 (file)
@@ -22,7 +22,6 @@
 #include "RegExpObject.h"
 
 #include "ButterflyInlines.h"
-#include "CopiedSpaceInlines.h"
 #include "Error.h"
 #include "ExceptionHelpers.h"
 #include "JSArray.h"
index c4d8af6..ff077c2 100644 (file)
@@ -26,7 +26,6 @@
 #include "BuiltinNames.h"
 #include "ButterflyInlines.h"
 #include "CachedCall.h"
-#include "CopiedSpaceInlines.h"
 #include "Error.h"
 #include "Executable.h"
 #include "IntlObject.h"
index a6842c9..902fa6d 100644 (file)
@@ -26,8 +26,6 @@
 #include "config.h"
 #include "WeakMapData.h"
 
-#include "CopiedAllocator.h"
-#include "CopyVisitorInlines.h"
 #include "ExceptionHelpers.h"
 #include "JSCInlines.h"
 
index 21dc42e..e961c61 100644 (file)
@@ -155,10 +155,11 @@ bool JSDollarVMPrototype::isInObjectSpace(Heap* heap, void* ptr)
     return false;
 }
 
-bool JSDollarVMPrototype::isInStorageSpace(Heap* heap, void* ptr)
+bool JSDollarVMPrototype::isInStorageSpace(Heap*, void*)
 {
-    CopiedBlock* candidate = CopiedSpace::blockFor(ptr);
-    return heap->storageSpace().contains(candidate);
+    // FIXME: Do something with this.
+    // https://bugs.webkit.org/show_bug.cgi?id=161753
+    return false;
 }
 
 struct CellAddressCheckFunctor : MarkedBlock::CountFunctor {