Title: [241038] trunk/Source/_javascript_Core
Revision
241038
Author
ysuz...@apple.com
Date
2019-02-06 11:50:12 -0800 (Wed, 06 Feb 2019)

Log Message

[JSC] Unify indirectEvalExecutableSpace and directEvalExecutableSpace
https://bugs.webkit.org/show_bug.cgi?id=194339

Reviewed by Michael Saboff.

DirectEvalExecutable and IndirectEvalExecutable have completely same memory layout.
They have even the same structure. This patch unifies the subspaces for them.

* runtime/DirectEvalExecutable.h:
* runtime/EvalExecutable.h:
(JSC::EvalExecutable::subspaceFor):
* runtime/IndirectEvalExecutable.h:
* runtime/VM.cpp:
* runtime/VM.h:
(JSC::VM::forEachScriptExecutableSpace):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (241037 => 241038)


--- trunk/Source/_javascript_Core/ChangeLog	2019-02-06 19:49:04 UTC (rev 241037)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-02-06 19:50:12 UTC (rev 241038)
@@ -1,5 +1,23 @@
 2019-02-06  Yusuke Suzuki  <ysuz...@apple.com>
 
+        [JSC] Unify indirectEvalExecutableSpace and directEvalExecutableSpace
+        https://bugs.webkit.org/show_bug.cgi?id=194339
+
+        Reviewed by Michael Saboff.
+
+        DirectEvalExecutable and IndirectEvalExecutable have completely same memory layout.
+        They have even the same structure. This patch unifies the subspaces for them.
+
+        * runtime/DirectEvalExecutable.h:
+        * runtime/EvalExecutable.h:
+        (JSC::EvalExecutable::subspaceFor):
+        * runtime/IndirectEvalExecutable.h:
+        * runtime/VM.cpp:
+        * runtime/VM.h:
+        (JSC::VM::forEachScriptExecutableSpace):
+
+2019-02-06  Yusuke Suzuki  <ysuz...@apple.com>
+
         [JSC] NativeExecutable should be smaller
         https://bugs.webkit.org/show_bug.cgi?id=194331
 

Modified: trunk/Source/_javascript_Core/runtime/DirectEvalExecutable.h (241037 => 241038)


--- trunk/Source/_javascript_Core/runtime/DirectEvalExecutable.h	2019-02-06 19:49:04 UTC (rev 241037)
+++ trunk/Source/_javascript_Core/runtime/DirectEvalExecutable.h	2019-02-06 19:50:12 UTC (rev 241038)
@@ -31,15 +31,11 @@
 
 class DirectEvalExecutable final : public EvalExecutable {
 public:
-    template<typename CellType, SubspaceAccess mode>
-    static IsoSubspace* subspaceFor(VM& vm)
-    {
-        return vm.directEvalExecutableSpace<mode>();
-    }
-
     static DirectEvalExecutable* create(ExecState*, const SourceCode&, bool isInStrictContext, DerivedContextType, bool isArrowFunctionContext, EvalContextType, const VariableEnvironment*);
 private:
     DirectEvalExecutable(ExecState*, const SourceCode&, bool inStrictContext, DerivedContextType, bool isArrowFunctionContext, EvalContextType);
 };
 
+static_assert(sizeof(DirectEvalExecutable) == sizeof(EvalExecutable), "");
+
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/EvalExecutable.h (241037 => 241038)


--- trunk/Source/_javascript_Core/runtime/EvalExecutable.h	2019-02-06 19:49:04 UTC (rev 241037)
+++ trunk/Source/_javascript_Core/runtime/EvalExecutable.h	2019-02-06 19:50:12 UTC (rev 241038)
@@ -54,6 +54,12 @@
         return Structure::create(vm, globalObject, proto, TypeInfo(EvalExecutableType, StructureFlags), info());
     }
 
+    template<typename CellType, SubspaceAccess mode>
+    static IsoSubspace* subspaceFor(VM& vm)
+    {
+        return vm.evalExecutableSpace<mode>();
+    }
+
     DECLARE_INFO;
 
     ExecutableInfo executableInfo() const { return ExecutableInfo(usesEval(), isStrictMode(), false, false, ConstructorKind::None, JSParserScriptMode::Classic, SuperBinding::NotNeeded, SourceParseMode::ProgramMode, derivedContextType(), isArrowFunctionContext(), false, evalContextType()); }

Modified: trunk/Source/_javascript_Core/runtime/IndirectEvalExecutable.h (241037 => 241038)


--- trunk/Source/_javascript_Core/runtime/IndirectEvalExecutable.h	2019-02-06 19:49:04 UTC (rev 241037)
+++ trunk/Source/_javascript_Core/runtime/IndirectEvalExecutable.h	2019-02-06 19:50:12 UTC (rev 241038)
@@ -31,15 +31,11 @@
 
 class IndirectEvalExecutable final : public EvalExecutable {
 public:
-    template<typename CellType, SubspaceAccess mode>
-    static IsoSubspace* subspaceFor(VM& vm)
-    {
-        return vm.indirectEvalExecutableSpace<mode>();
-    }
-
     static IndirectEvalExecutable* create(ExecState*, const SourceCode&, bool isInStrictContext, DerivedContextType, bool isArrowFunctionContext, EvalContextType);
 private:
     IndirectEvalExecutable(ExecState*, const SourceCode&, bool inStrictContext, DerivedContextType, bool isArrowFunctionContext, EvalContextType);
 };
 
+static_assert(sizeof(IndirectEvalExecutable) == sizeof(EvalExecutable), "");
+
 } // namespace JSC

Modified: trunk/Source/_javascript_Core/runtime/VM.cpp (241037 => 241038)


--- trunk/Source/_javascript_Core/runtime/VM.cpp	2019-02-06 19:49:04 UTC (rev 241037)
+++ trunk/Source/_javascript_Core/runtime/VM.cpp	2019-02-06 19:50:12 UTC (rev 241038)
@@ -1261,8 +1261,7 @@
     }
 
 DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER_SLOW(inferredValueSpace, destructibleCellHeapCellType.get(), InferredValue)
-DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER_SLOW(directEvalExecutableSpace, destructibleCellHeapCellType.get(), DirectEvalExecutable)
-DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER_SLOW(indirectEvalExecutableSpace, destructibleCellHeapCellType.get(), IndirectEvalExecutable)
+DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER_SLOW(evalExecutableSpace, destructibleCellHeapCellType.get(), EvalExecutable)
 DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER_SLOW(moduleProgramExecutableSpace, destructibleCellHeapCellType.get(), ModuleProgramExecutable)
 
 #undef DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER_SLOW

Modified: trunk/Source/_javascript_Core/runtime/VM.h (241037 => 241038)


--- trunk/Source/_javascript_Core/runtime/VM.h	2019-02-06 19:49:04 UTC (rev 241037)
+++ trunk/Source/_javascript_Core/runtime/VM.h	2019-02-06 19:50:12 UTC (rev 241038)
@@ -455,8 +455,7 @@
         func(codeBlockSpace);
     }
 
-    DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER(directEvalExecutableSpace)
-    DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER(indirectEvalExecutableSpace)
+    DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER(evalExecutableSpace)
     DYNAMIC_SPACE_AND_SET_DEFINE_MEMBER(moduleProgramExecutableSpace)
     SpaceAndSet functionExecutableSpace;
     SpaceAndSet programExecutableSpace;
@@ -464,11 +463,9 @@
     template<typename Func>
     void forEachScriptExecutableSpace(const Func& func)
     {
-        if (m_directEvalExecutableSpace)
-            func(*m_directEvalExecutableSpace);
+        if (m_evalExecutableSpace)
+            func(*m_evalExecutableSpace);
         func(functionExecutableSpace);
-        if (m_indirectEvalExecutableSpace)
-            func(*m_indirectEvalExecutableSpace);
         if (m_moduleProgramExecutableSpace)
             func(*m_moduleProgramExecutableSpace);
         func(programExecutableSpace);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to