[JSC] Put DebuggerScope in IsoSubspace
authorysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Dec 2019 23:02:06 +0000 (23:02 +0000)
committerysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Dec 2019 23:02:06 +0000 (23:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=205303

Reviewed by Mark Lam.

Put DebuggerScope in IsoSubspace, and refine empty `subspaceFor` implementations.

* bytecode/CodeBlock.h:
(JSC::CodeBlock::subspaceFor):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::subspaceFor):
* debugger/DebuggerScope.h:
* runtime/AbstractModuleRecord.h:
(JSC::AbstractModuleRecord::subspaceFor):
* runtime/JSArrayBufferView.h:
(JSC::JSArrayBufferView::subspaceFor):
* runtime/JSInternalFieldObjectImpl.h:
(JSC::JSInternalFieldObjectImpl::subspaceFor):
* runtime/JSWrapperObject.h:
(JSC::JSWrapperObject::subspaceFor):
* runtime/VM.cpp:
* runtime/VM.h:

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/CodeBlock.h
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
Source/JavaScriptCore/debugger/DebuggerScope.h
Source/JavaScriptCore/runtime/AbstractModuleRecord.h
Source/JavaScriptCore/runtime/JSArrayBufferView.h
Source/JavaScriptCore/runtime/JSInternalFieldObjectImpl.h
Source/JavaScriptCore/runtime/JSWrapperObject.h
Source/JavaScriptCore/runtime/VM.cpp
Source/JavaScriptCore/runtime/VM.h

index 61a01a0..1fa72f6 100644 (file)
@@ -1,5 +1,30 @@
 2019-12-16  Yusuke Suzuki  <ysuzuki@apple.com>
 
+        [JSC] Put DebuggerScope in IsoSubspace
+        https://bugs.webkit.org/show_bug.cgi?id=205303
+
+        Reviewed by Mark Lam.
+
+        Put DebuggerScope in IsoSubspace, and refine empty `subspaceFor` implementations.
+
+        * bytecode/CodeBlock.h:
+        (JSC::CodeBlock::subspaceFor):
+        * bytecode/UnlinkedCodeBlock.h:
+        (JSC::UnlinkedCodeBlock::subspaceFor):
+        * debugger/DebuggerScope.h:
+        * runtime/AbstractModuleRecord.h:
+        (JSC::AbstractModuleRecord::subspaceFor):
+        * runtime/JSArrayBufferView.h:
+        (JSC::JSArrayBufferView::subspaceFor):
+        * runtime/JSInternalFieldObjectImpl.h:
+        (JSC::JSInternalFieldObjectImpl::subspaceFor):
+        * runtime/JSWrapperObject.h:
+        (JSC::JSWrapperObject::subspaceFor):
+        * runtime/VM.cpp:
+        * runtime/VM.h:
+
+2019-12-16  Yusuke Suzuki  <ysuzuki@apple.com>
+
         [JSC] Move JSCell::subspaceFor to JSObject::subspaceFor, removing destructibleCellSpace
         https://bugs.webkit.org/show_bug.cgi?id=205300
 
index 092c7aa..146742e 100644 (file)
@@ -116,7 +116,10 @@ public:
     static constexpr bool needsDestruction = true;
 
     template<typename, SubspaceAccess>
-    static IsoSubspace* subspaceFor(VM&) { return nullptr; }
+    static void subspaceFor(VM&)
+    {
+        RELEASE_ASSERT_NOT_REACHED();
+    }
     // GC strongly assumes CodeBlock is not a PreciseAllocation for now.
     static constexpr uint8_t numberOfLowerTierCells = 0;
 
index a4fa7e0..ad1f90b 100644 (file)
@@ -113,10 +113,9 @@ public:
     static constexpr bool needsDestruction = true;
 
     template<typename, SubspaceAccess>
-    static IsoSubspace* subspaceFor(VM&)
+    static void subspaceFor(VM&)
     {
-        ASSERT_NOT_REACHED();
-        return nullptr;
+        RELEASE_ASSERT_NOT_REACHED();
     }
 
     enum { CallFunction, ApplyFunction };
index 27ea0c6..ff4ce1b 100644 (file)
@@ -35,9 +35,15 @@ class JSScope;
 
 class DebuggerScope final : public JSNonFinalObject {
 public:
-    typedef JSNonFinalObject Base;
+    using Base = JSNonFinalObject;
     static constexpr unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | OverridesGetPropertyNames;
 
+    template<typename CellType, SubspaceAccess mode>
+    static IsoSubspace* subspaceFor(VM& vm)
+    {
+        return vm.debuggerScopeSpace<mode>();
+    }
+
     JS_EXPORT_PRIVATE static DebuggerScope* create(VM& vm, JSScope* scope);
 
     static void visitChildren(JSCell*, SlotVisitor&);
index 519dcd6..ae05941 100644 (file)
@@ -45,10 +45,9 @@ public:
     static constexpr bool needsDestruction = true;
 
     template<typename CellType, SubspaceAccess>
-    static IsoSubspace* subspaceFor(VM&)
+    static void subspaceFor(VM&)
     {
         RELEASE_ASSERT_NOT_REACHED();
-        return nullptr;
     }
 
     // https://tc39.github.io/ecma262/#sec-source-text-module-records
index 8b6fdf0..9c12138 100644 (file)
@@ -98,10 +98,9 @@ public:
     using Base = JSNonFinalObject;
 
     template<typename, SubspaceAccess>
-    static IsoSubspace* subspaceFor(VM&)
+    static void subspaceFor(VM&)
     {
         RELEASE_ASSERT_NOT_REACHED();
-        return nullptr;
     }
 
     static constexpr unsigned fastSizeLimit = 1000;
index d48d1df..e257a1d 100644 (file)
@@ -38,6 +38,12 @@ public:
     using Base = JSNonFinalObject;
     static constexpr unsigned numberOfInternalFields = passedNumberOfInternalFields;
 
+    template<typename CellType, SubspaceAccess>
+    static void subspaceFor(VM&)
+    {
+        RELEASE_ASSERT_NOT_REACHED();
+    }
+
     static size_t allocationSize(Checked<size_t> inlineCapacity)
     {
         ASSERT_UNUSED(inlineCapacity, !inlineCapacity);
index d7a8875..a682f81 100644 (file)
@@ -32,10 +32,9 @@ public:
     using Base = JSNonFinalObject;
 
     template<typename, SubspaceAccess>
-    static IsoSubspace* subspaceFor(VM&)
+    static void subspaceFor(VM&)
     {
         RELEASE_ASSERT_NOT_REACHED();
-        return nullptr;
     }
 
     static size_t allocationSize(Checked<size_t> inlineCapacity)
index 112409c..b23dc72 100644 (file)
@@ -43,6 +43,7 @@
 #include "DFGWorklist.h"
 #include "DOMAttributeGetterSetter.h"
 #include "DateInstance.h"
+#include "DebuggerScope.h"
 #include "DirectEvalExecutable.h"
 #include "Disassembler.h"
 #include "DoublePredictionFuzzerAgent.h"
@@ -1395,6 +1396,7 @@ DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(callbackFunctionSpace, cellHeapCellType.
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(callbackObjectSpace, callbackObjectHeapCellType.get(), JSCallbackObject<JSNonFinalObject>)
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(customGetterSetterFunctionSpace, cellHeapCellType.get(), JSCustomGetterSetterFunction) // Hash:0x18091000
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(dataViewSpace, cellHeapCellType.get(), JSDataView)
+DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(debuggerScopeSpace, cellHeapCellType.get(), DebuggerScope)
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(errorInstanceSpace, errorInstanceHeapCellType.get(), ErrorInstance) // Hash:0x3f40d4a
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(float32ArraySpace, cellHeapCellType.get(), JSFloat32Array)
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(float64ArraySpace, cellHeapCellType.get(), JSFloat64Array)
index 7901df6..005916f 100644 (file)
@@ -500,6 +500,7 @@ public:
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(callbackObjectSpace)
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(customGetterSetterFunctionSpace)
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(dataViewSpace)
+    DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(debuggerScopeSpace)
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(errorInstanceSpace)
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(float32ArraySpace)
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(float64ArraySpace)