Title: [240888] trunk/Source/_javascript_Core
Revision
240888
Author
ysuz...@apple.com
Date
2019-02-01 16:24:47 -0800 (Fri, 01 Feb 2019)

Log Message

[JSC] Remove some of IsoSubspaces for JSFunction subclasses
https://bugs.webkit.org/show_bug.cgi?id=194177

Reviewed by Saam Barati.

JSGeneratorFunction, JSAsyncFunction, and JSAsyncGeneratorFunction do not add any fields / classInfo methods.
We can share the IsoSubspace for JSFunction.

* runtime/JSAsyncFunction.h:
* runtime/JSAsyncGeneratorFunction.h:
* runtime/JSGeneratorFunction.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (240887 => 240888)


--- trunk/Source/_javascript_Core/ChangeLog	2019-02-01 23:59:56 UTC (rev 240887)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-02-02 00:24:47 UTC (rev 240888)
@@ -1,3 +1,20 @@
+2019-02-01  Yusuke Suzuki  <ysuz...@apple.com>
+
+        [JSC] Remove some of IsoSubspaces for JSFunction subclasses
+        https://bugs.webkit.org/show_bug.cgi?id=194177
+
+        Reviewed by Saam Barati.
+
+        JSGeneratorFunction, JSAsyncFunction, and JSAsyncGeneratorFunction do not add any fields / classInfo methods.
+        We can share the IsoSubspace for JSFunction.
+
+        * runtime/JSAsyncFunction.h:
+        * runtime/JSAsyncGeneratorFunction.h:
+        * runtime/JSGeneratorFunction.h:
+        * runtime/VM.cpp:
+        (JSC::VM::VM):
+        * runtime/VM.h:
+
 2019-02-01  Mark Lam  <mark....@apple.com>
 
         Remove invalid assertion in DFG's compileDoubleRep().

Modified: trunk/Source/_javascript_Core/runtime/JSAsyncFunction.h (240887 => 240888)


--- trunk/Source/_javascript_Core/runtime/JSAsyncFunction.h	2019-02-01 23:59:56 UTC (rev 240887)
+++ trunk/Source/_javascript_Core/runtime/JSAsyncFunction.h	2019-02-02 00:24:47 UTC (rev 240888)
@@ -41,7 +41,7 @@
     template<typename CellType>
     static IsoSubspace* subspaceFor(VM& vm)
     {
-        return &vm.asyncFunctionSpace;
+        return &vm.functionSpace;
     }
 
     DECLARE_EXPORT_INFO;
@@ -67,5 +67,6 @@
 
     static JSAsyncFunction* createImpl(VM&, FunctionExecutable*, JSScope*, Structure*);
 };
+static_assert(sizeof(JSAsyncFunction) == sizeof(JSFunction), "Some subclasses of JSFunction should be the same size to share IsoSubspace");
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/JSAsyncGeneratorFunction.h (240887 => 240888)


--- trunk/Source/_javascript_Core/runtime/JSAsyncGeneratorFunction.h	2019-02-01 23:59:56 UTC (rev 240887)
+++ trunk/Source/_javascript_Core/runtime/JSAsyncGeneratorFunction.h	2019-02-02 00:24:47 UTC (rev 240888)
@@ -41,7 +41,7 @@
     template<typename CellType>
     static IsoSubspace* subspaceFor(VM& vm)
     {
-        return &vm.asyncGeneratorFunctionSpace;
+        return &vm.functionSpace;
     }
 
     DECLARE_EXPORT_INFO;
@@ -80,5 +80,6 @@
 
     static JSAsyncGeneratorFunction* createImpl(VM&, FunctionExecutable*, JSScope*, Structure*);
 };
+static_assert(sizeof(JSAsyncGeneratorFunction) == sizeof(JSFunction), "Some subclasses of JSFunction should be the same size to share IsoSubspace");
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/JSGeneratorFunction.h (240887 => 240888)


--- trunk/Source/_javascript_Core/runtime/JSGeneratorFunction.h	2019-02-01 23:59:56 UTC (rev 240887)
+++ trunk/Source/_javascript_Core/runtime/JSGeneratorFunction.h	2019-02-02 00:24:47 UTC (rev 240888)
@@ -69,7 +69,7 @@
     template<typename CellType>
     static IsoSubspace* subspaceFor(VM& vm)
     {
-        return &vm.generatorFunctionSpace;
+        return &vm.functionSpace;
     }
 
     DECLARE_EXPORT_INFO;
@@ -97,5 +97,6 @@
 
     friend class LLIntOffsetsExtractor;
 };
+static_assert(sizeof(JSGeneratorFunction) == sizeof(JSFunction), "Some subclasses of JSFunction should be the same size to share IsoSubspace");
 
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/VM.cpp (240887 => 240888)


--- trunk/Source/_javascript_Core/runtime/VM.cpp	2019-02-01 23:59:56 UTC (rev 240887)
+++ trunk/Source/_javascript_Core/runtime/VM.cpp	2019-02-02 00:24:47 UTC (rev 240888)
@@ -287,14 +287,11 @@
     , destructibleObjectSpace("JSDestructibleObject", heap, destructibleObjectHeapCellType.get(), fastMallocAllocator.get())
     , eagerlySweptDestructibleObjectSpace("Eagerly Swept JSDestructibleObject", heap, destructibleObjectHeapCellType.get(), fastMallocAllocator.get())
     , segmentedVariableObjectSpace("JSSegmentedVariableObjectSpace", heap, segmentedVariableObjectHeapCellType.get(), fastMallocAllocator.get())
-    , asyncFunctionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSAsyncFunction)
-    , asyncGeneratorFunctionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSAsyncGeneratorFunction)
     , boundFunctionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSBoundFunction)
     , callbackFunctionSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), JSCallbackFunction)
     , customGetterSetterFunctionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSCustomGetterSetterFunction)
     , executableToCodeBlockEdgeSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), ExecutableToCodeBlockEdge)
     , functionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSFunction)
-    , generatorFunctionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSGeneratorFunction)
     , inferredValueSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), InferredValue)
     , internalFunctionSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), InternalFunction)
     , nativeExecutableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), NativeExecutable)

Modified: trunk/Source/_javascript_Core/runtime/VM.h (240887 => 240888)


--- trunk/Source/_javascript_Core/runtime/VM.h	2019-02-01 23:59:56 UTC (rev 240887)
+++ trunk/Source/_javascript_Core/runtime/VM.h	2019-02-02 00:24:47 UTC (rev 240888)
@@ -366,14 +366,11 @@
     CompleteSubspace eagerlySweptDestructibleObjectSpace;
     CompleteSubspace segmentedVariableObjectSpace;
     
-    IsoSubspace asyncFunctionSpace;
-    IsoSubspace asyncGeneratorFunctionSpace;
     IsoSubspace boundFunctionSpace;
     IsoSubspace callbackFunctionSpace;
     IsoSubspace customGetterSetterFunctionSpace;
     IsoSubspace executableToCodeBlockEdgeSpace;
     IsoSubspace functionSpace;
-    IsoSubspace generatorFunctionSpace;
     IsoSubspace inferredValueSpace;
     IsoSubspace internalFunctionSpace;
     IsoSubspace nativeExecutableSpace;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to