From 99a341e9573708574b6b7d942e7b335b9dc54b17 Mon Sep 17 00:00:00 2001 From: Geoff Norton Date: Mon, 13 Dec 2004 04:06:59 +0000 Subject: [PATCH] 2004-12-12 Geoff Norton * exceptions-ppc.c: Reorder code so gcc3.4 can compile it * mini-ppc.c: Unify mono_arch_patch_code with changes in r37636. svn path=/trunk/mono/; revision=37680 --- mono/mini/ChangeLog | 5 +++++ mono/mini/exceptions-ppc.c | 32 ++++++++++++++++++++------------ mono/mini/mini-ppc.c | 8 ++++---- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog index b5c9135dc48..54f5402497a 100644 --- a/mono/mini/ChangeLog +++ b/mono/mini/ChangeLog @@ -1,3 +1,8 @@ +2004-12-12 Geoff Norton + + * exceptions-ppc.c: Reorder code so gcc3.4 can compile it + * mini-ppc.c: Unify mono_arch_patch_code with changes in r37636. + 2004-12-12 Duncan Mak * mini-ppc.c (mono_arch_patch_code): Hopefully made this build diff --git a/mono/mini/exceptions-ppc.c b/mono/mini/exceptions-ppc.c index a5877811a3d..2d61d3b2a6c 100644 --- a/mono/mini/exceptions-ppc.c +++ b/mono/mini/exceptions-ppc.c @@ -326,18 +326,6 @@ throw_exception (MonoObject *exc, unsigned long eip, unsigned long esp, gulong * g_assert_not_reached (); } -gpointer -mono_arch_get_rethrow_exception (void) -{ - static guint8 start [132]; - static int inited = 0; - - if (inited) - return start; - mono_arch_get_throw_exception_generic (start, sizeof (start), FALSE, TRUE); - inited = 1; - return start; -} /** * arch_get_throw_exception_generic: * @@ -411,6 +399,26 @@ mono_arch_get_throw_exception_generic (guint8 *start, int size, int by_name, gbo } /** + * mono_arch_get_rethrow_exception: + * + * Returns a function pointer which can be used to rethrow + * exceptions. The returned function has the following + * signature: void (*func) (MonoException *exc); + * + */ +gpointer +mono_arch_get_rethrow_exception (void) +{ + static guint8 start [132]; + static int inited = 0; + + if (inited) + return start; + mono_arch_get_throw_exception_generic (start, sizeof (start), FALSE, TRUE); + inited = 1; + return start; +} +/** * arch_get_throw_exception: * * Returns a function pointer which can be used to raise diff --git a/mono/mini/mini-ppc.c b/mono/mini/mini-ppc.c index 52ebbe334e6..4c99fbfab9a 100644 --- a/mono/mini/mini-ppc.c +++ b/mono/mini/mini-ppc.c @@ -3343,15 +3343,15 @@ mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, Mono *((gpointer *)(ip)) = code + patch_info->data.offset; continue; case MONO_PATCH_INFO_SWITCH: { - gpointer *table = (gpointer *)patch_info->data.target; + gpointer *table = (gpointer *)patch_info->data.table->table; int i; // FIXME: inspect code to get the register - ppc_load (ip, ppc_r11, patch_info->data.target); + ppc_load (ip, ppc_r11, table); //*((gconstpointer *)(ip + 2)) = patch_info->data.target; - for (i = 0; i < patch_info->data.table->table_size; i++) { - table [i] = (int)patch_info->data.table [i] + code; + for (i = 0; i < patch_info->data.table->table_size; i++) { + table [i] = (int)patch_info->data.table->table [i] + code; } /* we put into the table the absolute address, no need for ppc_patch in this case */ continue; -- 2.11.4.GIT