[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-patches
Subject:    [Mono-patches] r47854 - trunk/mono/mono/mini
From:       "Zoltan Varga (vargaz AT freemail.hu)" <zoltan () mono-cvs ! ximian ! com>
Date:       2005-07-30 13:28:16
Message-ID: 20050730132816.4E6A09472C () mono-cvs ! ximian ! com
[Download RAW message or body]

Author: zoltan
Date: 2005-07-30 09:28:15 -0400 (Sat, 30 Jul 2005)
New Revision: 47854

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/exceptions-ia64.c
   trunk/mono/mono/mini/mini-ia64.c
Log:
2005-07-30  Zoltan Varga  <vargaz@freemail.hu>

	* mini-ia64.c exceptions-ia64.c: Ongoing IA64 work.


Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog	2005-07-30 09:10:23 UTC (rev 47853)
+++ trunk/mono/mono/mini/ChangeLog	2005-07-30 13:28:15 UTC (rev 47854)
@@ -1,3 +1,7 @@
+2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
+
+	* mini-ia64.c exceptions-ia64.c: Ongoing IA64 work.
+
 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
 
 	* TODO: Remove out-of-data todo stuff.

Modified: trunk/mono/mono/mini/exceptions-ia64.c
===================================================================
--- trunk/mono/mono/mini/exceptions-ia64.c	2005-07-30 09:10:23 UTC (rev 47853)
+++ trunk/mono/mono/mini/exceptions-ia64.c	2005-07-30 13:28:15 UTC (rev 47854)
@@ -131,15 +131,24 @@
 	/* Frame pointer */
 	ia64_mov (code, IA64_R15, in0 + 0);
 	/* Target ip */
-	ia64_mov_to_br (code, IA64_B0, in0 + 1);
+	ia64_mov_to_br (code, IA64_B6, in0 + 1);
 	/* Return address */
 	ia64_mov_from_ip (code, GP_SCRATCH_REG);
 	ia64_adds_imm (code, GP_SCRATCH_REG, 3 * 16, GP_SCRATCH_REG);
 
 	/* Call the filter */
-	ia64_br_cond_reg (code, IA64_B0);
+	ia64_br_call_reg (code, IA64_B0, IA64_B6);
 
 	/* R8 contains the result of the filter */
+	/* R9 contains the saved apr_pfs value */
+
+	/* The filter returns using br_cond_reg, so have to do another return */
+	ia64_mov_to_ar_i (code, IA64_PFS, IA64_R9);
+	ia64_mov_from_ip (code, GP_SCRATCH_REG);	
+	ia64_adds_imm (code, GP_SCRATCH_REG, 4 * 16, GP_SCRATCH_REG);
+	ia64_mov_to_br (code, IA64_B0, GP_SCRATCH_REG);
+	ia64_br_ret_reg (code, IA64_B0);
+
 	ia64_mov_to_ar_i (code, IA64_PFS, local0 + 0);
 	ia64_mov_ret_to_br (code, IA64_B0, local0 + 1);
 	ia64_br_ret_reg (code, IA64_B0);

Modified: trunk/mono/mono/mini/mini-ia64.c
===================================================================
--- trunk/mono/mono/mini/mini-ia64.c	2005-07-30 09:10:23 UTC (rev 47853)
+++ trunk/mono/mono/mini/mini-ia64.c	2005-07-30 13:28:15 UTC (rev 47854)
@@ -2859,24 +2859,28 @@
 			MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region);
 
 			/* 
-			 * We might be called by the exception handling code, in which case the
+			 * We might be called by call_filter, in which case the
 			 * the register stack is not set up correctly. So do it now.
+			 * Allocate a stack frame and set the fp register from the value 
+			 * passed in by the caller.
+			 * R15 is used since it is writable using libunwind.
+			 * R15 == 0 means we are called by OP_CALL_HANDLER or via resume_context ()
 			 */
-			ia64_alloc (code, GP_SCRATCH_REG2, cfg->arch.reg_local0 - cfg->arch.reg_in0, \
                cfg->arch.reg_out0 - cfg->arch.reg_local0, cfg->arch.n_out_regs, 0);
-
-			/* Set the fp register from the value passed in by the caller */
-			/* R15 is used since it is writable using libunwind */
-			/* R15 == 0 means we are called by OP_CALL_HANDLER or via resume_context () */
 			ia64_cmp_eq (code, 6, 7, IA64_R15, IA64_R0);
-			ia64_add_pred (code, 7, cfg->frame_reg, IA64_R0, IA64_R15);
-
+			/* Alloc is not predictable so we have to use a branch */
+			ia64_br_cond_pred (code, 6, 3);
+			ia64_alloc (code, cfg->arch.reg_saved_ar_pfs, cfg->arch.reg_local0 - \
cfg->arch.reg_in0, cfg->arch.reg_out0 - cfg->arch.reg_local0, cfg->arch.n_out_regs, \
0); +			ia64_mov (code, cfg->frame_reg, IA64_R15);
+			/* Save the return address */
 			ia64_adds_imm (code, GP_SCRATCH_REG2, spvar->inst_offset, cfg->frame_reg);
 			ia64_st8_hint (code, GP_SCRATCH_REG2, GP_SCRATCH_REG, 0);
 
 			break;
 		}
 		case CEE_ENDFINALLY: {
-			MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region);
+			MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region)
+			/* Return the saved arp_pfs value to call_filter */
+			ia64_mov (code, IA64_R9, cfg->arch.reg_saved_ar_pfs);
 			ia64_adds_imm (code, GP_SCRATCH_REG, spvar->inst_offset, cfg->frame_reg);
 			ia64_ld8_hint (code, GP_SCRATCH_REG, GP_SCRATCH_REG, 0);
 			ia64_mov_to_br (code, IA64_B6, GP_SCRATCH_REG);
@@ -2886,6 +2890,8 @@
 		case OP_ENDFILTER: {
 			/* FIXME: Return the value */
 			MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region);
+			/* Return the saved arp_pfs value to call_filter */
+			ia64_mov (code, IA64_R9, cfg->arch.reg_saved_ar_pfs);
 			ia64_adds_imm (code, GP_SCRATCH_REG, spvar->inst_offset, cfg->frame_reg);
 			ia64_ld8_hint (code, GP_SCRATCH_REG, GP_SCRATCH_REG, 0);
 			ia64_mov_to_br (code, IA64_B6, GP_SCRATCH_REG);

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic