Changeset 252843 in webkit


Ignore:
Timestamp:
Nov 24, 2019 2:39:11 PM (4 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Introduce IsoHeapCellType
https://bugs.webkit.org/show_bug.cgi?id=204555

Reviewed by Mark Lam.

We introduce IsoHeapCellType<CellType>, which destroys cell based on CellType information, which should be in IsoSubspace.
By using this, we can avoid inheriting JSDestructibleObject. For each IsoSubspace, we know how to destroy cells if we use
IsoHeapCellType<CellType> without using methodTable. We start using it for, JSString, JSWeakMap, JSWeakSet, WebAssemblyFunction,
and JSWebAssemblyCodeBlock. And we use JSNonFinalObject for the base of JSWeakMap and JSWeakSet, which shrinks size of them
from 48 to 32.

  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Sources.txt:
  • heap/IsoHeapCellType.h: Renamed from Source/JavaScriptCore/wasm/js/WebAssemblyFunctionHeapCellType.h.
  • runtime/JSString.cpp:

(JSC::JSString::destroy): Deleted.

  • runtime/JSString.h:

(JSC::JSString::destroy):

  • runtime/JSStringHeapCellType.cpp: Removed.
  • runtime/JSStringHeapCellType.h: Removed.
  • runtime/VM.cpp:

(JSC::VM::VM):

  • runtime/VM.h:
  • runtime/WeakMapImpl.h:
  • wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp: Removed.
  • wasm/js/JSWebAssemblyCodeBlockHeapCellType.h: Removed.
  • wasm/js/WebAssemblyFunctionHeapCellType.cpp: Removed.
Location:
trunk/Source/JavaScriptCore
Files:
5 deleted
9 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r252557 r252843  
    100100    wasm/js/WebAssemblyCompileErrorConstructor.cpp
    101101    wasm/js/WebAssemblyCompileErrorPrototype.cpp
    102     wasm/js/WebAssemblyFunctionHeapCellType.cpp
    103102    wasm/js/WebAssemblyInstanceConstructor.cpp
    104103    wasm/js/WebAssemblyInstancePrototype.cpp
     
    615614    heap/IncrementalSweeper.h
    616615    heap/IsoCellSet.h
     616    heap/IsoHeapCellType.h
    617617    heap/IsoSubspace.h
    618618    heap/IsoSubspaceInlines.h
  • trunk/Source/JavaScriptCore/ChangeLog

    r252836 r252843  
     12019-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
    1322019-11-23  Ross Kirsling  <ross.kirsling@sony.com>
    233
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r252825 r252843  
    455455                0F7DF1381E2970E40095951B /* SubspaceInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7DF1331E2970D50095951B /* SubspaceInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
    456456                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, ); }; };
    458457                0F7DF1461E2BEF6A0095951B /* BlockDirectoryInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7DF1451E2BEF680095951B /* BlockDirectoryInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
    459458                0F7F988C1D9596C800F4F12E /* DFGStoreBarrierClusteringPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F7F988A1D9596C300F4F12E /* DFGStoreBarrierClusteringPhase.h */; };
     
    895894                521322461ECBCE8200F65615 /* WebAssemblyFunctionBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 521322441ECBCE8200F65615 /* WebAssemblyFunctionBase.h */; };
    896895                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 */; };
    898896                524E9D7322092B5200A6BEEE /* AirAllocateRegistersAndStackAndGenerateCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 524E9D7222092B4600A6BEEE /* AirAllocateRegistersAndStackAndGenerateCode.h */; };
    899897                5250D2D21E8DA05A0029A932 /* WasmThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 5250D2D01E8DA05A0029A932 /* WasmThunks.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    12181216                79DFCBDB1D88C59600527D03 /* HasOwnPropertyCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 79DFCBDA1D88C59600527D03 /* HasOwnPropertyCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
    12191217                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, ); }; };
    12211218                79FC8A081E32E9F000D88F0E /* DFGRegisteredStructure.h in Headers */ = {isa = PBXBuildFile; fileRef = 79FC8A071E32E9F000D88F0E /* DFGRegisteredStructure.h */; settings = {ATTRIBUTES = (Private, ); }; };
    12221219                7A9774A8206B82E4008D03D0 /* JSWeakValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A9774A7206B82C9008D03D0 /* JSWeakValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    18371834                E3AC277721FDB4940024452C /* RegExpCachedResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F75EFC151C062F007C9BA3 /* RegExpCachedResult.h */; settings = {ATTRIBUTES = (Private, ); }; };
    18381835                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 */; };
    18391837                E3BFA5D021E853A1009C0EBA /* DFGDesiredGlobalProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = E3BFA5CD21E853A1009C0EBA /* DFGDesiredGlobalProperty.h */; };
    18401838                E3BFD0BC1DAF808E0065DEA2 /* AccessCaseSnippetParams.h in Headers */ = {isa = PBXBuildFile; fileRef = E3BFD0BA1DAF807C0065DEA2 /* AccessCaseSnippetParams.h */; };
     
    27382736                0F7DF1391E29710E0095951B /* JSDestructibleObjectHeapCellType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDestructibleObjectHeapCellType.cpp; sourceTree = "<group>"; };
    27392737                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>"; };
    27422738                0F7DF1451E2BEF680095951B /* BlockDirectoryInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockDirectoryInlines.h; sourceTree = "<group>"; };
    27432739                0F7F98891D9596C300F4F12E /* DFGStoreBarrierClusteringPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGStoreBarrierClusteringPhase.cpp; path = dfg/DFGStoreBarrierClusteringPhase.cpp; sourceTree = "<group>"; };
     
    35423538                521322441ECBCE8200F65615 /* WebAssemblyFunctionBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebAssemblyFunctionBase.h; path = js/WebAssemblyFunctionBase.h; sourceTree = "<group>"; };
    35433539                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>"; };
    35463540                524E9D7122092B4500A6BEEE /* AirAllocateRegistersAndStackAndGenerateCode.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = AirAllocateRegistersAndStackAndGenerateCode.cpp; path = b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp; sourceTree = "<group>"; };
    35473541                524E9D7222092B4600A6BEEE /* AirAllocateRegistersAndStackAndGenerateCode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AirAllocateRegistersAndStackAndGenerateCode.h; path = b3/air/AirAllocateRegistersAndStackAndGenerateCode.h; sourceTree = "<group>"; };
     
    40224016                79EE0BFD1B4AFB85000385C9 /* VariableEnvironment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VariableEnvironment.cpp; sourceTree = "<group>"; };
    40234017                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>"; };
    40264018                79FC8A071E32E9F000D88F0E /* DFGRegisteredStructure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGRegisteredStructure.h; path = dfg/DFGRegisteredStructure.h; sourceTree = "<group>"; };
    40274019                7A9774A6206B828C008D03D0 /* JSWeakValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWeakValue.cpp; sourceTree = "<group>"; };
     
    49814973                E3A421421D6F588F0007C617 /* PreciseJumpTargetsInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreciseJumpTargetsInlines.h; sourceTree = "<group>"; };
    49824974                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>"; };
    49834976                E3BFA5CB21E853A0009C0EBA /* DFGDesiredGlobalProperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredGlobalProperties.cpp; path = dfg/DFGDesiredGlobalProperties.cpp; sourceTree = "<group>"; };
    49844977                E3BFA5CC21E853A0009C0EBA /* DFGDesiredGlobalProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDesiredGlobalProperties.h; path = dfg/DFGDesiredGlobalProperties.h; sourceTree = "<group>"; };
     
    62006193                                0FB4677D1FDDA6D9003FCB09 /* IsoCellSet.h */,
    62016194                                0FB4677B1FDDA6D8003FCB09 /* IsoCellSetInlines.h */,
     6195                                E3BF1BAD238AAED1003A1C2B /* IsoHeapCellType.h */,
    62026196                                0FDCE12C1FAFB4DE006F3901 /* IsoSubspace.cpp */,
    62036197                                0FDCE12B1FAFB4DE006F3901 /* IsoSubspace.h */,
     
    73267320                                BC02E9B60E1842FA000F9297 /* JSString.cpp */,
    73277321                                F692A8620255597D01FF60F7 /* JSString.h */,
    7328                                 0F7DF13D1E2AFC4B0095951B /* JSStringHeapCellType.cpp */,
    7329                                 0F7DF13E1E2AFC4B0095951B /* JSStringHeapCellType.h */,
    73307322                                FEFD6FC51D5E7970008F2F0B /* JSStringInlines.h */,
    73317323                                70EC0EBC1AA0D7DA00B6AAFA /* JSStringIterator.cpp */,
     
    82148206                                14AD91071DCA92940014F9FE /* FunctionCodeBlock.h */,
    82158207                                1498CAD5214BF36D00710879 /* GetByIdMetadata.h */,
     8208                                0F0332C118B01763005F979A /* GetByIdVariant.cpp */,
     8209                                0F0332C218B01763005F979A /* GetByIdVariant.h */,
    82168210                                0F93329514CA7DC10085F3C6 /* GetByStatus.cpp */,
    82178211                                0F93329614CA7DC10085F3C6 /* GetByStatus.h */,
    8218                                 0F0332C118B01763005F979A /* GetByIdVariant.cpp */,
    8219                                 0F0332C218B01763005F979A /* GetByIdVariant.h */,
    82208212                                520D99F02388CC78000509A3 /* GetByValHistory.h */,
    82218213                                14AD91081DCA92940014F9FE /* GlobalCodeBlock.h */,
     
    86008592                                5383AA2F1E65E8A100A532FC /* JSWebAssemblyCodeBlock.cpp */,
    86018593                                AD9E852E1E8A0C6E008DE39E /* JSWebAssemblyCodeBlock.h */,
    8602                                 79EFD4811EBC045C00F3DFEA /* JSWebAssemblyCodeBlockHeapCellType.cpp */,
    8603                                 79EFD4821EBC045C00F3DFEA /* JSWebAssemblyCodeBlockHeapCellType.h */,
    86048594                                AD2FCBA61DB58DA400B3E736 /* JSWebAssemblyCompileError.cpp */,
    86058595                                AD2FCBA71DB58DA400B3E736 /* JSWebAssemblyCompileError.h */,
     
    86278617                                521322431ECBCE8200F65615 /* WebAssemblyFunctionBase.cpp */,
    86288618                                521322441ECBCE8200F65615 /* WebAssemblyFunctionBase.h */,
    8629                                 523FD88D225566C4003B3DCC /* WebAssemblyFunctionHeapCellType.cpp */,
    8630                                 523FD88C225566C3003B3DCC /* WebAssemblyFunctionHeapCellType.h */,
    86318619                                AD2FCBB41DB58DA400B3E736 /* WebAssemblyInstanceConstructor.cpp */,
    86328620                                AD2FCBB51DB58DA400B3E736 /* WebAssemblyInstanceConstructor.h */,
     
    90579045                                14F09C2A2231923100CF88EB /* CachedTypes.h in Headers */,
    90589046                                1409ECC1225E178C00BEDD54 /* CachePayload.h in Headers */,
    9059                                 520D99F12388CC81000509A3 /* GetByValHistory.h in Headers */,
    90609047                                1409ECC0225E178100BEDD54 /* CacheUpdate.h in Headers */,
    90619048                                0FEC3C601F379F5300F59B6C /* CagedBarrierPtr.h in Headers */,
     
    94989485                                0F2B66E117B6B5AB00A7AE3F /* GenericTypedArrayViewInlines.h in Headers */,
    94999486                                1498CAD6214BF36D00710879 /* GetByIdMetadata.h in Headers */,
     9487                                0F0332C418B01763005F979A /* GetByIdVariant.h in Headers */,
    95009488                                0F9332A014CA7DCD0085F3C6 /* GetByStatus.h in Headers */,
    9501                                 0F0332C418B01763005F979A /* GetByIdVariant.h in Headers */,
     9489                                520D99F12388CC81000509A3 /* GetByValHistory.h in Headers */,
    95029490                                7964656A1B952FF0003059EE /* GetPutInfo.h in Headers */,
    95039491                                534E03581E53BF2F00213F64 /* GetterSetterAccessCase.h in Headers */,
     
    96149602                                0FB467801FDDA6F1003FCB09 /* IsoCellSet.h in Headers */,
    96159603                                0FB467811FDDA6F7003FCB09 /* IsoCellSetInlines.h in Headers */,
     9604                                E3BF1BAE238AAEDB003A1C2B /* IsoHeapCellType.h in Headers */,
    96169605                                0FDCE12D1FAFB4E5006F3901 /* IsoSubspace.h in Headers */,
    96179606                                0FD2FD9520B52BE200F09441 /* IsoSubspaceInlines.h in Headers */,
     
    97909779                                BDFCB2BBE90F41349E1B0BED /* JSSourceCode.h in Headers */,
    97919780                                BC18C4270E16F5CD00B34460 /* JSString.h in Headers */,
    9792                                 0F7DF13F1E2AFC4D0095951B /* JSStringHeapCellType.h in Headers */,
    97939781                                FEFD6FC61D5E7992008F2F0B /* JSStringInlines.h in Headers */,
    97949782                                70EC0EC31AA0D7DA00B6AAFA /* JSStringIterator.h in Headers */,
     
    98299817                                AD5C36EB1F75AD73000BCAAF /* JSWebAssembly.h in Headers */,
    98309818                                AD9E852F1E8A0C7C008DE39E /* JSWebAssemblyCodeBlock.h in Headers */,
    9831                                 79EFD4841EBC045C00F3DFEA /* JSWebAssemblyCodeBlockHeapCellType.h in Headers */,
    98329819                                AD2FCBE31DB58DAD00B3E736 /* JSWebAssemblyCompileError.h in Headers */,
    98339820                                796FB43A1DFF8C3F0039C95D /* JSWebAssemblyHelpers.h in Headers */,
     
    1029610283                                AD4937D41DDD27DE0077C807 /* WebAssemblyFunction.h in Headers */,
    1029710284                                521322461ECBCE8200F65615 /* WebAssemblyFunctionBase.h in Headers */,
    10298                                 523FD88E225566C9003B3DCC /* WebAssemblyFunctionHeapCellType.h in Headers */,
    1029910285                                AD2FCBF11DB58DAD00B3E736 /* WebAssemblyInstanceConstructor.h in Headers */,
    1030010286                                AD2FCC181DB59CB200B3E736 /* WebAssemblyInstanceConstructor.lut.h in Headers */,
  • trunk/Source/JavaScriptCore/Sources.txt

    r252684 r252843  
    864864runtime/JSStringIterator.cpp
    865865runtime/JSStringJoiner.cpp
    866 runtime/JSStringHeapCellType.cpp
    867866runtime/JSSymbolTableObject.cpp
    868867runtime/JSTemplateObjectDescriptor.cpp
     
    10431042wasm/js/JSWebAssembly.cpp
    10441043wasm/js/JSWebAssemblyCodeBlock.cpp
    1045 wasm/js/JSWebAssemblyCodeBlockHeapCellType.cpp
    10461044wasm/js/JSWebAssemblyCompileError.cpp
    10471045wasm/js/JSWebAssemblyInstance.cpp
     
    10571055wasm/js/WebAssemblyFunction.cpp
    10581056wasm/js/WebAssemblyFunctionBase.cpp
    1059 wasm/js/WebAssemblyFunctionHeapCellType.cpp
    10601057wasm/js/WebAssemblyInstanceConstructor.cpp
    10611058wasm/js/WebAssemblyInstancePrototype.cpp
  • trunk/Source/JavaScriptCore/heap/IsoHeapCellType.h

    r252842 r252843  
    2121 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    2222 * (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.
    2424 */
    2525
    26 #pragma once
    27 
    28 #if ENABLE(WEBASSEMBLY)
    29 
    3026#include "HeapCellType.h"
     27#include "MarkedBlockInlines.h"
    3128
    3229namespace JSC {
    3330
    34 class WebAssemblyFunctionHeapCellType : public HeapCellType {
     31template<typename CellType>
     32class IsoHeapCellType final : public HeapCellType {
    3533public:
    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    }
    4155};
    4256
    4357} // namespace JSC
    4458
    45 #endif // ENABLE(WEBASSEMBLY)
  • trunk/Source/JavaScriptCore/runtime/JSString.cpp

    r251425 r252843  
    6565}
    6666
    67 void JSString::destroy(JSCell* cell)
    68 {
    69     static_cast<JSString*>(cell)->JSString::~JSString();
    70 }
    71 
    7267void JSString::dumpToStream(const JSCell* cell, PrintStream& out)
    7368{
  • trunk/Source/JavaScriptCore/runtime/JSString.h

    r252390 r252843  
    9393
    9494    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    }
    9699   
    97100    // We specialize the string subspace to get the fastest possible sweep. This wouldn't be
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r252680 r252843  
    7070#include "IntlNumberFormatConstructor.h"
    7171#include "IntlPluralRulesConstructor.h"
     72#include "IsoHeapCellType.h"
    7273#include "JITCode.h"
    7374#include "JITWorklist.h"
     
    9798#include "JSSetIterator.h"
    9899#include "JSSourceCode.h"
    99 #include "JSStringHeapCellType.h"
    100100#include "JSTemplateObjectDescriptor.h"
    101101#include "JSWeakMap.h"
     
    104104#include "JSWebAssembly.h"
    105105#include "JSWebAssemblyCodeBlock.h"
    106 #include "JSWebAssemblyCodeBlockHeapCellType.h"
    107106#include "JSWebAssemblyMemory.h"
    108107#include "JSWithScope.h"
     
    152151#include "WeakGCMapInlines.h"
    153152#include "WebAssemblyFunction.h"
    154 #include "WebAssemblyFunctionHeapCellType.h"
    155153#include "WebAssemblyWrapperFunction.h"
    156154#include <wtf/ProcessID.h>
     
    264262    , cellHeapCellType(makeUnique<HeapCellType>(CellAttributes(DoesNotNeedDestruction, HeapCell::JSCell)))
    265263    , 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>>())
    267267    , destructibleObjectHeapCellType(makeUnique<JSDestructibleObjectHeapCellType>())
    268268#if ENABLE(WEBASSEMBLY)
    269     , webAssemblyCodeBlockHeapCellType(makeUnique<JSWebAssemblyCodeBlockHeapCellType>())
    270     , webAssemblyFunctionHeapCellType(makeUnique<WebAssemblyFunctionHeapCellType>())
     269    , webAssemblyCodeBlockHeapCellType(makeUnique<IsoHeapCellType<JSWebAssemblyCodeBlock>>())
     270    , webAssemblyFunctionHeapCellType(makeUnique<IsoHeapCellType<WebAssemblyFunction>>())
    271271#endif
    272272    , primitiveGigacageAuxiliarySpace("Primitive Gigacage Auxiliary", heap, auxiliaryHeapCellType.get(), primitiveGigacageAllocator.get()) // Hash:0x3e7cd762
     
    13081308DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(unlinkedModuleProgramCodeBlockSpace, destructibleCellHeapCellType.get(), UnlinkedModuleProgramCodeBlock)
    13091309DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(unlinkedProgramCodeBlockSpace, destructibleCellHeapCellType.get(), UnlinkedProgramCodeBlock)
    1310 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakMapSpace, destructibleObjectHeapCellType.get(), JSWeakMap) // Hash:0x662b12a3
    1311 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakSetSpace, destructibleObjectHeapCellType.get(), JSWeakSet) // Hash:0x4c781b30
     1310DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakMapSpace, weakMapHeapCellType.get(), JSWeakMap) // Hash:0x662b12a3
     1311DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakSetSpace, weakSetHeapCellType.get(), JSWeakSet) // Hash:0x4c781b30
    13121312DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakObjectRefSpace, cellHeapCellType.get(), JSWeakObjectRef) // Hash:0x8ec68f1f
    13131313#if JSC_OBJC_API_ENABLED
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r252680 r252843  
    128128class JSPropertyNameEnumerator;
    129129class JSRunLoopTimer;
    130 class JSStringHeapCellType;
    131 class JSWebAssemblyCodeBlockHeapCellType;
     130class JSWeakMap;
     131class JSWeakSet;
     132class JSWebAssemblyCodeBlock;
    132133class JSWebAssemblyInstance;
    133134class LLIntOffsetsExtractor;
     
    163164class Watchpoint;
    164165class WatchpointSet;
    165 class WebAssemblyFunctionHeapCellType;
     166class WebAssemblyFunction;
     167
     168template<typename CellType> class IsoHeapCellType;
    166169
    167170#if ENABLE(FTL_JIT)
     
    340343    std::unique_ptr<HeapCellType> cellHeapCellType;
    341344    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;
    343348    std::unique_ptr<JSDestructibleObjectHeapCellType> destructibleObjectHeapCellType;
    344349#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;
    347352#endif
    348353   
  • trunk/Source/JavaScriptCore/runtime/WeakMapImpl.h

    r240965 r252843  
    193193
    194194template <typename WeakMapBucketType>
    195 class WeakMapImpl : public JSDestructibleObject {
    196     using Base = JSDestructibleObject;
     195class WeakMapImpl : public JSNonFinalObject {
     196    using Base = JSNonFinalObject;
    197197    using WeakMapBufferType = WeakMapBuffer<WeakMapBucketType>;
    198198
     
    200200    using BucketType = WeakMapBucketType;
    201201
     202    static constexpr bool needsDestruction = true;
    202203    static void destroy(JSCell*);
    203204
Note: See TracChangeset for help on using the changeset viewer.