Mono: Ensure tasklets are removed in netcore build (#40324)
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Tue, 4 Aug 2020 20:25:58 +0000 (22:25 +0200)
committerGitHub <noreply@github.com>
Tue, 4 Aug 2020 20:25:58 +0000 (22:25 +0200)
Tasklets were an old mono-specific extension for continuations that is no longer relevant.

src/mono/mono/metadata/object-offsets.h
src/mono/mono/mini/exceptions-amd64.c
src/mono/mono/mini/exceptions-x86.c
src/mono/mono/mini/mini-runtime.c
src/mono/mono/mini/tasklets.c
src/mono/mono/mini/tasklets.h

index bf2bf0e25272dc5af0e842979eda7a3ada556873..f11bbf58e82bfbe3515eb7da84d749bcee47a731 100644 (file)
@@ -167,11 +167,13 @@ DECL_OFFSET(MonoJitTlsData, stack_restore_ctx)
 DECL_OFFSET(MonoGSharedVtMethodRuntimeInfo, locals_size)
 DECL_OFFSET(MonoGSharedVtMethodRuntimeInfo, entries) //XXX more to fix here
 
+#if !defined(ENABLE_NETCORE)
 DECL_OFFSET(MonoContinuation, stack_used_size)
 DECL_OFFSET(MonoContinuation, saved_stack)
 DECL_OFFSET(MonoContinuation, return_sp)
 DECL_OFFSET(MonoContinuation, lmf)
 DECL_OFFSET(MonoContinuation, return_ip)
+#endif
 
 DECL_OFFSET(MonoDelegateTrampInfo, method)
 DECL_OFFSET(MonoDelegateTrampInfo, invoke_impl)
index f795a06b1eca832cf2474336f663c4beaa496e2b..8be488d1309e944172c1b1c6e825219ab56a99b2 100644 (file)
@@ -1905,7 +1905,7 @@ void mono_arch_code_chunk_destroy (void *chunk)
 }
 #endif /* MONO_ARCH_HAVE_UNWIND_TABLE */
 
-#if MONO_SUPPORT_TASKLETS && !defined(DISABLE_JIT)
+#if MONO_SUPPORT_TASKLETS && !defined(DISABLE_JIT) && !defined(ENABLE_NETCORE)
 MonoContinuationRestore
 mono_tasklets_arch_restore (void)
 {
@@ -1956,7 +1956,7 @@ mono_tasklets_arch_restore (void)
        saved = start;
        return (MonoContinuationRestore)saved;
 }
-#endif /* MONO_SUPPORT_TASKLETS && !defined(DISABLE_JIT) */
+#endif /* MONO_SUPPORT_TASKLETS && !defined(DISABLE_JIT) && !defined(ENABLE_NETCORE) */
 
 /*
  * mono_arch_setup_resume_sighandler_ctx:
@@ -1975,14 +1975,14 @@ mono_arch_setup_resume_sighandler_ctx (MonoContext *ctx, gpointer func)
        MONO_CONTEXT_SET_IP (ctx, func);
 }
 
-#if !MONO_SUPPORT_TASKLETS || defined(DISABLE_JIT)
+#if (!MONO_SUPPORT_TASKLETS || defined(DISABLE_JIT)) && !defined(ENABLE_NETCORE)
 MonoContinuationRestore
 mono_tasklets_arch_restore (void)
 {
        g_assert_not_reached ();
        return NULL;
 }
-#endif /* !MONO_SUPPORT_TASKLETS || defined(DISABLE_JIT) */
+#endif /* (!MONO_SUPPORT_TASKLETS || defined(DISABLE_JIT)) && !defined(ENABLE_NETCORE) */
 
 void
 mono_arch_undo_ip_adjustment (MonoContext *ctx)
index a0f79a71426caab21a92b1d5a5ae74e174be6753..ef9927577e6a2518aaef72594e759b57bd49990a 100644 (file)
@@ -1175,7 +1175,7 @@ mono_arch_handle_altstack_exception (void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *s
 #endif
 }
 
-#if MONO_SUPPORT_TASKLETS
+#if MONO_SUPPORT_TASKLETS && !defined(ENABLE_NETCORE)
 MonoContinuationRestore
 mono_tasklets_arch_restore (void)
 {
index 3dc54a5e2230eccf1fc2e61eb70a5e07db53a3c9..caf65d40e88a6e2f09c8c4003a378a4459de3ef0 100644 (file)
@@ -4596,7 +4596,9 @@ mini_init (const char *filename, const char *runtime_version)
        mono_simd_intrinsics_init ();
 #endif
 
+#ifndef ENABLE_NETCORE
        mono_tasklets_init ();
+#endif
 
        register_trampolines (domain);
 
index 361b3f02353fa11fc5c9413099c61175333ef9c4..402a3a981c236551d6d8379458b6007135a69c13 100644 (file)
@@ -12,6 +12,7 @@
 #include "mono/metadata/loader-internals.h"
 #include "mono/utils/mono-tls-inline.h"
 
+#if !defined(ENABLE_NETCORE)
 #if defined(MONO_SUPPORT_TASKLETS)
 
 #include "mono/metadata/loader-internals.h"
@@ -213,5 +214,7 @@ mono_tasklets_init(void)
        mono_add_internal_call_internal ("Mono.Tasklets.Continuation::restore", continuation_restore);
 
 }
-#endif
+#endif /* MONO_SUPPORT_TASKLETS */
+
+#endif /* ENABLE_NETCORE */
 
index fc6f0b8178a9c6144c778aaa22c9297478b7bf14..dd8750f3f2f24cd9561fa52616ce5fb953518422 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "mini.h"
 
+#if !defined(ENABLE_NETCORE)
 typedef struct {
        MonoLMF *lmf;
        gpointer top_sp;
@@ -31,5 +32,7 @@ void  mono_tasklets_cleanup (void);
 
 MonoContinuationRestore mono_tasklets_arch_restore (void);
 
+#endif /* ENABLE_NETCORE */
+
 #endif /* __MONO_TASKLETS_H__ */