Title: [263046] trunk
Revision
263046
Author
ca...@igalia.com
Date
2020-06-15 11:35:28 -0700 (Mon, 15 Jun 2020)

Log Message

[JSC] add machinery to disable JIT tiers when experimental features are enabled
https://bugs.webkit.org/show_bug.cgi?id=213193

Reviewed by Mark Lam.

JSTests:

* stress/get-private-name.js:
* stress/put-by-val-direct-addprivate.js:
* stress/put-by-val-direct-putprivate.js:

Source/_javascript_Core:

A new macro FOR_EACH_JSC_EXPERIMENTAL_OPTION() supplies flags indicating the supported
JIT tiers (or, in the future, other options) of a particular feature,
in an easy to understand format. These flags are then used to
recompute dependent feature flags.

This should simplify the incremental development of language features.

* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/OptionsList.h:

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (263045 => 263046)


--- trunk/JSTests/ChangeLog	2020-06-15 18:29:58 UTC (rev 263045)
+++ trunk/JSTests/ChangeLog	2020-06-15 18:35:28 UTC (rev 263046)
@@ -1,3 +1,14 @@
+2020-06-15  Caitlin Potter  <ca...@igalia.com>
+
+        [JSC] add machinery to disable JIT tiers when experimental features are enabled
+        https://bugs.webkit.org/show_bug.cgi?id=213193
+
+        Reviewed by Mark Lam.
+
+        * stress/get-private-name.js:
+        * stress/put-by-val-direct-addprivate.js:
+        * stress/put-by-val-direct-putprivate.js:
+
 2020-06-15  Alexey Shvayka  <shvaikal...@gmail.com>
 
         super should not depend on __proto__

Modified: trunk/JSTests/stress/get-private-name.js (263045 => 263046)


--- trunk/JSTests/stress/get-private-name.js	2020-06-15 18:29:58 UTC (rev 263045)
+++ trunk/JSTests/stress/get-private-name.js	2020-06-15 18:35:28 UTC (rev 263046)
@@ -1,6 +1,4 @@
-// FIXME: //@ requireOptions("--usePrivateClassFields=1") --- Run this in all variants once https://bugs.webkit.org/show_bug.cgi?id=212781 is fixed
-//@ runNoJIT("--usePrivateClassFields=1")
-//@ runNoLLInt("--usePrivateClassFields=1")
+//@ requireOptions("--usePrivateClassFields=1")
 
 // GetPrivateName should throw when the receiver does not have the requested private property
 let i, threw = false;

Modified: trunk/JSTests/stress/put-by-val-direct-addprivate.js (263045 => 263046)


--- trunk/JSTests/stress/put-by-val-direct-addprivate.js	2020-06-15 18:29:58 UTC (rev 263045)
+++ trunk/JSTests/stress/put-by-val-direct-addprivate.js	2020-06-15 18:35:28 UTC (rev 263046)
@@ -1,7 +1,4 @@
-// TODO: //@ requireOptions("--usePrivateClassFields=1") -- Currently, eager JIT is not supported for private field access.
-//@ runDefault("--usePrivateClassFields=1")
-//@ runNoJIT("--usePrivateClassFields=1")
-//@ runNoLLInt("--usePrivateClassFields=1")
+//@ requireOptions("--usePrivateClassFields=1")
 
 // PrivateField "Create" access should throw if writing to a non-existent PrivateName.
 let c, i = 0, threw = false;

Modified: trunk/JSTests/stress/put-by-val-direct-putprivate.js (263045 => 263046)


--- trunk/JSTests/stress/put-by-val-direct-putprivate.js	2020-06-15 18:29:58 UTC (rev 263045)
+++ trunk/JSTests/stress/put-by-val-direct-putprivate.js	2020-06-15 18:35:28 UTC (rev 263046)
@@ -1,7 +1,4 @@
-// FIXME: //@ requireOptions("--usePrivateClassFields=1") -- Currently, eager JIT is not supported for private field access. https://bugs.webkit.org/show_bug.cgi?id=212784
-//@ runDefault("--usePrivateClassFields=1")
-//@ runNoJIT("--usePrivateClassFields=1")
-//@ runNoLLInt("--usePrivateClassFields=1")
+//@ requireOptions("--usePrivateClassFields=1")
 
 // PrivateField "Put" access should throw if writing to a non-existent PrivateName.
 let c, i = 0, threw = false;

Modified: trunk/Source/_javascript_Core/ChangeLog (263045 => 263046)


--- trunk/Source/_javascript_Core/ChangeLog	2020-06-15 18:29:58 UTC (rev 263045)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-06-15 18:35:28 UTC (rev 263046)
@@ -1,3 +1,23 @@
+2020-06-15  Caitlin Potter  <ca...@igalia.com>
+
+        [JSC] add machinery to disable JIT tiers when experimental features are enabled
+        https://bugs.webkit.org/show_bug.cgi?id=213193
+
+        Reviewed by Mark Lam.
+
+        A new macro FOR_EACH_JSC_EXPERIMENTAL_OPTION() supplies flags indicating the supported
+        JIT tiers (or, in the future, other options) of a particular feature,
+        in an easy to understand format. These flags are then used to
+        recompute dependent feature flags.
+
+        This should simplify the incremental development of language features.
+
+        * dfg/DFGCapabilities.cpp:
+        (JSC::DFG::capabilityLevel):
+        * runtime/Options.cpp:
+        (JSC::recomputeDependentOptions):
+        * runtime/OptionsList.h:
+
 2020-06-15  Keith Miller  <keith_mil...@apple.com>
 
         Signal handlers should have a two phase installation.

Modified: trunk/Source/_javascript_Core/dfg/DFGCapabilities.cpp (263045 => 263046)


--- trunk/Source/_javascript_Core/dfg/DFGCapabilities.cpp	2020-06-15 18:29:58 UTC (rev 263045)
+++ trunk/Source/_javascript_Core/dfg/DFGCapabilities.cpp	2020-06-15 18:35:28 UTC (rev 263046)
@@ -291,6 +291,7 @@
     case op_unreachable:
     case op_super_sampler_begin:
     case op_super_sampler_end:
+    case op_get_private_name:
         return CanCompileAndInline;
 
     case op_switch_string: // Don't inline because we don't want to copy string tables in the concurrent JIT.
@@ -299,7 +300,6 @@
 
     case op_yield:
     case op_create_generator_frame_environment:
-    case op_get_private_name: // FIXME: op_get_private_name will need DFG/FTL support to ship class fields. (https://bugs.webkit.org/show_bug.cgi?id=212781)
     case llint_program_prologue:
     case llint_eval_prologue:
     case llint_module_program_prologue:

Modified: trunk/Source/_javascript_Core/runtime/Options.cpp (263045 => 263046)


--- trunk/Source/_javascript_Core/runtime/Options.cpp	2020-06-15 18:29:58 UTC (rev 263045)
+++ trunk/Source/_javascript_Core/runtime/Options.cpp	2020-06-15 18:35:28 UTC (rev 263046)
@@ -514,6 +514,19 @@
         Options::randomIntegrityAuditRate() = 0;
     else if (Options::randomIntegrityAuditRate() > 1.0)
         Options::randomIntegrityAuditRate() = 1.0;
+
+    if (!Options::allowUnsupportedTiers()) {
+#define DISABLE_TIERS(option, flags, ...) do { \
+            if (!Options::option())            \
+                break;                         \
+            if (!(flags & SupportsDFG))        \
+                Options::useDFGJIT() = false;  \
+            if (!(flags & SupportsFTL))        \
+                Options::useFTLJIT() = false;  \
+        } while (false);
+
+        FOR_EACH_JSC_EXPERIMENTAL_OPTION(DISABLE_TIERS);
+    }
 }
 
 inline void* Options::addressOfOption(Options::ID id)

Modified: trunk/Source/_javascript_Core/runtime/OptionsList.h (263045 => 263046)


--- trunk/Source/_javascript_Core/runtime/OptionsList.h	2020-06-15 18:29:58 UTC (rev 263045)
+++ trunk/Source/_javascript_Core/runtime/OptionsList.h	2020-06-15 18:35:28 UTC (rev 263046)
@@ -511,6 +511,7 @@
     v(Bool, usePublicClassFields, true, Normal, "If true, the parser will understand public data fields inside classes.") \
     v(Bool, useRandomizingExecutableIslandAllocation, false, Normal, "For the arm64 ExecutableAllocator, if true, select which region to use randomly. This is useful for testing that jump islands work.") \
     v(Bool, exposeProfilersOnGlobalObject, false, Normal, "If true, we will expose functions to enable/disable both the sampling profiler and the super sampler") \
+    v(Bool, allowUnsupportedTiers, false, Normal, "If true, we will not disable DFG or FTL when an experimental feature is enabled.") \
     v(Bool, usePrivateClassFields, false, Normal, "If true, the parser will understand private data fields inside classes.") \
 
 enum OptionEquivalence {
@@ -553,9 +554,17 @@
     v(maximumFunctionForClosureCallInlineCandidateInstructionCount, maximumFunctionForClosureCallInlineCandidateBytecodeCost, SameOption) \
     v(maximumFunctionForConstructInlineCandidateInstructionCount, maximumFunctionForConstructInlineCandidateBytecoodeCost, SameOption) \
     v(maximumFTLCandidateInstructionCount, maximumFTLCandidateBytecodeCost, SameOption) \
-    v(maximumInliningCallerSize, maximumInliningCallerBytecodeCost, SameOption) \
+    v(maximumInliningCallerSize, maximumInliningCallerBytecodeCost, SameOption)
 
+enum ExperimentalOptionFlags {
+    LLIntAndBaselineOnly = 0,
+    SupportsDFG = 1 << 0,
+    SupportsFTL = 1 << 1,
+};
 
+#define FOR_EACH_JSC_EXPERIMENTAL_OPTION(v) \
+    v(usePrivateClassFields, LLIntAndBaselineOnly, "https://bugs.webkit.org/show_bug.cgi?id=212781", "https://bugs.webkit.org/show_bug.cgi?id=212784")
+
 constexpr size_t countNumberOfJSCOptions()
 {
 #define COUNT_OPTION(type_, name_, defaultValue_, availability_, description_) count++;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to