Skip to content

Commit

Permalink
[mono] Revert Mac Catalyst arm64 JITing hack (dotnet#52249)
Browse files Browse the repository at this point in the history
JITing in Catalyst apps is not allowed on Apple Silicon.

Partly reverts a9f1207
  • Loading branch information
lambdageek authored May 4, 2021
1 parent 4c7ae35 commit 89a816f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 58 deletions.
2 changes: 0 additions & 2 deletions src/mono/mono/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ set(utils_common_sources
mono-logger.c
mono-logger-internals.h
mono-codeman.c
write-protect.c
write-protect.h
mono-counters.c
mono-compiler.h
mono-dl.c
Expand Down
15 changes: 4 additions & 11 deletions src/mono/mono/utils/mono-codeman.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ static void* mono_code_manager_heap;

#include <mono/utils/mono-os-mutex.h>
#include <mono/utils/mono-tls.h>
#include <mono/utils/write-protect.h>

static uintptr_t code_memory_used = 0;
static size_t dynamic_code_alloc_count;
Expand Down Expand Up @@ -670,10 +669,8 @@ mono_codeman_enable_write (void)
pthread_jit_write_protect_np (0);
}
#elif defined(HOST_MACCAT) && defined(__aarch64__)
int level = GPOINTER_TO_INT (mono_native_tls_get_value (write_level_tls_id));
level ++;
mono_native_tls_set_value (write_level_tls_id, GINT_TO_POINTER (level));
mono_jit_write_protect (0);
/* JITing in Catalyst apps is not allowed on Apple Silicon. */
g_assert_not_reached ();
#endif
}

Expand All @@ -696,11 +693,7 @@ mono_codeman_disable_write (void)
pthread_jit_write_protect_np (1);
}
#elif defined(HOST_MACCAT) && defined(__aarch64__)
int level = GPOINTER_TO_INT (mono_native_tls_get_value (write_level_tls_id));
g_assert (level);
level --;
mono_native_tls_set_value (write_level_tls_id, GINT_TO_POINTER (level));
if (level == 0)
mono_jit_write_protect (1);
/* JITing in Catalyst apps is not allowed on Apple Silicon. */
g_assert_not_reached ();
#endif
}
27 changes: 0 additions & 27 deletions src/mono/mono/utils/write-protect.c

This file was deleted.

18 changes: 0 additions & 18 deletions src/mono/mono/utils/write-protect.h

This file was deleted.

0 comments on commit 89a816f

Please sign in to comment.