Title: [270052] trunk/Source
Revision
270052
Author
[email protected]
Date
2020-11-19 15:08:56 -0800 (Thu, 19 Nov 2020)

Log Message

Use os_thread_self_restrict_rwx_is_supported instead of pthread_jit_write_protect_supported_np on Apple Internal SDK builds
https://bugs.webkit.org/show_bug.cgi?id=219099
<rdar://problem/71547048>

Reviewed by Mark Lam.

Source/_javascript_Core:

* assembler/FastJITPermissions.h:
(useFastJITPermissions):
(threadSelfRestrictRWXToRW):
(threadSelfRestrictRWXToRX):

Source/WTF:

* wtf/PlatformHave.h:
* wtf/PlatformUse.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (270051 => 270052)


--- trunk/Source/_javascript_Core/ChangeLog	2020-11-19 22:11:45 UTC (rev 270051)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-11-19 23:08:56 UTC (rev 270052)
@@ -1,3 +1,16 @@
+2020-11-19  Saam Barati  <[email protected]>
+
+        Use os_thread_self_restrict_rwx_is_supported instead of pthread_jit_write_protect_supported_np on Apple Internal SDK builds
+        https://bugs.webkit.org/show_bug.cgi?id=219099
+        <rdar://problem/71547048>
+
+        Reviewed by Mark Lam.
+
+        * assembler/FastJITPermissions.h:
+        (useFastJITPermissions):
+        (threadSelfRestrictRWXToRW):
+        (threadSelfRestrictRWXToRX):
+
 2020-11-19  Xan López  <[email protected]>
 
         [JSC] Add support for static private class fields

Modified: trunk/Source/_javascript_Core/assembler/FastJITPermissions.h (270051 => 270052)


--- trunk/Source/_javascript_Core/assembler/FastJITPermissions.h	2020-11-19 22:11:45 UTC (rev 270051)
+++ trunk/Source/_javascript_Core/assembler/FastJITPermissions.h	2020-11-19 23:08:56 UTC (rev 270052)
@@ -29,7 +29,7 @@
 
 #include <wtf/Platform.h>
 
-#if HAVE(PTHREAD_JIT_PERMISSIONS_API)
+#if USE(PTHREAD_JIT_PERMISSIONS_API)
 #include <pthread.h>
 #elif USE(APPLE_INTERNAL_SDK)
 #include <os/thread_self_restrict.h> 
@@ -39,7 +39,7 @@
 {
 #if CPU(ARM64E)
     return true;
-#elif HAVE(PTHREAD_JIT_PERMISSIONS_API) 
+#elif USE(PTHREAD_JIT_PERMISSIONS_API) 
     return !!pthread_jit_write_protect_supported_np();
 #elif USE(APPLE_INTERNAL_SDK)
     return !!os_thread_self_restrict_rwx_is_supported();
@@ -52,7 +52,7 @@
 {
     ASSERT(useFastJITPermissions());
 
-#if HAVE(PTHREAD_JIT_PERMISSIONS_API) 
+#if USE(PTHREAD_JIT_PERMISSIONS_API) 
     pthread_jit_write_protect_np(false);
 #elif USE(APPLE_INTERNAL_SDK)
     os_thread_self_restrict_rwx_to_rw();
@@ -67,7 +67,7 @@
 {
     ASSERT(useFastJITPermissions());
 
-#if HAVE(PTHREAD_JIT_PERMISSIONS_API) 
+#if USE(PTHREAD_JIT_PERMISSIONS_API) 
     pthread_jit_write_protect_np(true);
 #elif USE(APPLE_INTERNAL_SDK)
     os_thread_self_restrict_rwx_to_rx();

Modified: trunk/Source/WTF/ChangeLog (270051 => 270052)


--- trunk/Source/WTF/ChangeLog	2020-11-19 22:11:45 UTC (rev 270051)
+++ trunk/Source/WTF/ChangeLog	2020-11-19 23:08:56 UTC (rev 270052)
@@ -1,3 +1,14 @@
+2020-11-19  Saam Barati  <[email protected]>
+
+        Use os_thread_self_restrict_rwx_is_supported instead of pthread_jit_write_protect_supported_np on Apple Internal SDK builds
+        https://bugs.webkit.org/show_bug.cgi?id=219099
+        <rdar://problem/71547048>
+
+        Reviewed by Mark Lam.
+
+        * wtf/PlatformHave.h:
+        * wtf/PlatformUse.h:
+
 2020-11-18  Yousuke Kimoto  <[email protected]>
 
         [WTF] Fix a condition to check if statvfs() succeeds in getVolumeFreeSpace()

Modified: trunk/Source/WTF/wtf/PlatformHave.h (270051 => 270052)


--- trunk/Source/WTF/wtf/PlatformHave.h	2020-11-19 22:11:45 UTC (rev 270051)
+++ trunk/Source/WTF/wtf/PlatformHave.h	2020-11-19 23:08:56 UTC (rev 270052)
@@ -700,7 +700,6 @@
 #define HAVE_HSTS_STORAGE 1
 #define HAVE_LSDATABASECONTEXT 1
 #define HAVE_PRECONNECT_PING 1
-#define HAVE_PTHREAD_JIT_PERMISSIONS_API 1
 #define HAVE_WEBP 1
 #endif
 

Modified: trunk/Source/WTF/wtf/PlatformUse.h (270051 => 270052)


--- trunk/Source/WTF/wtf/PlatformUse.h	2020-11-19 22:11:45 UTC (rev 270051)
+++ trunk/Source/WTF/wtf/PlatformUse.h	2020-11-19 23:08:56 UTC (rev 270052)
@@ -316,3 +316,13 @@
 #if CPU(ARM64) && CPU(ADDRESS64)
 #define USE_JUMP_ISLANDS 1
 #endif
+
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) \
+    || (PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
+#if USE(APPLE_INTERNAL_SDK)
+/* Always use the macro on internal builds */
+#define USE_PTHREAD_JIT_PERMISSIONS_API 0 
+#else
+#define USE_PTHREAD_JIT_PERMISSIONS_API 1
+#endif
+#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to