[JSC] Put non-dynamic scope cells in IsoSubspace
authorysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Dec 2019 00:31:52 +0000 (00:31 +0000)
committerysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Dec 2019 00:31:52 +0000 (00:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=205311

Reviewed by Mark Lam.

Put non-dynamic scope cells in IsoSubspace.

    - JSWithScope
    - StrictEvalActivation

* runtime/JSScope.h:
(JSC::JSScope::subspaceFor):
* runtime/JSSymbolTableObject.h:
* runtime/JSWithScope.h:
* runtime/StrictEvalActivation.h:
* runtime/VM.cpp:
* runtime/VM.h:

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSScope.h
Source/JavaScriptCore/runtime/JSSymbolTableObject.h
Source/JavaScriptCore/runtime/JSWithScope.h
Source/JavaScriptCore/runtime/StrictEvalActivation.h
Source/JavaScriptCore/runtime/VM.cpp
Source/JavaScriptCore/runtime/VM.h

index 1fa72f6..086d1fc 100644 (file)
@@ -1,5 +1,25 @@
 2019-12-16  Yusuke Suzuki  <ysuzuki@apple.com>
 
+        [JSC] Put non-dynamic scope cells in IsoSubspace
+        https://bugs.webkit.org/show_bug.cgi?id=205311
+
+        Reviewed by Mark Lam.
+
+        Put non-dynamic scope cells in IsoSubspace.
+
+            - JSWithScope
+            - StrictEvalActivation
+
+        * runtime/JSScope.h:
+        (JSC::JSScope::subspaceFor):
+        * runtime/JSSymbolTableObject.h:
+        * runtime/JSWithScope.h:
+        * runtime/StrictEvalActivation.h:
+        * runtime/VM.cpp:
+        * runtime/VM.h:
+
+2019-12-16  Yusuke Suzuki  <ysuzuki@apple.com>
+
         [JSC] Put DebuggerScope in IsoSubspace
         https://bugs.webkit.org/show_bug.cgi?id=205303
 
index a799f55..ac86c2f 100644 (file)
@@ -40,6 +40,12 @@ public:
     using Base = JSNonFinalObject;
     static constexpr unsigned StructureFlags = Base::StructureFlags | OverridesToThis;
 
+    template<typename, SubspaceAccess>
+    static void subspaceFor(VM&)
+    {
+        RELEASE_ASSERT_NOT_REACHED();
+    }
+
     DECLARE_EXPORT_INFO;
 
     friend class LLIntOffsetsExtractor;
index 9b70c93..c7c1e20 100644 (file)
@@ -38,9 +38,9 @@ namespace JSC {
 
 class JSSymbolTableObject : public JSScope {
 public:
-    typedef JSScope Base;
+    using Base = JSScope;
     static constexpr unsigned StructureFlags = Base::StructureFlags | OverridesGetPropertyNames;
-    
+
     SymbolTable* symbolTable() const { return m_symbolTable.get(); }
     
     JS_EXPORT_PRIVATE static bool deleteProperty(JSCell*, JSGlobalObject*, PropertyName);
index 1d6d5ea..e2db681 100644 (file)
@@ -33,6 +33,12 @@ class JSWithScope final : public JSScope {
 public:
     using Base = JSScope;
 
+    template<typename CellType, SubspaceAccess mode>
+    static IsoSubspace* subspaceFor(VM& vm)
+    {
+        return vm.withScopeSpace<mode>();
+    }
+
     JS_EXPORT_PRIVATE static JSWithScope* create(VM&, JSGlobalObject*, JSScope* next, JSObject*);
 
     JSObject* object() { return m_object.get(); }
index 8618698..cdcc21b 100644 (file)
@@ -33,6 +33,12 @@ class StrictEvalActivation final : public JSScope {
 public:
     using Base = JSScope;
 
+    template<typename CellType, SubspaceAccess mode>
+    static IsoSubspace* subspaceFor(VM& vm)
+    {
+        return vm.strictEvalActivationSpace<mode>();
+    }
+
     static StrictEvalActivation* create(VM& vm, Structure* structure, JSScope* currentScope)
     {
         StrictEvalActivation* scope = new (NotNull, allocateCell<StrictEvalActivation>(vm.heap)) StrictEvalActivation(vm, structure, currentScope);
index b23dc72..64ddfcb 100644 (file)
@@ -1420,6 +1420,7 @@ DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(scriptFetcherSpace, destructibleCellHeap
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(setBucketSpace, cellHeapCellType.get(), JSSet::BucketType)
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(setIteratorSpace, cellHeapCellType.get(), JSSetIterator)
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(setSpace, cellHeapCellType.get(), JSSet)
+DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(strictEvalActivationSpace, cellHeapCellType.get(), StrictEvalActivation)
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(sourceCodeSpace, destructibleCellHeapCellType.get(), JSSourceCode)
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(symbolSpace, destructibleCellHeapCellType.get(), Symbol)
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(symbolObjectSpace, cellHeapCellType.get(), SymbolObject)
@@ -1435,6 +1436,7 @@ DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(unlinkedProgramCodeBlockSpace, destructi
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakMapSpace, weakMapHeapCellType.get(), JSWeakMap) // Hash:0x662b12a3
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakSetSpace, weakSetHeapCellType.get(), JSWeakSet) // Hash:0x4c781b30
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakObjectRefSpace, cellHeapCellType.get(), JSWeakObjectRef) // Hash:0x8ec68f1f
+DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(withScopeSpace, cellHeapCellType.get(), JSWithScope)
 #if JSC_OBJC_API_ENABLED
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(apiWrapperObjectSpace, apiWrapperObjectHeapCellType.get(), JSCallbackObject<JSAPIWrapperObject>)
 DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(objCCallbackFunctionSpace, objCCallbackFunctionHeapCellType.get(), ObjCCallbackFunction) // Hash:0x10f610b8
index 005916f..28086c4 100644 (file)
@@ -524,6 +524,7 @@ public:
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(setBucketSpace)
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(setIteratorSpace)
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(setSpace)
+    DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(strictEvalActivationSpace)
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(sourceCodeSpace)
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(symbolSpace)
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(symbolObjectSpace)
@@ -539,6 +540,7 @@ public:
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(weakObjectRefSpace)
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(weakSetSpace)
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(weakMapSpace)
+    DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(withScopeSpace)
 #if ENABLE(INTL)
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(intlCollatorSpace)
     DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(intlDateTimeFormatSpace)