Disable IsoHeaps when Gigacage is off
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2018 01:40:26 +0000 (01:40 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Jun 2018 01:40:26 +0000 (01:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187160

Reviewed by Saam Barati.

If Gigacage is disabled, it may be due to lack of address space.
Therefore we should also turn off IsoHeaps since it uses more virtual
address space as well.

* bmalloc/IsoTLS.cpp:
(bmalloc::IsoTLS::determineMallocFallbackState):

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

Source/bmalloc/ChangeLog
Source/bmalloc/bmalloc/IsoTLS.cpp

index 2038d48..7f6666d 100644 (file)
@@ -1,3 +1,17 @@
+2018-06-28  Michael Saboff  <msaboff@apple.com>
+
+        Disable IsoHeaps when Gigacage is off
+        https://bugs.webkit.org/show_bug.cgi?id=187160
+
+        Reviewed by Saam Barati.
+
+        If Gigacage is disabled, it may be due to lack of address space.
+        Therefore we should also turn off IsoHeaps since it uses more virtual
+        address space as well.
+
+        * bmalloc/IsoTLS.cpp:
+        (bmalloc::IsoTLS::determineMallocFallbackState):
+
 2018-06-27  Simon Fraser  <simon.fraser@apple.com>
 
         https://hackernoon.com/ uses lots of layer backing store
index aca5bf0..2ace1ac 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "DebugHeap.h"
 #include "Environment.h"
+#include "Gigacage.h"
 #include "IsoTLSEntryInlines.h"
 #include "IsoTLSInlines.h"
 #include "IsoTLSLayout.h"
@@ -201,12 +202,21 @@ void IsoTLS::determineMallocFallbackState()
         [] {
             if (s_mallocFallbackState != MallocFallbackState::Undecided)
                 return;
-            
+
+#if GIGACAGE_ENABLED
+            if (!Gigacage::shouldBeEnabled()) {
+                s_mallocFallbackState = MallocFallbackState::FallBackToMalloc;
+                return;
+            }
+
             const char* env = getenv("bmalloc_IsoHeap");
             if (env && (!strcasecmp(env, "false") || !strcasecmp(env, "no") || !strcmp(env, "0")))
                 s_mallocFallbackState = MallocFallbackState::FallBackToMalloc;
             else
                 s_mallocFallbackState = MallocFallbackState::DoNotFallBack;
+#else
+            s_mallocFallbackState = MallocFallbackState::FallBackToMalloc;
+#endif
         });
 }