Changeset 252843 in webkit
- Timestamp:
- Nov 24, 2019 2:39:11 PM (4 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 deleted
- 9 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r252557 r252843 100 100 wasm/js/WebAssemblyCompileErrorConstructor.cpp 101 101 wasm/js/WebAssemblyCompileErrorPrototype.cpp 102 wasm/js/WebAssemblyFunctionHeapCellType.cpp103 102 wasm/js/WebAssemblyInstanceConstructor.cpp 104 103 wasm/js/WebAssemblyInstancePrototype.cpp … … 615 614 heap/IncrementalSweeper.h 616 615 heap/IsoCellSet.h 616 heap/IsoHeapCellType.h 617 617 heap/IsoSubspace.h 618 618 heap/IsoSubspaceInlines.h -
trunk/Source/JavaScriptCore/ChangeLog
r252836 r252843 1 2019-11-24 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Introduce IsoHeapCellType 4 https://bugs.webkit.org/show_bug.cgi?id=204555 5 6 Reviewed by Mark Lam. 7 8 We introduce IsoHeapCellType<CellType>, which destroys cell based on CellType information, which should be in IsoSubspace. 9 By using this, we can avoid inheriting JSDestructibleObject. For each IsoSubspace, we know how to destroy cells if we use 10 IsoHeapCellType<CellType> without using methodTable. We start using it for, JSString, JSWeakMap, JSWeakSet, WebAssemblyFunction, 11 and JSWebAssemblyCodeBlock. And we use JSNonFinalObject for the base of JSWeakMap and JSWeakSet, which shrinks size of them 12 from 48 to 32. 13 14 * CMakeLists.txt: 15 * JavaScriptCore.xcodeproj/project.pbxproj: 16 * Sources.txt: 17 * heap/IsoHeapCellType.h: Renamed from Source/JavaScriptCore/wasm/js/WebAssemblyFunctionHeapCellType.h. 18 * runtime/JSString.cpp: 19 (JSC::JSString::destroy): Deleted. 20 * runtime/JSString.h: 21 (JSC::JSString::destroy): 22 * runtime/JSStringHeapCellType.cpp: Removed. 23 * runtime/JSStringHeapCellType.h: Removed. 24 * runtime/VM.cpp: 25 (JSC::VM::VM): 26 * runtime/VM.h: 27 * runtime/WeakMapImpl.h: 28 * wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp: Removed. 29 * wasm/js/JSWebAssemblyCodeBlockHeapCellType.h: Removed. 30 * wasm/js/WebAssemblyFunctionHeapCellType.cpp: Removed. 31 1 32 2019-11-23 Ross Kirsling <ross.kirsling@sony.com> 2 33 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r252825 r252843 455 455 0F7DF1381E2970E40095951B /* SubspaceInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7DF1331E2970D50095951B /* SubspaceInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 456 456 0F7DF13C1E2971130095951B /* JSDestructibleObjectHeapCellType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7DF13A1E29710E0095951B /* JSDestructibleObjectHeapCellType.h */; settings = {ATTRIBUTES = (Private, ); }; }; 457 0F7DF13F1E2AFC4D0095951B /* JSStringHeapCellType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7DF13E1E2AFC4B0095951B /* JSStringHeapCellType.h */; settings = {ATTRIBUTES = (Private, ); }; };458 457 0F7DF1461E2BEF6A0095951B /* BlockDirectoryInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7DF1451E2BEF680095951B /* BlockDirectoryInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 459 458 0F7F988C1D9596C800F4F12E /* DFGStoreBarrierClusteringPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7F988A1D9596C300F4F12E /* DFGStoreBarrierClusteringPhase.h */; }; … … 895 894 521322461ECBCE8200F65615 /* WebAssemblyFunctionBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 521322441ECBCE8200F65615 /* WebAssemblyFunctionBase.h */; }; 896 895 522927D5235FD0B9005CB169 /* GCMemoryOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 5272987B235FC8BA005C982C /* GCMemoryOperations.h */; settings = {ATTRIBUTES = (Private, ); }; }; 897 523FD88E225566C9003B3DCC /* WebAssemblyFunctionHeapCellType.h in Headers */ = {isa = PBXBuildFile; fileRef = 523FD88C225566C3003B3DCC /* WebAssemblyFunctionHeapCellType.h */; };898 896 524E9D7322092B5200A6BEEE /* AirAllocateRegistersAndStackAndGenerateCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 524E9D7222092B4600A6BEEE /* AirAllocateRegistersAndStackAndGenerateCode.h */; }; 899 897 5250D2D21E8DA05A0029A932 /* WasmThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 5250D2D01E8DA05A0029A932 /* WasmThunks.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1218 1216 79DFCBDB1D88C59600527D03 /* HasOwnPropertyCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 79DFCBDA1D88C59600527D03 /* HasOwnPropertyCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1219 1217 79EE0C001B4AFB85000385C9 /* VariableEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = 79EE0BFE1B4AFB85000385C9 /* VariableEnvironment.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1220 79EFD4841EBC045C00F3DFEA /* JSWebAssemblyCodeBlockHeapCellType.h in Headers */ = {isa = PBXBuildFile; fileRef = 79EFD4821EBC045C00F3DFEA /* JSWebAssemblyCodeBlockHeapCellType.h */; settings = {ATTRIBUTES = (Private, ); }; };1221 1218 79FC8A081E32E9F000D88F0E /* DFGRegisteredStructure.h in Headers */ = {isa = PBXBuildFile; fileRef = 79FC8A071E32E9F000D88F0E /* DFGRegisteredStructure.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1222 1219 7A9774A8206B82E4008D03D0 /* JSWeakValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A9774A7206B82C9008D03D0 /* JSWeakValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1837 1834 E3AC277721FDB4940024452C /* RegExpCachedResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F75EFC151C062F007C9BA3 /* RegExpCachedResult.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1838 1835 E3BD2B7622F275020011765C /* WasmCompilationMode.h in Headers */ = {isa = PBXBuildFile; fileRef = E3BD2B7522F275020011765C /* WasmCompilationMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1836 E3BF1BAE238AAEDB003A1C2B /* IsoHeapCellType.h in Headers */ = {isa = PBXBuildFile; fileRef = E3BF1BAD238AAED1003A1C2B /* IsoHeapCellType.h */; }; 1839 1837 E3BFA5D021E853A1009C0EBA /* DFGDesiredGlobalProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = E3BFA5CD21E853A1009C0EBA /* DFGDesiredGlobalProperty.h */; }; 1840 1838 E3BFD0BC1DAF808E0065DEA2 /* AccessCaseSnippetParams.h in Headers */ = {isa = PBXBuildFile; fileRef = E3BFD0BA1DAF807C0065DEA2 /* AccessCaseSnippetParams.h */; }; … … 2738 2736 0F7DF1391E29710E0095951B /* JSDestructibleObjectHeapCellType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDestructibleObjectHeapCellType.cpp; sourceTree = "<group>"; }; 2739 2737 0F7DF13A1E29710E0095951B /* JSDestructibleObjectHeapCellType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDestructibleObjectHeapCellType.h; sourceTree = "<group>"; }; 2740 0F7DF13D1E2AFC4B0095951B /* JSStringHeapCellType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStringHeapCellType.cpp; sourceTree = "<group>"; };2741 0F7DF13E1E2AFC4B0095951B /* JSStringHeapCellType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStringHeapCellType.h; sourceTree = "<group>"; };2742 2738 0F7DF1451E2BEF680095951B /* BlockDirectoryInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockDirectoryInlines.h; sourceTree = "<group>"; }; 2743 2739 0F7F98891D9596C300F4F12E /* DFGStoreBarrierClusteringPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGStoreBarrierClusteringPhase.cpp; path = dfg/DFGStoreBarrierClusteringPhase.cpp; sourceTree = "<group>"; }; … … 3542 3538 521322441ECBCE8200F65615 /* WebAssemblyFunctionBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyFunctionBase.h; path = js/WebAssemblyFunctionBase.h; sourceTree = "<group>"; }; 3543 3539 52335628225EB8E900268BD2 /* CPU.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CPU.cpp; sourceTree = "<group>"; }; 3544 523FD88C225566C3003B3DCC /* WebAssemblyFunctionHeapCellType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WebAssemblyFunctionHeapCellType.h; path = js/WebAssemblyFunctionHeapCellType.h; sourceTree = "<group>"; };3545 523FD88D225566C4003B3DCC /* WebAssemblyFunctionHeapCellType.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyFunctionHeapCellType.cpp; path = js/WebAssemblyFunctionHeapCellType.cpp; sourceTree = "<group>"; };3546 3540 524E9D7122092B4500A6BEEE /* AirAllocateRegistersAndStackAndGenerateCode.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = AirAllocateRegistersAndStackAndGenerateCode.cpp; path = b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp; sourceTree = "<group>"; }; 3547 3541 524E9D7222092B4600A6BEEE /* AirAllocateRegistersAndStackAndGenerateCode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AirAllocateRegistersAndStackAndGenerateCode.h; path = b3/air/AirAllocateRegistersAndStackAndGenerateCode.h; sourceTree = "<group>"; }; … … 4022 4016 79EE0BFD1B4AFB85000385C9 /* VariableEnvironment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VariableEnvironment.cpp; sourceTree = "<group>"; }; 4023 4017 79EE0BFE1B4AFB85000385C9 /* VariableEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VariableEnvironment.h; sourceTree = "<group>"; }; 4024 79EFD4811EBC045C00F3DFEA /* JSWebAssemblyCodeBlockHeapCellType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSWebAssemblyCodeBlockHeapCellType.cpp; path = js/JSWebAssemblyCodeBlockHeapCellType.cpp; sourceTree = "<group>"; };4025 79EFD4821EBC045C00F3DFEA /* JSWebAssemblyCodeBlockHeapCellType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWebAssemblyCodeBlockHeapCellType.h; path = js/JSWebAssemblyCodeBlockHeapCellType.h; sourceTree = "<group>"; };4026 4018 79FC8A071E32E9F000D88F0E /* DFGRegisteredStructure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGRegisteredStructure.h; path = dfg/DFGRegisteredStructure.h; sourceTree = "<group>"; }; 4027 4019 7A9774A6206B828C008D03D0 /* JSWeakValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWeakValue.cpp; sourceTree = "<group>"; }; … … 4981 4973 E3A421421D6F588F0007C617 /* PreciseJumpTargetsInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreciseJumpTargetsInlines.h; sourceTree = "<group>"; }; 4982 4974 E3BD2B7522F275020011765C /* WasmCompilationMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmCompilationMode.h; sourceTree = "<group>"; }; 4975 E3BF1BAD238AAED1003A1C2B /* IsoHeapCellType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IsoHeapCellType.h; sourceTree = "<group>"; }; 4983 4976 E3BFA5CB21E853A0009C0EBA /* DFGDesiredGlobalProperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredGlobalProperties.cpp; path = dfg/DFGDesiredGlobalProperties.cpp; sourceTree = "<group>"; }; 4984 4977 E3BFA5CC21E853A0009C0EBA /* DFGDesiredGlobalProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDesiredGlobalProperties.h; path = dfg/DFGDesiredGlobalProperties.h; sourceTree = "<group>"; }; … … 6200 6193 0FB4677D1FDDA6D9003FCB09 /* IsoCellSet.h */, 6201 6194 0FB4677B1FDDA6D8003FCB09 /* IsoCellSetInlines.h */, 6195 E3BF1BAD238AAED1003A1C2B /* IsoHeapCellType.h */, 6202 6196 0FDCE12C1FAFB4DE006F3901 /* IsoSubspace.cpp */, 6203 6197 0FDCE12B1FAFB4DE006F3901 /* IsoSubspace.h */, … … 7326 7320 BC02E9B60E1842FA000F9297 /* JSString.cpp */, 7327 7321 F692A8620255597D01FF60F7 /* JSString.h */, 7328 0F7DF13D1E2AFC4B0095951B /* JSStringHeapCellType.cpp */,7329 0F7DF13E1E2AFC4B0095951B /* JSStringHeapCellType.h */,7330 7322 FEFD6FC51D5E7970008F2F0B /* JSStringInlines.h */, 7331 7323 70EC0EBC1AA0D7DA00B6AAFA /* JSStringIterator.cpp */, … … 8214 8206 14AD91071DCA92940014F9FE /* FunctionCodeBlock.h */, 8215 8207 1498CAD5214BF36D00710879 /* GetByIdMetadata.h */, 8208 0F0332C118B01763005F979A /* GetByIdVariant.cpp */, 8209 0F0332C218B01763005F979A /* GetByIdVariant.h */, 8216 8210 0F93329514CA7DC10085F3C6 /* GetByStatus.cpp */, 8217 8211 0F93329614CA7DC10085F3C6 /* GetByStatus.h */, 8218 0F0332C118B01763005F979A /* GetByIdVariant.cpp */,8219 0F0332C218B01763005F979A /* GetByIdVariant.h */,8220 8212 520D99F02388CC78000509A3 /* GetByValHistory.h */, 8221 8213 14AD91081DCA92940014F9FE /* GlobalCodeBlock.h */, … … 8600 8592 5383AA2F1E65E8A100A532FC /* JSWebAssemblyCodeBlock.cpp */, 8601 8593 AD9E852E1E8A0C6E008DE39E /* JSWebAssemblyCodeBlock.h */, 8602 79EFD4811EBC045C00F3DFEA /* JSWebAssemblyCodeBlockHeapCellType.cpp */,8603 79EFD4821EBC045C00F3DFEA /* JSWebAssemblyCodeBlockHeapCellType.h */,8604 8594 AD2FCBA61DB58DA400B3E736 /* JSWebAssemblyCompileError.cpp */, 8605 8595 AD2FCBA71DB58DA400B3E736 /* JSWebAssemblyCompileError.h */, … … 8627 8617 521322431ECBCE8200F65615 /* WebAssemblyFunctionBase.cpp */, 8628 8618 521322441ECBCE8200F65615 /* WebAssemblyFunctionBase.h */, 8629 523FD88D225566C4003B3DCC /* WebAssemblyFunctionHeapCellType.cpp */,8630 523FD88C225566C3003B3DCC /* WebAssemblyFunctionHeapCellType.h */,8631 8619 AD2FCBB41DB58DA400B3E736 /* WebAssemblyInstanceConstructor.cpp */, 8632 8620 AD2FCBB51DB58DA400B3E736 /* WebAssemblyInstanceConstructor.h */, … … 9057 9045 14F09C2A2231923100CF88EB /* CachedTypes.h in Headers */, 9058 9046 1409ECC1225E178C00BEDD54 /* CachePayload.h in Headers */, 9059 520D99F12388CC81000509A3 /* GetByValHistory.h in Headers */,9060 9047 1409ECC0225E178100BEDD54 /* CacheUpdate.h in Headers */, 9061 9048 0FEC3C601F379F5300F59B6C /* CagedBarrierPtr.h in Headers */, … … 9498 9485 0F2B66E117B6B5AB00A7AE3F /* GenericTypedArrayViewInlines.h in Headers */, 9499 9486 1498CAD6214BF36D00710879 /* GetByIdMetadata.h in Headers */, 9487 0F0332C418B01763005F979A /* GetByIdVariant.h in Headers */, 9500 9488 0F9332A014CA7DCD0085F3C6 /* GetByStatus.h in Headers */, 9501 0F0332C418B01763005F979A /* GetByIdVariant.h in Headers */,9489 520D99F12388CC81000509A3 /* GetByValHistory.h in Headers */, 9502 9490 7964656A1B952FF0003059EE /* GetPutInfo.h in Headers */, 9503 9491 534E03581E53BF2F00213F64 /* GetterSetterAccessCase.h in Headers */, … … 9614 9602 0FB467801FDDA6F1003FCB09 /* IsoCellSet.h in Headers */, 9615 9603 0FB467811FDDA6F7003FCB09 /* IsoCellSetInlines.h in Headers */, 9604 E3BF1BAE238AAEDB003A1C2B /* IsoHeapCellType.h in Headers */, 9616 9605 0FDCE12D1FAFB4E5006F3901 /* IsoSubspace.h in Headers */, 9617 9606 0FD2FD9520B52BE200F09441 /* IsoSubspaceInlines.h in Headers */, … … 9790 9779 BDFCB2BBE90F41349E1B0BED /* JSSourceCode.h in Headers */, 9791 9780 BC18C4270E16F5CD00B34460 /* JSString.h in Headers */, 9792 0F7DF13F1E2AFC4D0095951B /* JSStringHeapCellType.h in Headers */,9793 9781 FEFD6FC61D5E7992008F2F0B /* JSStringInlines.h in Headers */, 9794 9782 70EC0EC31AA0D7DA00B6AAFA /* JSStringIterator.h in Headers */, … … 9829 9817 AD5C36EB1F75AD73000BCAAF /* JSWebAssembly.h in Headers */, 9830 9818 AD9E852F1E8A0C7C008DE39E /* JSWebAssemblyCodeBlock.h in Headers */, 9831 79EFD4841EBC045C00F3DFEA /* JSWebAssemblyCodeBlockHeapCellType.h in Headers */,9832 9819 AD2FCBE31DB58DAD00B3E736 /* JSWebAssemblyCompileError.h in Headers */, 9833 9820 796FB43A1DFF8C3F0039C95D /* JSWebAssemblyHelpers.h in Headers */, … … 10296 10283 AD4937D41DDD27DE0077C807 /* WebAssemblyFunction.h in Headers */, 10297 10284 521322461ECBCE8200F65615 /* WebAssemblyFunctionBase.h in Headers */, 10298 523FD88E225566C9003B3DCC /* WebAssemblyFunctionHeapCellType.h in Headers */,10299 10285 AD2FCBF11DB58DAD00B3E736 /* WebAssemblyInstanceConstructor.h in Headers */, 10300 10286 AD2FCC181DB59CB200B3E736 /* WebAssemblyInstanceConstructor.lut.h in Headers */, -
trunk/Source/JavaScriptCore/Sources.txt
r252684 r252843 864 864 runtime/JSStringIterator.cpp 865 865 runtime/JSStringJoiner.cpp 866 runtime/JSStringHeapCellType.cpp867 866 runtime/JSSymbolTableObject.cpp 868 867 runtime/JSTemplateObjectDescriptor.cpp … … 1043 1042 wasm/js/JSWebAssembly.cpp 1044 1043 wasm/js/JSWebAssemblyCodeBlock.cpp 1045 wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp1046 1044 wasm/js/JSWebAssemblyCompileError.cpp 1047 1045 wasm/js/JSWebAssemblyInstance.cpp … … 1057 1055 wasm/js/WebAssemblyFunction.cpp 1058 1056 wasm/js/WebAssemblyFunctionBase.cpp 1059 wasm/js/WebAssemblyFunctionHeapCellType.cpp1060 1057 wasm/js/WebAssemblyInstanceConstructor.cpp 1061 1058 wasm/js/WebAssemblyInstancePrototype.cpp -
trunk/Source/JavaScriptCore/heap/IsoHeapCellType.h
r252842 r252843 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 26 #pragma once27 28 #if ENABLE(WEBASSEMBLY)29 30 26 #include "HeapCellType.h" 27 #include "MarkedBlockInlines.h" 31 28 32 29 namespace JSC { 33 30 34 class WebAssemblyFunctionHeapCellType : public HeapCellType { 31 template<typename CellType> 32 class IsoHeapCellType final : public HeapCellType { 35 33 public: 36 WebAssemblyFunctionHeapCellType(); 37 virtual ~WebAssemblyFunctionHeapCellType(); 38 39 void finishSweep(MarkedBlock::Handle&, FreeList*) override; 40 void destroy(VM&, JSCell*) override; 34 IsoHeapCellType() 35 : HeapCellType(CellAttributes(CellType::needsDestruction ? NeedsDestruction : DoesNotNeedDestruction, HeapCell::JSCell)) 36 { 37 } 38 39 struct DestroyFunc { 40 ALWAYS_INLINE void operator()(VM&, JSCell* cell) const 41 { 42 CellType::destroy(cell); 43 } 44 }; 45 46 void finishSweep(MarkedBlock::Handle& handle, FreeList* freeList) override 47 { 48 handle.finishSweepKnowingHeapCellType(freeList, DestroyFunc()); 49 } 50 51 void destroy(VM&, JSCell* cell) override 52 { 53 CellType::destroy(cell); 54 } 41 55 }; 42 56 43 57 } // namespace JSC 44 58 45 #endif // ENABLE(WEBASSEMBLY) -
trunk/Source/JavaScriptCore/runtime/JSString.cpp
r251425 r252843 65 65 } 66 66 67 void JSString::destroy(JSCell* cell)68 {69 static_cast<JSString*>(cell)->JSString::~JSString();70 }71 72 67 void JSString::dumpToStream(const JSCell* cell, PrintStream& out) 73 68 { -
trunk/Source/JavaScriptCore/runtime/JSString.h
r252390 r252843 93 93 94 94 static constexpr bool needsDestruction = true; 95 static void destroy(JSCell*); 95 static ALWAYS_INLINE void destroy(JSCell* cell) 96 { 97 static_cast<JSString*>(cell)->JSString::~JSString(); 98 } 96 99 97 100 // We specialize the string subspace to get the fastest possible sweep. This wouldn't be -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r252680 r252843 70 70 #include "IntlNumberFormatConstructor.h" 71 71 #include "IntlPluralRulesConstructor.h" 72 #include "IsoHeapCellType.h" 72 73 #include "JITCode.h" 73 74 #include "JITWorklist.h" … … 97 98 #include "JSSetIterator.h" 98 99 #include "JSSourceCode.h" 99 #include "JSStringHeapCellType.h"100 100 #include "JSTemplateObjectDescriptor.h" 101 101 #include "JSWeakMap.h" … … 104 104 #include "JSWebAssembly.h" 105 105 #include "JSWebAssemblyCodeBlock.h" 106 #include "JSWebAssemblyCodeBlockHeapCellType.h"107 106 #include "JSWebAssemblyMemory.h" 108 107 #include "JSWithScope.h" … … 152 151 #include "WeakGCMapInlines.h" 153 152 #include "WebAssemblyFunction.h" 154 #include "WebAssemblyFunctionHeapCellType.h"155 153 #include "WebAssemblyWrapperFunction.h" 156 154 #include <wtf/ProcessID.h> … … 264 262 , cellHeapCellType(makeUnique<HeapCellType>(CellAttributes(DoesNotNeedDestruction, HeapCell::JSCell))) 265 263 , destructibleCellHeapCellType(makeUnique<HeapCellType>(CellAttributes(NeedsDestruction, HeapCell::JSCell))) 266 , stringHeapCellType(makeUnique<JSStringHeapCellType>()) 264 , stringHeapCellType(makeUnique<IsoHeapCellType<JSString>>()) 265 , weakMapHeapCellType(makeUnique<IsoHeapCellType<JSWeakMap>>()) 266 , weakSetHeapCellType(makeUnique<IsoHeapCellType<JSWeakSet>>()) 267 267 , destructibleObjectHeapCellType(makeUnique<JSDestructibleObjectHeapCellType>()) 268 268 #if ENABLE(WEBASSEMBLY) 269 , webAssemblyCodeBlockHeapCellType(makeUnique< JSWebAssemblyCodeBlockHeapCellType>())270 , webAssemblyFunctionHeapCellType(makeUnique< WebAssemblyFunctionHeapCellType>())269 , webAssemblyCodeBlockHeapCellType(makeUnique<IsoHeapCellType<JSWebAssemblyCodeBlock>>()) 270 , webAssemblyFunctionHeapCellType(makeUnique<IsoHeapCellType<WebAssemblyFunction>>()) 271 271 #endif 272 272 , primitiveGigacageAuxiliarySpace("Primitive Gigacage Auxiliary", heap, auxiliaryHeapCellType.get(), primitiveGigacageAllocator.get()) // Hash:0x3e7cd762 … … 1308 1308 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(unlinkedModuleProgramCodeBlockSpace, destructibleCellHeapCellType.get(), UnlinkedModuleProgramCodeBlock) 1309 1309 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(unlinkedProgramCodeBlockSpace, destructibleCellHeapCellType.get(), UnlinkedProgramCodeBlock) 1310 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakMapSpace, destructibleObjectHeapCellType.get(), JSWeakMap) // Hash:0x662b12a31311 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakSetSpace, destructibleObjectHeapCellType.get(), JSWeakSet) // Hash:0x4c781b301310 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakMapSpace, weakMapHeapCellType.get(), JSWeakMap) // Hash:0x662b12a3 1311 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakSetSpace, weakSetHeapCellType.get(), JSWeakSet) // Hash:0x4c781b30 1312 1312 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakObjectRefSpace, cellHeapCellType.get(), JSWeakObjectRef) // Hash:0x8ec68f1f 1313 1313 #if JSC_OBJC_API_ENABLED -
trunk/Source/JavaScriptCore/runtime/VM.h
r252680 r252843 128 128 class JSPropertyNameEnumerator; 129 129 class JSRunLoopTimer; 130 class JSStringHeapCellType; 131 class JSWebAssemblyCodeBlockHeapCellType; 130 class JSWeakMap; 131 class JSWeakSet; 132 class JSWebAssemblyCodeBlock; 132 133 class JSWebAssemblyInstance; 133 134 class LLIntOffsetsExtractor; … … 163 164 class Watchpoint; 164 165 class WatchpointSet; 165 class WebAssemblyFunctionHeapCellType; 166 class WebAssemblyFunction; 167 168 template<typename CellType> class IsoHeapCellType; 166 169 167 170 #if ENABLE(FTL_JIT) … … 340 343 std::unique_ptr<HeapCellType> cellHeapCellType; 341 344 std::unique_ptr<HeapCellType> destructibleCellHeapCellType; 342 std::unique_ptr<JSStringHeapCellType> stringHeapCellType; 345 std::unique_ptr<IsoHeapCellType<JSString>> stringHeapCellType; 346 std::unique_ptr<IsoHeapCellType<JSWeakMap>> weakMapHeapCellType; 347 std::unique_ptr<IsoHeapCellType<JSWeakSet>> weakSetHeapCellType; 343 348 std::unique_ptr<JSDestructibleObjectHeapCellType> destructibleObjectHeapCellType; 344 349 #if ENABLE(WEBASSEMBLY) 345 std::unique_ptr< JSWebAssemblyCodeBlockHeapCellType> webAssemblyCodeBlockHeapCellType;346 std::unique_ptr< WebAssemblyFunctionHeapCellType> webAssemblyFunctionHeapCellType;350 std::unique_ptr<IsoHeapCellType<JSWebAssemblyCodeBlock>> webAssemblyCodeBlockHeapCellType; 351 std::unique_ptr<IsoHeapCellType<WebAssemblyFunction>> webAssemblyFunctionHeapCellType; 347 352 #endif 348 353 -
trunk/Source/JavaScriptCore/runtime/WeakMapImpl.h
r240965 r252843 193 193 194 194 template <typename WeakMapBucketType> 195 class WeakMapImpl : public JS DestructibleObject {196 using Base = JS DestructibleObject;195 class WeakMapImpl : public JSNonFinalObject { 196 using Base = JSNonFinalObject; 197 197 using WeakMapBufferType = WeakMapBuffer<WeakMapBucketType>; 198 198 … … 200 200 using BucketType = WeakMapBucketType; 201 201 202 static constexpr bool needsDestruction = true; 202 203 static void destroy(JSCell*); 203 204
Note: See TracChangeset
for help on using the changeset viewer.