From e14d92437ed0d4e7b5bc7d3478c738787246c744 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Wed, 7 Nov 2018 13:41:07 -0500 Subject: [PATCH] [jit] Move a few DISABLE_JIT stubs to arch-stubs.c. (#10991) --- mono/mini/arch-stubs.c | 45 ++++++++++++++++++++++++++++++++ mono/mini/exceptions-amd64.c | 61 ++++++++------------------------------------ mono/mini/exceptions-arm.c | 17 ++++++++++++ mono/mini/exceptions-arm64.c | 46 ++------------------------------- mono/mini/exceptions-wasm.c | 4 +++ 5 files changed, 78 insertions(+), 95 deletions(-) diff --git a/mono/mini/arch-stubs.c b/mono/mini/arch-stubs.c index fdf5d37edef..6ccb36b554a 100644 --- a/mono/mini/arch-stubs.c +++ b/mono/mini/arch-stubs.c @@ -97,3 +97,48 @@ mono_arch_exceptions_init (void) } #endif + +#ifdef DISABLE_JIT +gpointer +mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) +{ + g_assert_not_reached (); + return NULL; +} + +gpointer +mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) +{ + g_assert_not_reached (); + return NULL; +} + +gpointer +mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot) +{ + g_assert_not_reached (); + return NULL; +} + +gpointer +mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot) +{ + g_assert_not_reached (); + return NULL; +} + +gpointer +mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) +{ + g_assert_not_reached (); + return NULL; +} + +gpointer +mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) +{ + g_assert_not_reached (); + return NULL; +} + +#endif /* DISABLE_JIT */ diff --git a/mono/mini/exceptions-amd64.c b/mono/mini/exceptions-amd64.c index 353b90a82f8..5280574c15a 100644 --- a/mono/mini/exceptions-amd64.c +++ b/mono/mini/exceptions-amd64.c @@ -934,6 +934,16 @@ mono_amd64_get_exception_trampolines (gboolean aot) return tramps; } + +#else + +GSList* +mono_amd64_get_exception_trampolines (gboolean aot) +{ + g_assert_not_reached (); + return NULL; +} + #endif /* !DISABLE_JIT */ void @@ -1933,57 +1943,6 @@ mono_arch_setup_resume_sighandler_ctx (MonoContext *ctx, gpointer func) MONO_CONTEXT_SET_IP (ctx, func); } -#ifdef DISABLE_JIT -gpointer -mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) -{ - g_assert_not_reached (); - return NULL; -} - -gpointer -mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) -{ - g_assert_not_reached (); - return NULL; -} - -gpointer -mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot) -{ - g_assert_not_reached (); - return NULL; -} - -gpointer -mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot) -{ - g_assert_not_reached (); - return NULL; -} - -gpointer -mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) -{ - g_assert_not_reached (); - return NULL; -} - -gpointer -mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) -{ - g_assert_not_reached (); - return NULL; -} - -GSList* -mono_amd64_get_exception_trampolines (gboolean aot) -{ - g_assert_not_reached (); - return NULL; -} -#endif /* DISABLE_JIT */ - #if !MONO_SUPPORT_TASKLETS || defined(DISABLE_JIT) MonoContinuationRestore mono_tasklets_arch_restore (void) diff --git a/mono/mini/exceptions-arm.c b/mono/mini/exceptions-arm.c index b7638ca4e0b..c0b709f54c4 100644 --- a/mono/mini/exceptions-arm.c +++ b/mono/mini/exceptions-arm.c @@ -41,6 +41,8 @@ #include "mono/utils/mono-sigcontext.h" #include "mono/utils/mono-compiler.h" +#ifndef DISABLE_JIT + /* * arch_get_restore_context: * @@ -143,6 +145,8 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) return start; } +#endif /* DISABLE_JIT */ + void mono_arm_throw_exception (MonoObject *exc, host_mgreg_t pc, host_mgreg_t sp, host_mgreg_t *int_regs, gdouble *fp_regs, gboolean preserve_ips) { @@ -204,6 +208,8 @@ mono_arm_resume_unwind (guint32 dummy1, host_mgreg_t pc, host_mgreg_t sp, host_m mono_resume_unwind (&ctx); } +#ifndef DISABLE_JIT + /** * get_throw_trampoline: * @@ -396,6 +402,17 @@ mono_arm_get_exception_trampolines (gboolean aot) return tramps; } +#else + +GSList* +mono_arm_get_exception_trampolines (gboolean aot) +{ + g_assert_not_reached (); + return NULL; +} + +#endif + void mono_arch_exceptions_init (void) { diff --git a/mono/mini/exceptions-arm64.c b/mono/mini/exceptions-arm64.c index 03a4d9fd187..3c116e675ca 100644 --- a/mono/mini/exceptions-arm64.c +++ b/mono/mini/exceptions-arm64.c @@ -305,49 +305,7 @@ mono_arm_get_exception_trampolines (gboolean aot) return tramps; } -#else /* DISABLE_JIT */ - -gpointer -mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) -{ - g_assert_not_reached (); - return NULL; -} - -gpointer -mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) -{ - g_assert_not_reached (); - return NULL; -} - -gpointer -mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot) -{ - g_assert_not_reached (); - return NULL; -} - -gpointer -mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot) -{ - g_assert_not_reached (); - return NULL; -} - -gpointer -mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) -{ - g_assert_not_reached (); - return NULL; -} - -gpointer -mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) -{ - g_assert_not_reached (); - return NULL; -} +#else GSList* mono_arm_get_exception_trampolines (gboolean aot) @@ -356,7 +314,7 @@ mono_arm_get_exception_trampolines (gboolean aot) return NULL; } -#endif /* !DISABLE_JIT */ +#endif /* DISABLE_JIT */ void mono_arch_exceptions_init (void) diff --git a/mono/mini/exceptions-wasm.c b/mono/mini/exceptions-wasm.c index 605474cb5c6..1665d5edcb4 100644 --- a/mono/mini/exceptions-wasm.c +++ b/mono/mini/exceptions-wasm.c @@ -55,6 +55,8 @@ mono_arch_unwind_frame (MonoDomain *domain, MonoJitTlsData *jit_tls, return FALSE; } +#ifndef DISABLE_JIT + gpointer mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) { @@ -102,6 +104,8 @@ mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot) return (gpointer)wasm_throw_exception; } +#endif + void mono_arch_undo_ip_adjustment (MonoContext *ctx) { -- 2.11.4.GIT