Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
dylan-conway committed Oct 4, 2023
1 parent 0e4469f commit 2c4d07c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 3 additions & 6 deletions Source/JavaScriptCore/assembler/FastJITPermissions.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@

#include <wtf/Platform.h>

#if CPU(ARM64)
#if USE(INLINE_JIT_PERMISSIONS_API)
#include <ServiceExtensions/SEMemory_Private.h>
#elif USE(PTHREAD_JIT_PERMISSIONS_API)
#elif CPU(ARM64)
#include <pthread.h>
#elif USE(APPLE_INTERNAL_SDK)
#include <os/thread_self_restrict.h>
Expand All @@ -47,10 +46,9 @@ static ALWAYS_INLINE void threadSelfRestrictRWXToRW()
{
ASSERT(g_jscConfig.useFastJITPermissions);

#if CPU(ARM64)
#if USE(INLINE_JIT_PERMISSIONS_API)
se_memory_inline_jit_restrict_rwx_to_rw_with_witness();
#elif USE(PTHREAD_JIT_PERMISSIONS_API)
#elif CPU(ARM64)
pthread_jit_write_protect_np(false);
#elif USE(APPLE_INTERNAL_SDK)
os_thread_self_restrict_rwx_to_rw();
Expand All @@ -65,10 +63,9 @@ static ALWAYS_INLINE void threadSelfRestrictRWXToRX()
{
ASSERT(g_jscConfig.useFastJITPermissions);

#if CPU(ARM64)
#if USE(INLINE_JIT_PERMISSIONS_API)
se_memory_inline_jit_restrict_rwx_to_rx_with_witness();
#elif USE(PTHREAD_JIT_PERMISSIONS_API)
#elif CPU(ARM64)
pthread_jit_write_protect_np(true);
#elif USE(APPLE_INTERNAL_SDK)
os_thread_self_restrict_rwx_to_rx();
Expand Down
3 changes: 2 additions & 1 deletion Source/JavaScriptCore/jit/ExecutableAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,11 @@ static ALWAYS_INLINE JITReservation initializeJITPageReservation()
#if OS(DARWIN) && CPU(ARM64)
#if USE(INLINE_JIT_PERMISSIONS_API)
fastJITPermissionsIsSupported = !!se_memory_inline_jit_restrict_with_witness_supported();
#elif USE(PTHREAD_JIT_PERMISSIONS_API)
#elif CPU(ARM64)
fastJITPermissionsIsSupported = !!pthread_jit_write_protect_supported_np();
#elif USE(APPLE_INTERNAL_SDK)
fastJITPermissionsIsSupported = !!os_thread_self_restrict_rwx_is_supported();
#endif
#endif
g_jscConfig.useFastJITPermissions = fastJITPermissionsIsSupported;

Expand Down

0 comments on commit 2c4d07c

Please sign in to comment.