Changeset 225701 in webkit
- Timestamp:
- Dec 8, 2017 2:28:31 PM (6 years ago)
- Location:
- trunk/Source/bmalloc
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/bmalloc/ChangeLog
r225558 r225701 1 2017-12-08 Saam Barati <sbarati@apple.com> 2 3 Enable gigacage on iOS with a 32GB runway and ensure it doesn't break WasmBench 4 https://bugs.webkit.org/show_bug.cgi?id=178557 5 6 Reviewed by Mark Lam. 7 8 * bmalloc/Algorithm.h: 9 (bmalloc::isPowerOfTwo): 10 * bmalloc/Gigacage.cpp: 11 * bmalloc/Gigacage.h: 12 1 13 2017-12-05 Andy Estes <aestes@apple.com> 2 14 -
trunk/Source/bmalloc/bmalloc/Algorithm.h
r224537 r225701 64 64 } 65 65 66 inline constexpr bool isPowerOfTwo(size_t size) 66 template <typename T> 67 inline constexpr bool isPowerOfTwo(T size) 67 68 { 69 static_assert(std::is_integral<T>::value, ""); 68 70 return size && !(size & (size - 1)); 69 71 } -
trunk/Source/bmalloc/bmalloc/Gigacage.cpp
r225413 r225701 35 35 #include <mutex> 36 36 37 #if BCPU(ARM64) 38 // FIXME: There is no good reason for ARM64 to be special.39 // https://bugs.webkit.org/show_bug.cgi?id=17760540 #define GIGACAGE_RUNWAY 0 41 #else 37 // This is exactly 32GB because inside JSC, indexed accesses for arrays, typed arrays, etc, 38 // use unsigned 32-bit ints as indices. The items those indices access are 8 bytes or less 39 // in size. 2^32 * 8 = 32GB. This means if an access on a caged type happens to go out of 40 // bounds, the access is guaranteed to land somewhere else in the cage or inside the runway. 41 // If this were less than 32GB, those OOB accesses could reach outside of the cage. 42 42 #define GIGACAGE_RUNWAY (32llu * 1024 * 1024 * 1024) 43 #endif44 43 45 44 char g_gigacageBasePtrs[GIGACAGE_BASE_PTRS_SIZE] __attribute__((aligned(GIGACAGE_BASE_PTRS_SIZE))); -
trunk/Source/bmalloc/bmalloc/Gigacage.h
r225413 r225701 26 26 #pragma once 27 27 28 #include "Algorithm.h" 28 29 #include "BAssert.h" 29 30 #include "BExport.h" … … 34 35 35 36 #if BCPU(ARM64) 36 // FIXME: This can probably be a lot bigger on iOS. I just haven't tried to make it bigger yet. 37 // https://bugs.webkit.org/show_bug.cgi?id=177605 38 #define PRIMITIVE_GIGACAGE_SIZE 0x40000000llu 37 #define PRIMITIVE_GIGACAGE_SIZE 0x80000000llu 39 38 #define JSVALUE_GIGACAGE_SIZE 0x40000000llu 40 39 #define STRING_GIGACAGE_SIZE 0x40000000llu … … 47 46 #endif 48 47 48 static_assert(bmalloc::isPowerOfTwo(PRIMITIVE_GIGACAGE_SIZE), ""); 49 static_assert(bmalloc::isPowerOfTwo(JSVALUE_GIGACAGE_SIZE), ""); 50 static_assert(bmalloc::isPowerOfTwo(STRING_GIGACAGE_SIZE), ""); 51 49 52 #define GIGACAGE_SIZE_TO_MASK(size) ((size) - 1) 50 53 … … 53 56 #define STRING_GIGACAGE_MASK GIGACAGE_SIZE_TO_MASK(STRING_GIGACAGE_SIZE) 54 57 55 // FIXME: Make WasmBench run with gigacage on iOS and re-enable on ARM64: 56 // https://bugs.webkit.org/show_bug.cgi?id=178557 57 #if (BOS(DARWIN) || BOS(LINUX)) && (/* (BCPU(ARM64) && !defined(__ILP32__)) || */ BCPU(X86_64)) 58 #if ((BOS(DARWIN) || BOS(LINUX)) && \ 59 (BCPU(X86_64) || (BCPU(ARM64) && !defined(__ILP32__) && (!BPLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 110300)))) 58 60 #define GIGACAGE_ENABLED 1 59 61 #else
Note: See TracChangeset
for help on using the changeset viewer.