The jsc shell should allow disabling of the Gigacage for testing purposes.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 Sep 2019 14:53:21 +0000 (14:53 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 Sep 2019 14:53:21 +0000 (14:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=201579

Reviewed by Michael Saboff.

JSTests:

Unskip the tests now.

* stress/disable-gigacage-arrays.js:
* stress/disable-gigacage-strings.js:
* stress/disable-gigacage-typed-arrays.js:

Source/JavaScriptCore:

Check for the same GIGACAGE_ENABLED env var that is checked by Gigacage code.  If
this env var is present and it has a falsy value, then do not
forbidDisablingPrimitiveGigacage() in the jsc shell.

* jsc.cpp:
(jscmain):

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

JSTests/ChangeLog
JSTests/stress/disable-gigacage-arrays.js
JSTests/stress/disable-gigacage-strings.js
JSTests/stress/disable-gigacage-typed-arrays.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/jsc.cpp

index 8fa8b84..e2afdde 100644 (file)
@@ -1,5 +1,18 @@
 2019-09-07  Mark Lam  <mark.lam@apple.com>
 
+        The jsc shell should allow disabling of the Gigacage for testing purposes.
+        https://bugs.webkit.org/show_bug.cgi?id=201579
+
+        Reviewed by Michael Saboff.
+
+        Unskip the tests now.
+
+        * stress/disable-gigacage-arrays.js:
+        * stress/disable-gigacage-strings.js:
+        * stress/disable-gigacage-typed-arrays.js:
+
+2019-09-07  Mark Lam  <mark.lam@apple.com>
+
         Gardening: temporarily skipping these tests until the fix can be reviewed and landed.
 
         Not reviewed.
index 6fb9dc5..212fb1e 100644 (file)
@@ -1,5 +1,4 @@
-//@ skip
-// temporarily disable, previous options: runNoisyTestWithEnv "disable-gigacage", "GIGACAGE_ENABLED=0"
+//@ runNoisyTestWithEnv "disable-gigacage", "GIGACAGE_ENABLED=0"
 
 (function() {
     function foo(array, i)
index d0bbdf1..761d067 100644 (file)
@@ -1,5 +1,4 @@
-//@ skip
-// temporarily disable, previous options: runNoisyTestWithEnv "disable-gigacage", "GIGACAGE_ENABLED=0"
+//@ runNoisyTestWithEnv "disable-gigacage", "GIGACAGE_ENABLED=0"
 
 (function() {
     function foo(array, i)
index 6d880fb..3663c1e 100644 (file)
@@ -1,5 +1,4 @@
-//@ skip
-// temporarily disable, previous options: runNoisyTestWithEnv "disable-gigacage", "GIGACAGE_ENABLED=0"
+//@ runNoisyTestWithEnv "disable-gigacage", "GIGACAGE_ENABLED=0"
 
 (function() {
     function foo(array, i)
index 81ab0ab..31b9fe5 100644 (file)
@@ -1,3 +1,17 @@
+2019-09-07  Mark Lam  <mark.lam@apple.com>
+
+        The jsc shell should allow disabling of the Gigacage for testing purposes.
+        https://bugs.webkit.org/show_bug.cgi?id=201579
+
+        Reviewed by Michael Saboff.
+
+        Check for the same GIGACAGE_ENABLED env var that is checked by Gigacage code.  If
+        this env var is present and it has a falsy value, then do not
+        forbidDisablingPrimitiveGigacage() in the jsc shell.
+
+        * jsc.cpp:
+        (jscmain):
+
 2019-09-06  Mark Lam  <mark.lam@apple.com>
 
         Harden protection of the Gigacage Config parameters.
index 3f18546..6c9c476 100644 (file)
@@ -3086,7 +3086,16 @@ int jscmain(int argc, char** argv)
 #if ENABLE(WEBASSEMBLY)
     JSC::Wasm::enableFastMemory();
 #endif
-    Gigacage::forbidDisablingPrimitiveGigacage();
+
+    bool gigacageDisableRequested = false;
+#if GIGACAGE_ENABLED && !COMPILER(MSVC)
+    if (char* gigacageEnabled = getenv("GIGACAGE_ENABLED")) {
+        if (!strcasecmp(gigacageEnabled, "no") || !strcasecmp(gigacageEnabled, "false") || !strcasecmp(gigacageEnabled, "0"))
+            gigacageDisableRequested = true;
+    }
+#endif
+    if (!gigacageDisableRequested)
+        Gigacage::forbidDisablingPrimitiveGigacage();
 
 #if PLATFORM(COCOA)
     auto& memoryPressureHandler = MemoryPressureHandler::singleton();