Title: [225920] tags/Safari-605.1.17.2/Source/bmalloc

Diff

Modified: tags/Safari-605.1.17.2/Source/bmalloc/ChangeLog (225919 => 225920)


--- tags/Safari-605.1.17.2/Source/bmalloc/ChangeLog	2017-12-14 20:11:50 UTC (rev 225919)
+++ tags/Safari-605.1.17.2/Source/bmalloc/ChangeLog	2017-12-14 20:13:16 UTC (rev 225920)
@@ -1,3 +1,7 @@
+2017-12-14  Jason Marcell  <jmarc...@apple.com>
+
+        Revert r225701. rdar://problem/35262662
+
 2017-12-08  Saam Barati  <sbar...@apple.com>
 
         Enable gigacage on iOS with a 32GB runway and ensure it doesn't break WasmBench

Modified: tags/Safari-605.1.17.2/Source/bmalloc/bmalloc/Algorithm.h (225919 => 225920)


--- tags/Safari-605.1.17.2/Source/bmalloc/bmalloc/Algorithm.h	2017-12-14 20:11:50 UTC (rev 225919)
+++ tags/Safari-605.1.17.2/Source/bmalloc/bmalloc/Algorithm.h	2017-12-14 20:13:16 UTC (rev 225920)
@@ -63,10 +63,8 @@
     return !!(reinterpret_cast<uintptr_t>(value) & mask);
 }
 
-template <typename T>
-inline constexpr bool isPowerOfTwo(T size)
+inline constexpr bool isPowerOfTwo(size_t size)
 {
-    static_assert(std::is_integral<T>::value, "");
     return size && !(size & (size - 1));
 }
 

Modified: tags/Safari-605.1.17.2/Source/bmalloc/bmalloc/Gigacage.cpp (225919 => 225920)


--- tags/Safari-605.1.17.2/Source/bmalloc/bmalloc/Gigacage.cpp	2017-12-14 20:11:50 UTC (rev 225919)
+++ tags/Safari-605.1.17.2/Source/bmalloc/bmalloc/Gigacage.cpp	2017-12-14 20:13:16 UTC (rev 225920)
@@ -34,12 +34,13 @@
 #include <cstdio>
 #include <mutex>
 
-// This is exactly 32GB because inside JSC, indexed accesses for arrays, typed arrays, etc,
-// use unsigned 32-bit ints as indices. The items those indices access are 8 bytes or less
-// in size. 2^32 * 8 = 32GB. This means if an access on a caged type happens to go out of
-// bounds, the access is guaranteed to land somewhere else in the cage or inside the runway.
-// If this were less than 32GB, those OOB accesses could reach outside of the cage.
+#if BCPU(ARM64)
+// FIXME: There is no good reason for ARM64 to be special.
+// https://bugs.webkit.org/show_bug.cgi?id=177605
+#define GIGACAGE_RUNWAY 0
+#else
 #define GIGACAGE_RUNWAY (32llu * 1024 * 1024 * 1024)
+#endif
 
 char g_gigacageBasePtrs[GIGACAGE_BASE_PTRS_SIZE] __attribute__((aligned(GIGACAGE_BASE_PTRS_SIZE)));
 

Modified: tags/Safari-605.1.17.2/Source/bmalloc/bmalloc/Gigacage.h (225919 => 225920)


--- tags/Safari-605.1.17.2/Source/bmalloc/bmalloc/Gigacage.h	2017-12-14 20:11:50 UTC (rev 225919)
+++ tags/Safari-605.1.17.2/Source/bmalloc/bmalloc/Gigacage.h	2017-12-14 20:13:16 UTC (rev 225920)
@@ -25,7 +25,6 @@
 
 #pragma once
 
-#include "Algorithm.h"
 #include "BAssert.h"
 #include "BExport.h"
 #include "BInline.h"
@@ -34,7 +33,9 @@
 #include <inttypes.h>
 
 #if BCPU(ARM64)
-#define PRIMITIVE_GIGACAGE_SIZE 0x80000000llu
+// FIXME: This can probably be a lot bigger on iOS. I just haven't tried to make it bigger yet.
+// https://bugs.webkit.org/show_bug.cgi?id=177605
+#define PRIMITIVE_GIGACAGE_SIZE 0x40000000llu
 #define JSVALUE_GIGACAGE_SIZE 0x40000000llu
 #define STRING_GIGACAGE_SIZE 0x40000000llu
 #define GIGACAGE_ALLOCATION_CAN_FAIL 1
@@ -45,10 +46,6 @@
 #define GIGACAGE_ALLOCATION_CAN_FAIL 0
 #endif
 
-static_assert(bmalloc::isPowerOfTwo(PRIMITIVE_GIGACAGE_SIZE), "");
-static_assert(bmalloc::isPowerOfTwo(JSVALUE_GIGACAGE_SIZE), "");
-static_assert(bmalloc::isPowerOfTwo(STRING_GIGACAGE_SIZE), "");
-
 #define GIGACAGE_SIZE_TO_MASK(size) ((size) - 1)
 
 #define PRIMITIVE_GIGACAGE_MASK GIGACAGE_SIZE_TO_MASK(PRIMITIVE_GIGACAGE_SIZE)
@@ -55,8 +52,9 @@
 #define JSVALUE_GIGACAGE_MASK GIGACAGE_SIZE_TO_MASK(JSVALUE_GIGACAGE_SIZE)
 #define STRING_GIGACAGE_MASK GIGACAGE_SIZE_TO_MASK(STRING_GIGACAGE_SIZE)
 
-#if ((BOS(DARWIN) || BOS(LINUX)) && \
-    (BCPU(X86_64) || (BCPU(ARM64) && !defined(__ILP32__) && (!BPLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 110300))))
+// FIXME: Make WasmBench run with gigacage on iOS and re-enable on ARM64:
+// https://bugs.webkit.org/show_bug.cgi?id=178557
+#if (BOS(DARWIN) || BOS(LINUX)) && (/* (BCPU(ARM64) && !defined(__ILP32__))  || */ BCPU(X86_64))
 #define GIGACAGE_ENABLED 1
 #else
 #define GIGACAGE_ENABLED 0
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to