Increase JSValue cage size on iOS and reduce the max slide
https://bugs.webkit.org/show_bug.cgi?id=199765

Reviewed by Saam Barati.

Since the WebContent jetsam limit has changed we sometimes run out
of JSValue cage VA space causing us to run out of memory for
arrays. This change makes the JSValue cage a more reasonable upper
limit for what should be possible without jetsamming.

The worst case memory mapping with this configuration is has not
changed from before. Under both configurations we could map 36GB
with a temporary mapping of 38GB (to align the VA to 2GB).

* bmalloc/Gigacage.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@247409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/bmalloc/ChangeLog b/Source/bmalloc/ChangeLog
index 0fac1aa..541539f 100644
--- a/Source/bmalloc/ChangeLog
+++ b/Source/bmalloc/ChangeLog
@@ -1,3 +1,21 @@
+2019-07-12  Keith Miller  <keith_miller@apple.com>
+
+        Increase JSValue cage size on iOS and reduce the max slide
+        https://bugs.webkit.org/show_bug.cgi?id=199765
+
+        Reviewed by Saam Barati.
+
+        Since the WebContent jetsam limit has changed we sometimes run out
+        of JSValue cage VA space causing us to run out of memory for
+        arrays. This change makes the JSValue cage a more reasonable upper
+        limit for what should be possible without jetsamming.
+
+        The worst case memory mapping with this configuration is has not
+        changed from before. Under both configurations we could map 36GB
+        with a temporary mapping of 38GB (to align the VA to 2GB).
+
+        * bmalloc/Gigacage.h:
+
 2019-07-03  Keith Miller  <keith_miller@apple.com>
 
         PACCage should first cage leaving PAC bits intact then authenticate
diff --git a/Source/bmalloc/bmalloc/Gigacage.h b/Source/bmalloc/bmalloc/Gigacage.h
index a37d0ba..c730493 100644
--- a/Source/bmalloc/bmalloc/Gigacage.h
+++ b/Source/bmalloc/bmalloc/Gigacage.h
@@ -68,9 +68,9 @@
 
 #if BCPU(ARM64)
 constexpr size_t primitiveGigacageSize = 2 * bmalloc::Sizes::GB;
-constexpr size_t jsValueGigacageSize = 1 * bmalloc::Sizes::GB;
+constexpr size_t jsValueGigacageSize = 2 * bmalloc::Sizes::GB;
 constexpr size_t gigacageBasePtrsSize = 16 * bmalloc::Sizes::kB;
-constexpr size_t maximumCageSizeReductionForSlide = bmalloc::Sizes::GB / 2;
+constexpr size_t maximumCageSizeReductionForSlide = bmalloc::Sizes::GB / 4;
 #define GIGACAGE_ALLOCATION_CAN_FAIL 1
 #else
 constexpr size_t primitiveGigacageSize = 32 * bmalloc::Sizes::GB;