Title: [253423] trunk/Source/_javascript_Core
Revision
253423
Author
[email protected]
Date
2019-12-12 01:36:13 -0800 (Thu, 12 Dec 2019)

Log Message

[JSC] IsoHeapCellType should have destroy function member instead of specializing template function
https://bugs.webkit.org/show_bug.cgi?id=205152

Reviewed by Saam Barati.

We were specializing MarkedBlock::Handle::specializedSweep in 5 different ways for each IsoSubspace-ed cell.
This bloats binary. Instead of specializing it with CellType, we specialize it with one functor, which invokes
function pointer held by IsoHeapCellType. This requires one indirect function call per cell. But this is OK since,

1. We were using JSDestructibleObject's cell->classInfo->methodTable.destroy function call to dispatch destruction,
   before IsoSubspace replaces them with IsoHeapCellType-based destruction. Compared to that, the new one is still
   saving one pointer chasing basically (classInfo dereference, we assume cell deference is no cost since it will
   be done anyway).
2. We still keep JSString's destroy function inlining by using IsoInlinedHeapCellType. This is important since
   it is critical to performance and we had JSStringHeapCellType before we replaced it with IsoHeapCellType.
   But IsoInlinedHeapCellType specialization is for only one class so generated binary size is the same to the
   old code using JSStringHeapCellType.

This saves 480KB binary-size in _javascript_Core. And more importantly, after this patch, adding IsoSubspace
will not bloat code, so we can simply put things into IsoSubspace.

This patch also removes `using namespace JSC;` in global code in _javascript_Core except for API codes, since
it starts causing build failure due to unified builds: API defines JSType enum in a global scope, which is
different from our JSC::JSType. If we do `using namespace JSC;` in a global scope, it can lead to ambiguity of
looking up.

* API/JSHeapFinalizerPrivate.cpp:
(JSContextGroupAddHeapFinalizer):
(JSContextGroupRemoveHeapFinalizer):
* API/JSHeapFinalizerPrivate.h:
* _javascript_Core.xcodeproj/project.pbxproj:
* Sources.txt:
* assembler/AbstractMacroAssembler.cpp:
* bindings/ScriptFunctionCall.cpp:
* bindings/ScriptObject.cpp:
* bindings/ScriptValue.cpp:
* heap/IsoHeapCellType.cpp: Copied from Source/_javascript_Core/assembler/AbstractMacroAssembler.cpp.
(JSC::IsoHeapCellType::finishSweep):
(JSC::IsoHeapCellType::destroy):
* heap/IsoHeapCellType.h:
* heap/IsoInlinedHeapCellType.h: Copied from Source/_javascript_Core/heap/IsoHeapCellType.h.
* heap/MutatorState.cpp:
* heap/Synchronousness.cpp:
* inspector/InjectedScriptHost.cpp:
* inspector/InjectedScriptManager.cpp:
* inspector/JSGlobalObjectConsoleClient.cpp:
* inspector/JSGlobalObjectInspectorController.cpp:
* inspector/JSGlobalObjectScriptDebugServer.cpp:
* inspector/JSInjectedScriptHost.cpp:
* inspector/JSInjectedScriptHostPrototype.cpp:
* inspector/JSJavaScriptCallFrame.cpp:
* inspector/JSJavaScriptCallFramePrototype.cpp:
* inspector/_javascript_CallFrame.cpp:
* inspector/PerGlobalObjectWrapperWorld.cpp:
* inspector/ScriptCallStackFactory.cpp:
* inspector/ScriptDebugServer.cpp:
* inspector/agents/InspectorHeapAgent.cpp:
* inspector/agents/InspectorScriptProfilerAgent.cpp:
* inspector/agents/JSGlobalObjectAuditAgent.cpp:
* inspector/agents/JSGlobalObjectDebuggerAgent.cpp:
* inspector/agents/JSGlobalObjectRuntimeAgent.cpp:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/_javascript_Core/API/JSHeapFinalizerPrivate.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/API/JSHeapFinalizerPrivate.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/API/JSHeapFinalizerPrivate.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -29,18 +29,16 @@
 #include "APICast.h"
 #include "JSCInlines.h"
 
-using namespace JSC;
-
 void JSContextGroupAddHeapFinalizer(JSContextGroupRef group, JSHeapFinalizer finalizer, void *userData)
 {
-    VM* vm = toJS(group);
-    JSLockHolder locker(vm);
-    vm->heap.addHeapFinalizerCallback(HeapFinalizerCallback(finalizer, userData));
+    JSC::VM* vm = toJS(group);
+    JSC::JSLockHolder locker(vm);
+    vm->heap.addHeapFinalizerCallback(JSC::HeapFinalizerCallback(finalizer, userData));
 }
 
 void JSContextGroupRemoveHeapFinalizer(JSContextGroupRef group, JSHeapFinalizer finalizer, void *userData)
 {
-    VM* vm = toJS(group);
-    JSLockHolder locker(vm);
-    vm->heap.removeHeapFinalizerCallback(HeapFinalizerCallback(finalizer, userData));
+    JSC::VM* vm = toJS(group);
+    JSC::JSLockHolder locker(vm);
+    vm->heap.removeHeapFinalizerCallback(JSC::HeapFinalizerCallback(finalizer, userData));
 }

Modified: trunk/Source/_javascript_Core/API/JSHeapFinalizerPrivate.h (253422 => 253423)


--- trunk/Source/_javascript_Core/API/JSHeapFinalizerPrivate.h	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/API/JSHeapFinalizerPrivate.h	2019-12-12 09:36:13 UTC (rev 253423)
@@ -26,7 +26,7 @@
 #ifndef JSHeapFinalizerPrivate_h
 #define JSHeapFinalizerPrivate_h
 
-#include <_javascript_Core/JSContextRef.h>
+#include <_javascript_Core/JSBase.h>
 #include <stdbool.h>
 
 #ifdef __cplusplus

Modified: trunk/Source/_javascript_Core/ChangeLog (253422 => 253423)


--- trunk/Source/_javascript_Core/ChangeLog	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-12-12 09:36:13 UTC (rev 253423)
@@ -1,3 +1,70 @@
+2019-12-12  Yusuke Suzuki  <[email protected]>
+
+        [JSC] IsoHeapCellType should have destroy function member instead of specializing template function
+        https://bugs.webkit.org/show_bug.cgi?id=205152
+
+        Reviewed by Saam Barati.
+
+        We were specializing MarkedBlock::Handle::specializedSweep in 5 different ways for each IsoSubspace-ed cell.
+        This bloats binary. Instead of specializing it with CellType, we specialize it with one functor, which invokes
+        function pointer held by IsoHeapCellType. This requires one indirect function call per cell. But this is OK since,
+
+        1. We were using JSDestructibleObject's cell->classInfo->methodTable.destroy function call to dispatch destruction,
+           before IsoSubspace replaces them with IsoHeapCellType-based destruction. Compared to that, the new one is still
+           saving one pointer chasing basically (classInfo dereference, we assume cell deference is no cost since it will
+           be done anyway).
+        2. We still keep JSString's destroy function inlining by using IsoInlinedHeapCellType. This is important since
+           it is critical to performance and we had JSStringHeapCellType before we replaced it with IsoHeapCellType.
+           But IsoInlinedHeapCellType specialization is for only one class so generated binary size is the same to the
+           old code using JSStringHeapCellType.
+
+        This saves 480KB binary-size in _javascript_Core. And more importantly, after this patch, adding IsoSubspace
+        will not bloat code, so we can simply put things into IsoSubspace.
+
+        This patch also removes `using namespace JSC;` in global code in _javascript_Core except for API codes, since
+        it starts causing build failure due to unified builds: API defines JSType enum in a global scope, which is
+        different from our JSC::JSType. If we do `using namespace JSC;` in a global scope, it can lead to ambiguity of
+        looking up.
+
+        * API/JSHeapFinalizerPrivate.cpp:
+        (JSContextGroupAddHeapFinalizer):
+        (JSContextGroupRemoveHeapFinalizer):
+        * API/JSHeapFinalizerPrivate.h:
+        * _javascript_Core.xcodeproj/project.pbxproj:
+        * Sources.txt:
+        * assembler/AbstractMacroAssembler.cpp:
+        * bindings/ScriptFunctionCall.cpp:
+        * bindings/ScriptObject.cpp:
+        * bindings/ScriptValue.cpp:
+        * heap/IsoHeapCellType.cpp: Copied from Source/_javascript_Core/assembler/AbstractMacroAssembler.cpp.
+        (JSC::IsoHeapCellType::finishSweep):
+        (JSC::IsoHeapCellType::destroy):
+        * heap/IsoHeapCellType.h:
+        * heap/IsoInlinedHeapCellType.h: Copied from Source/_javascript_Core/heap/IsoHeapCellType.h.
+        * heap/MutatorState.cpp:
+        * heap/Synchronousness.cpp:
+        * inspector/InjectedScriptHost.cpp:
+        * inspector/InjectedScriptManager.cpp:
+        * inspector/JSGlobalObjectConsoleClient.cpp:
+        * inspector/JSGlobalObjectInspectorController.cpp:
+        * inspector/JSGlobalObjectScriptDebugServer.cpp:
+        * inspector/JSInjectedScriptHost.cpp:
+        * inspector/JSInjectedScriptHostPrototype.cpp:
+        * inspector/JSJavaScriptCallFrame.cpp:
+        * inspector/JSJavaScriptCallFramePrototype.cpp:
+        * inspector/_javascript_CallFrame.cpp:
+        * inspector/PerGlobalObjectWrapperWorld.cpp:
+        * inspector/ScriptCallStackFactory.cpp:
+        * inspector/ScriptDebugServer.cpp:
+        * inspector/agents/InspectorHeapAgent.cpp:
+        * inspector/agents/InspectorScriptProfilerAgent.cpp:
+        * inspector/agents/JSGlobalObjectAuditAgent.cpp:
+        * inspector/agents/JSGlobalObjectDebuggerAgent.cpp:
+        * inspector/agents/JSGlobalObjectRuntimeAgent.cpp:
+        * runtime/VM.cpp:
+        (JSC::VM::VM):
+        * runtime/VM.h:
+
 2019-12-11  Yusuke Suzuki  <[email protected]>
 
         [JSC] Put all API related JS cells into IsoSubspace

Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (253422 => 253423)


--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2019-12-12 09:36:13 UTC (rev 253423)
@@ -1844,6 +1844,7 @@
 		E3C295DD1ED2CBDA00D3016F /* ObjectPropertyChangeAdaptiveWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E3C295DC1ED2CBAA00D3016F /* ObjectPropertyChangeAdaptiveWatchpoint.h */; };
 		E3C694B323026877006FBE42 /* WasmOSREntryData.h in Headers */ = {isa = PBXBuildFile; fileRef = E3C694B123026873006FBE42 /* WasmOSREntryData.h */; };
 		E3C79CAB1DB9A4DC00D1ECA4 /* DOMJITEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = E3C79CAA1DB9A4D600D1ECA4 /* DOMJITEffect.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		E3C8ED4323A1DBCB00131958 /* IsoInlinedHeapCellType.h in Headers */ = {isa = PBXBuildFile; fileRef = E3C8ED4223A1DBC500131958 /* IsoInlinedHeapCellType.h */; };
 		E3D239C91B829C1C00BBEF67 /* JSModuleEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = E3D239C71B829C1C00BBEF67 /* JSModuleEnvironment.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		E3D877741E65C0A000BE945A /* BytecodeDumper.h in Headers */ = {isa = PBXBuildFile; fileRef = E3D877721E65C08900BE945A /* BytecodeDumper.h */; };
 		E3EE137621FBD43500D83C4B /* ErrorType.h in Headers */ = {isa = PBXBuildFile; fileRef = E3EE137421FBD43400D83C4B /* ErrorType.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -4997,6 +4998,8 @@
 		E3C694B123026873006FBE42 /* WasmOSREntryData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WasmOSREntryData.h; sourceTree = "<group>"; };
 		E3C694B223026874006FBE42 /* WasmTierUpCount.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WasmTierUpCount.cpp; sourceTree = "<group>"; };
 		E3C79CAA1DB9A4D600D1ECA4 /* DOMJITEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMJITEffect.h; sourceTree = "<group>"; };
+		E3C8ED4123A1DBC400131958 /* IsoHeapCellType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IsoHeapCellType.cpp; sourceTree = "<group>"; };
+		E3C8ED4223A1DBC500131958 /* IsoInlinedHeapCellType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IsoInlinedHeapCellType.h; sourceTree = "<group>"; };
 		E3D239C61B829C1C00BBEF67 /* JSModuleEnvironment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSModuleEnvironment.cpp; sourceTree = "<group>"; };
 		E3D239C71B829C1C00BBEF67 /* JSModuleEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSModuleEnvironment.h; sourceTree = "<group>"; };
 		E3D264261D38C042000BE174 /* BytecodeGeneratorification.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BytecodeGeneratorification.cpp; sourceTree = "<group>"; };
@@ -6208,7 +6211,9 @@
 				0FB4677C1FDDA6D9003FCB09 /* IsoCellSet.cpp */,
 				0FB4677D1FDDA6D9003FCB09 /* IsoCellSet.h */,
 				0FB4677B1FDDA6D8003FCB09 /* IsoCellSetInlines.h */,
+				E3C8ED4123A1DBC400131958 /* IsoHeapCellType.cpp */,
 				E3BF1BAD238AAED1003A1C2B /* IsoHeapCellType.h */,
+				E3C8ED4223A1DBC500131958 /* IsoInlinedHeapCellType.h */,
 				0FDCE12C1FAFB4DE006F3901 /* IsoSubspace.cpp */,
 				0FDCE12B1FAFB4DE006F3901 /* IsoSubspace.h */,
 				0FD2FD9220B52BDC00F09441 /* IsoSubspaceInlines.h */,
@@ -9632,6 +9637,7 @@
 				0FB467801FDDA6F1003FCB09 /* IsoCellSet.h in Headers */,
 				0FB467811FDDA6F7003FCB09 /* IsoCellSetInlines.h in Headers */,
 				E3BF1BAE238AAEDB003A1C2B /* IsoHeapCellType.h in Headers */,
+				E3C8ED4323A1DBCB00131958 /* IsoInlinedHeapCellType.h in Headers */,
 				0FDCE12D1FAFB4E5006F3901 /* IsoSubspace.h in Headers */,
 				0FD2FD9520B52BE200F09441 /* IsoSubspaceInlines.h in Headers */,
 				0F5E0FE72086AD480097F0DE /* IsoSubspacePerVM.h in Headers */,

Modified: trunk/Source/_javascript_Core/Sources.txt (253422 => 253423)


--- trunk/Source/_javascript_Core/Sources.txt	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/Sources.txt	2019-12-12 09:36:13 UTC (rev 253423)
@@ -525,6 +525,7 @@
 heap/IncrementalSweeper.cpp
 heap/IsoAlignedMemoryAllocator.cpp
 heap/IsoCellSet.cpp
+heap/IsoHeapCellType.cpp
 heap/IsoSubspace.cpp
 heap/IsoSubspacePerVM.cpp
 heap/JITStubRoutineSet.cpp

Modified: trunk/Source/_javascript_Core/assembler/AbstractMacroAssembler.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/assembler/AbstractMacroAssembler.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/assembler/AbstractMacroAssembler.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -30,10 +30,10 @@
 
 #include <wtf/PrintStream.h>
 
+namespace WTF {
+
 using namespace JSC;
 
-namespace WTF {
-
 void printInternal(PrintStream& out, AbstractMacroAssemblerBase::StatusCondition condition)
 {
     switch (condition) {

Modified: trunk/Source/_javascript_Core/bindings/ScriptFunctionCall.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/bindings/ScriptFunctionCall.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/bindings/ScriptFunctionCall.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -36,10 +36,10 @@
 #include "JSLock.h"
 #include <wtf/text/WTFString.h>
 
+namespace Deprecated {
+
 using namespace JSC;
 
-namespace Deprecated {
-
 void ScriptCallArgumentHandler::appendArgument(const String& argument)
 {
     VM& vm = m_globalObject->vm();

Modified: trunk/Source/_javascript_Core/bindings/ScriptObject.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/bindings/ScriptObject.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/bindings/ScriptObject.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -34,10 +34,10 @@
 
 #include "JSCInlines.h"
 
+namespace Deprecated {
+
 using namespace JSC;
 
-namespace Deprecated {
-
 ScriptObject::ScriptObject(JSGlobalObject* globalObject, JSObject* object)
     : ScriptValue(globalObject->vm(), object)
     , m_globalObject(globalObject)

Modified: trunk/Source/_javascript_Core/bindings/ScriptValue.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/bindings/ScriptValue.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/bindings/ScriptValue.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -35,11 +35,10 @@
 #include "JSCInlines.h"
 #include "JSLock.h"
 
+namespace Inspector {
+
 using namespace JSC;
-using namespace Inspector;
 
-namespace Inspector {
-
 static RefPtr<JSON::Value> jsToInspectorValue(JSGlobalObject* globalObject, JSValue value, int maxDepth)
 {
     if (!value) {

Copied: trunk/Source/_javascript_Core/heap/IsoHeapCellType.cpp (from rev 253422, trunk/Source/_javascript_Core/API/JSHeapFinalizerPrivate.h) (0 => 253423)


--- trunk/Source/_javascript_Core/heap/IsoHeapCellType.cpp	                        (rev 0)
+++ trunk/Source/_javascript_Core/heap/IsoHeapCellType.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2019 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 "IsoHeapCellType.h"
+
+#include "JSCInlines.h"
+#include "MarkedBlockInlines.h"
+
+namespace JSC {
+
+void IsoHeapCellType::finishSweep(MarkedBlock::Handle& handle, FreeList* freeList)
+{
+    handle.finishSweepKnowingHeapCellType(freeList, *this);
+}
+
+void IsoHeapCellType::destroy(VM&, JSCell* cell)
+{
+    m_destroy(cell);
+}
+
+} // namespace JSC
+

Modified: trunk/Source/_javascript_Core/heap/IsoHeapCellType.h (253422 => 253423)


--- trunk/Source/_javascript_Core/heap/IsoHeapCellType.h	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/heap/IsoHeapCellType.h	2019-12-12 09:36:13 UTC (rev 253423)
@@ -28,31 +28,32 @@
 
 namespace JSC {
 
-template<typename CellType>
 class IsoHeapCellType final : public HeapCellType {
 public:
-    IsoHeapCellType()
-        : HeapCellType(CellAttributes(CellType::needsDestruction ? NeedsDestruction : DoesNotNeedDestruction, HeapCell::JSCell))
+    using DestroyFunctionPtr = void (*)(JSCell*);
+
+    IsoHeapCellType(DestructionMode destructionMode, DestroyFunctionPtr destroyFunction)
+        : HeapCellType(CellAttributes(destructionMode, HeapCell::JSCell))
+        , m_destroy(destroyFunction)
     {
     }
 
-    struct DestroyFunc {
-        ALWAYS_INLINE void operator()(VM&, JSCell* cell) const
-        {
-            CellType::destroy(cell);
-        }
-    };
-
-    void finishSweep(MarkedBlock::Handle& handle, FreeList* freeList) override
+    template<typename CellType>
+    static std::unique_ptr<IsoHeapCellType> create()
     {
-        handle.finishSweepKnowingHeapCellType(freeList, DestroyFunc());
+        return makeUnique<IsoHeapCellType>(CellType::needsDestruction ? NeedsDestruction : DoesNotNeedDestruction, &CellType::destroy);
     }
 
-    void destroy(VM&, JSCell* cell) override
+    void finishSweep(MarkedBlock::Handle&, FreeList*) override;
+    void destroy(VM&, JSCell*) override;
+
+    ALWAYS_INLINE void operator()(VM&, JSCell* cell) const
     {
-        CellType::destroy(cell);
+        m_destroy(cell);
     }
+
+private:
+    DestroyFunctionPtr WTF_VTBL_FUNCPTR_PTRAUTH_STR("IsoHeapCellType.destroy") m_destroy;
 };
 
 } // namespace JSC
-

Copied: trunk/Source/_javascript_Core/heap/IsoInlinedHeapCellType.h (from rev 253422, trunk/Source/_javascript_Core/heap/IsoHeapCellType.h) (0 => 253423)


--- trunk/Source/_javascript_Core/heap/IsoInlinedHeapCellType.h	                        (rev 0)
+++ trunk/Source/_javascript_Core/heap/IsoInlinedHeapCellType.h	2019-12-12 09:36:13 UTC (rev 253423)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2019 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 "HeapCellType.h"
+#include "MarkedBlockInlines.h"
+
+namespace JSC {
+
+template<typename CellType>
+class IsoInlinedHeapCellType final : public HeapCellType {
+public:
+    IsoInlinedHeapCellType()
+        : HeapCellType(CellAttributes(CellType::needsDestruction ? NeedsDestruction : DoesNotNeedDestruction, HeapCell::JSCell))
+    {
+    }
+
+    struct DestroyFunc {
+        ALWAYS_INLINE void operator()(VM&, JSCell* cell) const
+        {
+            CellType::destroy(cell);
+        }
+    };
+
+    void finishSweep(MarkedBlock::Handle& handle, FreeList* freeList) override
+    {
+        handle.finishSweepKnowingHeapCellType(freeList, DestroyFunc());
+    }
+
+    void destroy(VM&, JSCell* cell) override
+    {
+        CellType::destroy(cell);
+    }
+};
+
+} // namespace JSC
+

Modified: trunk/Source/_javascript_Core/heap/MutatorState.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/heap/MutatorState.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/heap/MutatorState.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -28,10 +28,10 @@
 
 #include <wtf/PrintStream.h>
 
+namespace WTF {
+
 using namespace JSC;
 
-namespace WTF {
-
 void printInternal(PrintStream& out, MutatorState state)
 {
     switch (state) {

Modified: trunk/Source/_javascript_Core/heap/Synchronousness.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/heap/Synchronousness.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/heap/Synchronousness.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -28,10 +28,10 @@
 
 #include <wtf/PrintStream.h>
 
+namespace WTF {
+
 using namespace JSC;
 
-namespace WTF {
-
 void printInternal(PrintStream& out, Synchronousness synchronousness)
 {
     switch (synchronousness) {

Modified: trunk/Source/_javascript_Core/inspector/InjectedScriptHost.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/InjectedScriptHost.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/InjectedScriptHost.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -29,10 +29,10 @@
 #include "JSCInlines.h"
 #include "JSInjectedScriptHost.h"
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 InjectedScriptHost::~InjectedScriptHost()
 {
 }

Modified: trunk/Source/_javascript_Core/inspector/InjectedScriptManager.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/InjectedScriptManager.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/InjectedScriptManager.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -42,10 +42,10 @@
 #include "SourceCode.h"
 #include <wtf/JSONValues.h>
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 InjectedScriptManager::InjectedScriptManager(InspectorEnvironment& environment, Ref<InjectedScriptHost>&& injectedScriptHost)
     : m_environment(environment)
     , m_injectedScriptHost(WTFMove(injectedScriptHost))

Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -34,10 +34,10 @@
 #include "ScriptCallStack.h"
 #include "ScriptCallStackFactory.h"
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 #if !LOG_DISABLED
 static bool sLogToSystemConsole = true;
 #else

Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -57,10 +57,10 @@
 #include "RemoteInspector.h"
 #endif
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 JSGlobalObjectInspectorController::JSGlobalObjectInspectorController(JSGlobalObject& globalObject)
     : m_globalObject(globalObject)
     , m_injectedScriptManager(makeUnique<InjectedScriptManager>(*this, InjectedScriptHost::create()))

Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectScriptDebugServer.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectScriptDebugServer.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectScriptDebugServer.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -31,10 +31,10 @@
 #include "JSLock.h"
 #include "RemoteInspectionTarget.h"
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 JSGlobalObjectScriptDebugServer::JSGlobalObjectScriptDebugServer(JSGlobalObject& globalObject)
     : ScriptDebugServer(globalObject.vm())
     , m_globalObject(globalObject)

Modified: trunk/Source/_javascript_Core/inspector/JSInjectedScriptHost.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/JSInjectedScriptHost.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/JSInjectedScriptHost.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -80,10 +80,10 @@
 #include <wtf/PrintStream.h>
 #include <wtf/text/StringConcatenate.h>
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 const ClassInfo JSInjectedScriptHost::s_info = { "InjectedScriptHost", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSInjectedScriptHost) };
 
 JSInjectedScriptHost::JSInjectedScriptHost(VM& vm, Structure* structure, Ref<InjectedScriptHost>&& impl)

Modified: trunk/Source/_javascript_Core/inspector/JSInjectedScriptHostPrototype.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/JSInjectedScriptHostPrototype.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/JSInjectedScriptHostPrototype.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -34,10 +34,10 @@
 #include "JSFunction.h"
 #include "JSInjectedScriptHost.h"
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionSubtype(JSGlobalObject*, CallFrame*);
 static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionFunctionDetails(JSGlobalObject*, CallFrame*);
 static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionGetInternalProperties(JSGlobalObject*, CallFrame*);

Modified: trunk/Source/_javascript_Core/inspector/JSJavaScriptCallFrame.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/JSJavaScriptCallFrame.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/JSJavaScriptCallFrame.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -33,10 +33,10 @@
 #include "JSJavaScriptCallFramePrototype.h"
 #include "ObjectConstructor.h"
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 const ClassInfo JSJavaScriptCallFrame::s_info = { "_javascript_CallFrame", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSJavaScriptCallFrame) };
 
 JSJavaScriptCallFrame::JSJavaScriptCallFrame(VM& vm, Structure* structure, Ref<_javascript_CallFrame>&& impl)

Modified: trunk/Source/_javascript_Core/inspector/JSJavaScriptCallFramePrototype.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/JSJavaScriptCallFramePrototype.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/JSJavaScriptCallFramePrototype.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -32,10 +32,10 @@
 #include "JSFunction.h"
 #include "JSJavaScriptCallFrame.h"
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 // Functions.
 static EncodedJSValue JSC_HOST_CALL jsJavaScriptCallFramePrototypeFunctionEvaluateWithScopeExtension(JSGlobalObject*, CallFrame*);
 static EncodedJSValue JSC_HOST_CALL jsJavaScriptCallFramePrototypeFunctionScopeDescriptions(JSGlobalObject*, CallFrame*);

Modified: trunk/Source/_javascript_Core/inspector/_javascript_CallFrame.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/_javascript_CallFrame.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/_javascript_CallFrame.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -26,10 +26,10 @@
 #include "config.h"
 #include "_javascript_CallFrame.h"
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 _javascript_CallFrame::_javascript_CallFrame(Ref<DebuggerCallFrame>&& debuggerCallFrame)
     : m_debuggerCallFrame(WTFMove(debuggerCallFrame))
 {

Modified: trunk/Source/_javascript_Core/inspector/PerGlobalObjectWrapperWorld.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/PerGlobalObjectWrapperWorld.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/PerGlobalObjectWrapperWorld.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -26,10 +26,10 @@
 #include "config.h"
 #include "PerGlobalObjectWrapperWorld.h"
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 JSValue PerGlobalObjectWrapperWorld::getWrapper(JSGlobalObject* globalObject)
 {
     auto it = m_wrappers.find(globalObject);

Modified: trunk/Source/_javascript_Core/inspector/ScriptCallStackFactory.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/ScriptCallStackFactory.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/ScriptCallStackFactory.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -45,10 +45,10 @@
 #include "StrongInlines.h"
 #include <wtf/text/WTFString.h>
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 class CreateScriptCallStackFunctor {
 public:
     CreateScriptCallStackFunctor(bool needToSkipAFrame, Vector<ScriptCallFrame>& frames, size_t remainingCapacity)

Modified: trunk/Source/_javascript_Core/inspector/ScriptDebugServer.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/ScriptDebugServer.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/ScriptDebugServer.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -41,10 +41,10 @@
 #include <wtf/NeverDestroyed.h>
 #include <wtf/SetForScope.h>
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 ScriptDebugServer::ScriptDebugServer(VM& vm)
     : Debugger(vm)
 {

Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorHeapAgent.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/agents/InspectorHeapAgent.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorHeapAgent.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -36,10 +36,10 @@
 #include "VM.h"
 #include <wtf/Stopwatch.h>
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 InspectorHeapAgent::InspectorHeapAgent(AgentContext& context)
     : InspectorAgentBase("Heap"_s)
     , m_injectedScriptManager(context.injectedScriptManager)

Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -33,10 +33,10 @@
 #include "ScriptDebugServer.h"
 #include <wtf/Stopwatch.h>
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 InspectorScriptProfilerAgent::InspectorScriptProfilerAgent(AgentContext& context)
     : InspectorAgentBase("ScriptProfiler"_s)
     , m_frontendDispatcher(makeUnique<ScriptProfilerFrontendDispatcher>(context.frontendRouter))

Modified: trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectAuditAgent.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectAuditAgent.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectAuditAgent.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -34,10 +34,10 @@
 #include <wtf/RefPtr.h>
 #include <wtf/text/WTFString.h>
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 JSGlobalObjectAuditAgent::JSGlobalObjectAuditAgent(JSAgentContext& context)
     : InspectorAuditAgent(context)
     , m_globalObject(context.inspectedGlobalObject)

Modified: trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectDebuggerAgent.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectDebuggerAgent.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectDebuggerAgent.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -35,10 +35,10 @@
 #include "ScriptCallStack.h"
 #include "ScriptCallStackFactory.h"
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent(JSAgentContext& context, InspectorConsoleAgent* consoleAgent)
     : InspectorDebuggerAgent(context)
     , m_consoleAgent(consoleAgent)

Modified: trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectRuntimeAgent.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectRuntimeAgent.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/inspector/agents/JSGlobalObjectRuntimeAgent.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -30,10 +30,10 @@
 #include "InjectedScriptManager.h"
 #include "JSGlobalObject.h"
 
+namespace Inspector {
+
 using namespace JSC;
 
-namespace Inspector {
-
 JSGlobalObjectRuntimeAgent::JSGlobalObjectRuntimeAgent(JSAgentContext& context)
     : InspectorRuntimeAgent(context)
     , m_frontendDispatcher(makeUnique<RuntimeFrontendDispatcher>(context.frontendRouter))

Modified: trunk/Source/_javascript_Core/runtime/VM.cpp (253422 => 253423)


--- trunk/Source/_javascript_Core/runtime/VM.cpp	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/runtime/VM.cpp	2019-12-12 09:36:13 UTC (rev 253423)
@@ -76,6 +76,7 @@
 #include "IntlNumberFormatConstructor.h"
 #include "IntlPluralRulesConstructor.h"
 #include "IsoHeapCellType.h"
+#include "IsoInlinedHeapCellType.h"
 #include "JITCode.h"
 #include "JITWorklist.h"
 #include "JSAPIGlobalObject.h"
@@ -301,40 +302,40 @@
     , immutableButterflyHeapCellType(makeUnique<HeapCellType>(CellAttributes(DoesNotNeedDestruction, HeapCell::JSCellWithInteriorPointers)))
     , cellHeapCellType(makeUnique<HeapCellType>(CellAttributes(DoesNotNeedDestruction, HeapCell::JSCell)))
     , destructibleCellHeapCellType(makeUnique<HeapCellType>(CellAttributes(NeedsDestruction, HeapCell::JSCell)))
-    , callbackConstructorHeapCellType(makeUnique<IsoHeapCellType<JSCallbackConstructor>>())
-    , callbackObjectHeapCellType(makeUnique<IsoHeapCellType<JSCallbackObject<JSNonFinalObject>>>())
-    , dateInstanceHeapCellType(makeUnique<IsoHeapCellType<DateInstance>>())
-    , errorInstanceHeapCellType(makeUnique<IsoHeapCellType<ErrorInstance>>())
-    , jsModuleRecordHeapCellType(makeUnique<IsoHeapCellType<JSModuleRecord>>())
-    , moduleNamespaceObjectHeapCellType(makeUnique<IsoHeapCellType<JSModuleNamespaceObject>>())
-    , nativeStdFunctionHeapCellType(makeUnique<IsoHeapCellType<JSNativeStdFunction>>())
-    , stringHeapCellType(makeUnique<IsoHeapCellType<JSString>>())
-    , weakMapHeapCellType(makeUnique<IsoHeapCellType<JSWeakMap>>())
-    , weakSetHeapCellType(makeUnique<IsoHeapCellType<JSWeakSet>>())
+    , callbackConstructorHeapCellType(IsoHeapCellType::create<JSCallbackConstructor>())
+    , callbackObjectHeapCellType(IsoHeapCellType::create<JSCallbackObject<JSNonFinalObject>>())
+    , dateInstanceHeapCellType(IsoHeapCellType::create<DateInstance>())
+    , errorInstanceHeapCellType(IsoHeapCellType::create<ErrorInstance>())
+    , jsModuleRecordHeapCellType(IsoHeapCellType::create<JSModuleRecord>())
+    , moduleNamespaceObjectHeapCellType(IsoHeapCellType::create<JSModuleNamespaceObject>())
+    , nativeStdFunctionHeapCellType(IsoHeapCellType::create<JSNativeStdFunction>())
+    , stringHeapCellType(makeUnique<IsoInlinedHeapCellType<JSString>>())
+    , weakMapHeapCellType(IsoHeapCellType::create<JSWeakMap>())
+    , weakSetHeapCellType(IsoHeapCellType::create<JSWeakSet>())
     , destructibleObjectHeapCellType(makeUnique<JSDestructibleObjectHeapCellType>())
 #if JSC_OBJC_API_ENABLED
-    , apiWrapperObjectHeapCellType(makeUnique<IsoHeapCellType<JSCallbackObject<JSAPIWrapperObject>>>())
-    , objCCallbackFunctionHeapCellType(makeUnique<IsoHeapCellType<ObjCCallbackFunction>>())
+    , apiWrapperObjectHeapCellType(IsoHeapCellType::create<JSCallbackObject<JSAPIWrapperObject>>())
+    , objCCallbackFunctionHeapCellType(IsoHeapCellType::create<ObjCCallbackFunction>())
 #endif
 #ifdef JSC_GLIB_API_ENABLED
-    , apiWrapperObjectHeapCellType(makeUnique<IsoHeapCellType<JSCallbackObject<JSAPIWrapperObject>>>())
-    , jscCallbackFunctionHeapCellType(makeUnique<IsoHeapCellType<JSCCallbackFunction>>())
+    , apiWrapperObjectHeapCellType(IsoHeapCellType::create<JSCallbackObject<JSAPIWrapperObject>>())
+    , jscCallbackFunctionHeapCellType(IsoHeapCellType::create<JSCCallbackFunction>())
 #endif
 #if ENABLE(INTL)
-    , intlCollatorHeapCellType(makeUnique<IsoHeapCellType<IntlCollator>>())
-    , intlDateTimeFormatHeapCellType(makeUnique<IsoHeapCellType<IntlDateTimeFormat>>())
-    , intlNumberFormatHeapCellType(makeUnique<IsoHeapCellType<IntlNumberFormat>>())
-    , intlPluralRulesHeapCellType(makeUnique<IsoHeapCellType<IntlPluralRules>>())
+    , intlCollatorHeapCellType(IsoHeapCellType::create<IntlCollator>())
+    , intlDateTimeFormatHeapCellType(IsoHeapCellType::create<IntlDateTimeFormat>())
+    , intlNumberFormatHeapCellType(IsoHeapCellType::create<IntlNumberFormat>())
+    , intlPluralRulesHeapCellType(IsoHeapCellType::create<IntlPluralRules>())
 #endif
 #if ENABLE(WEBASSEMBLY)
-    , webAssemblyCodeBlockHeapCellType(makeUnique<IsoHeapCellType<JSWebAssemblyCodeBlock>>())
-    , webAssemblyFunctionHeapCellType(makeUnique<IsoHeapCellType<WebAssemblyFunction>>())
-    , webAssemblyGlobalHeapCellType(makeUnique<IsoHeapCellType<JSWebAssemblyGlobal>>())
-    , webAssemblyInstanceHeapCellType(makeUnique<IsoHeapCellType<JSWebAssemblyInstance>>())
-    , webAssemblyMemoryHeapCellType(makeUnique<IsoHeapCellType<JSWebAssemblyMemory>>())
-    , webAssemblyModuleHeapCellType(makeUnique<IsoHeapCellType<JSWebAssemblyModule>>())
-    , webAssemblyModuleRecordHeapCellType(makeUnique<IsoHeapCellType<WebAssemblyModuleRecord>>())
-    , webAssemblyTableHeapCellType(makeUnique<IsoHeapCellType<JSWebAssemblyTable>>())
+    , webAssemblyCodeBlockHeapCellType(IsoHeapCellType::create<JSWebAssemblyCodeBlock>())
+    , webAssemblyFunctionHeapCellType(IsoHeapCellType::create<WebAssemblyFunction>())
+    , webAssemblyGlobalHeapCellType(IsoHeapCellType::create<JSWebAssemblyGlobal>())
+    , webAssemblyInstanceHeapCellType(IsoHeapCellType::create<JSWebAssemblyInstance>())
+    , webAssemblyMemoryHeapCellType(IsoHeapCellType::create<JSWebAssemblyMemory>())
+    , webAssemblyModuleHeapCellType(IsoHeapCellType::create<JSWebAssemblyModule>())
+    , webAssemblyModuleRecordHeapCellType(IsoHeapCellType::create<WebAssemblyModuleRecord>())
+    , webAssemblyTableHeapCellType(IsoHeapCellType::create<JSWebAssemblyTable>())
 #endif
     , primitiveGigacageAuxiliarySpace("Primitive Gigacage Auxiliary", heap, auxiliaryHeapCellType.get(), primitiveGigacageAllocator.get()) // Hash:0x3e7cd762
     , jsValueGigacageAuxiliarySpace("JSValue Gigacage Auxiliary", heap, auxiliaryHeapCellType.get(), jsValueGigacageAllocator.get()) // Hash:0x241e946

Modified: trunk/Source/_javascript_Core/runtime/VM.h (253422 => 253423)


--- trunk/Source/_javascript_Core/runtime/VM.h	2019-12-12 08:48:07 UTC (rev 253422)
+++ trunk/Source/_javascript_Core/runtime/VM.h	2019-12-12 09:36:13 UTC (rev 253423)
@@ -184,7 +184,8 @@
 class WebAssemblyFunction;
 class WebAssemblyModuleRecord;
 
-template<typename CellType> class IsoHeapCellType;
+class IsoHeapCellType;
+template<typename CellType> class IsoInlinedHeapCellType;
 template<typename Parent> class JSCallbackObject;
 
 #if ENABLE(FTL_JIT)
@@ -363,40 +364,40 @@
     std::unique_ptr<HeapCellType> immutableButterflyHeapCellType;
     std::unique_ptr<HeapCellType> cellHeapCellType;
     std::unique_ptr<HeapCellType> destructibleCellHeapCellType;
-    std::unique_ptr<IsoHeapCellType<JSCallbackConstructor>> callbackConstructorHeapCellType;
-    std::unique_ptr<IsoHeapCellType<JSCallbackObject<JSNonFinalObject>>> callbackObjectHeapCellType;
-    std::unique_ptr<IsoHeapCellType<DateInstance>> dateInstanceHeapCellType;
-    std::unique_ptr<IsoHeapCellType<ErrorInstance>> errorInstanceHeapCellType;
-    std::unique_ptr<IsoHeapCellType<JSModuleRecord>> jsModuleRecordHeapCellType;
-    std::unique_ptr<IsoHeapCellType<JSModuleNamespaceObject>> moduleNamespaceObjectHeapCellType;
-    std::unique_ptr<IsoHeapCellType<JSNativeStdFunction>> nativeStdFunctionHeapCellType;
-    std::unique_ptr<IsoHeapCellType<JSString>> stringHeapCellType;
-    std::unique_ptr<IsoHeapCellType<JSWeakMap>> weakMapHeapCellType;
-    std::unique_ptr<IsoHeapCellType<JSWeakSet>> weakSetHeapCellType;
+    std::unique_ptr<IsoHeapCellType> callbackConstructorHeapCellType;
+    std::unique_ptr<IsoHeapCellType> callbackObjectHeapCellType;
+    std::unique_ptr<IsoHeapCellType> dateInstanceHeapCellType;
+    std::unique_ptr<IsoHeapCellType> errorInstanceHeapCellType;
+    std::unique_ptr<IsoHeapCellType> jsModuleRecordHeapCellType;
+    std::unique_ptr<IsoHeapCellType> moduleNamespaceObjectHeapCellType;
+    std::unique_ptr<IsoHeapCellType> nativeStdFunctionHeapCellType;
+    std::unique_ptr<IsoInlinedHeapCellType<JSString>> stringHeapCellType;
+    std::unique_ptr<IsoHeapCellType> weakMapHeapCellType;
+    std::unique_ptr<IsoHeapCellType> weakSetHeapCellType;
     std::unique_ptr<JSDestructibleObjectHeapCellType> destructibleObjectHeapCellType;
 #if JSC_OBJC_API_ENABLED
-    std::unique_ptr<IsoHeapCellType<JSCallbackObject<JSAPIWrapperObject>>> apiWrapperObjectHeapCellType;
-    std::unique_ptr<IsoHeapCellType<ObjCCallbackFunction>> objCCallbackFunctionHeapCellType;
+    std::unique_ptr<IsoHeapCellType> apiWrapperObjectHeapCellType;
+    std::unique_ptr<IsoHeapCellType> objCCallbackFunctionHeapCellType;
 #endif
 #ifdef JSC_GLIB_API_ENABLED
-    std::unique_ptr<IsoHeapCellType<JSCallbackObject<JSAPIWrapperObject>>> apiWrapperObjectHeapCellType;
-    std::unique_ptr<IsoHeapCellType<JSCCallbackFunction>> jscCallbackFunctionHeapCellType;
+    std::unique_ptr<IsoHeapCellType> apiWrapperObjectHeapCellType;
+    std::unique_ptr<IsoHeapCellType> jscCallbackFunctionHeapCellType;
 #endif
 #if ENABLE(INTL)
-    std::unique_ptr<IsoHeapCellType<IntlCollator>> intlCollatorHeapCellType;
-    std::unique_ptr<IsoHeapCellType<IntlDateTimeFormat>> intlDateTimeFormatHeapCellType;
-    std::unique_ptr<IsoHeapCellType<IntlNumberFormat>> intlNumberFormatHeapCellType;
-    std::unique_ptr<IsoHeapCellType<IntlPluralRules>> intlPluralRulesHeapCellType;
+    std::unique_ptr<IsoHeapCellType> intlCollatorHeapCellType;
+    std::unique_ptr<IsoHeapCellType> intlDateTimeFormatHeapCellType;
+    std::unique_ptr<IsoHeapCellType> intlNumberFormatHeapCellType;
+    std::unique_ptr<IsoHeapCellType> intlPluralRulesHeapCellType;
 #endif
 #if ENABLE(WEBASSEMBLY)
-    std::unique_ptr<IsoHeapCellType<JSWebAssemblyCodeBlock>> webAssemblyCodeBlockHeapCellType;
-    std::unique_ptr<IsoHeapCellType<WebAssemblyFunction>> webAssemblyFunctionHeapCellType;
-    std::unique_ptr<IsoHeapCellType<JSWebAssemblyGlobal>> webAssemblyGlobalHeapCellType;
-    std::unique_ptr<IsoHeapCellType<JSWebAssemblyInstance>> webAssemblyInstanceHeapCellType;
-    std::unique_ptr<IsoHeapCellType<JSWebAssemblyMemory>> webAssemblyMemoryHeapCellType;
-    std::unique_ptr<IsoHeapCellType<JSWebAssemblyModule>> webAssemblyModuleHeapCellType;
-    std::unique_ptr<IsoHeapCellType<WebAssemblyModuleRecord>> webAssemblyModuleRecordHeapCellType;
-    std::unique_ptr<IsoHeapCellType<JSWebAssemblyTable>> webAssemblyTableHeapCellType;
+    std::unique_ptr<IsoHeapCellType> webAssemblyCodeBlockHeapCellType;
+    std::unique_ptr<IsoHeapCellType> webAssemblyFunctionHeapCellType;
+    std::unique_ptr<IsoHeapCellType> webAssemblyGlobalHeapCellType;
+    std::unique_ptr<IsoHeapCellType> webAssemblyInstanceHeapCellType;
+    std::unique_ptr<IsoHeapCellType> webAssemblyMemoryHeapCellType;
+    std::unique_ptr<IsoHeapCellType> webAssemblyModuleHeapCellType;
+    std::unique_ptr<IsoHeapCellType> webAssemblyModuleRecordHeapCellType;
+    std::unique_ptr<IsoHeapCellType> webAssemblyTableHeapCellType;
 #endif
     
     CompleteSubspace primitiveGigacageAuxiliarySpace; // Typed arrays, strings, bitvectors, etc go here.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to