[Pkg-mono-svn-commits] [SCM] mono branch, master, updated. debian/2.4.4.svn151842-1-5-gf924035

Jo Shields directhex at apebox.org
Mon Mar 29 18:39:15 UTC 2010


The following commit has been merged in the master branch:
commit 92f4476c012b5d72362085d3df5b991181ace4fe
Author: Jo Shields <directhex at apebox.org>
Date:   Mon Mar 29 16:43:46 2010 +0100

    Various ARM JIT fixes from asac

diff --git a/debian/changelog b/debian/changelog
index fd4b959..1eac445 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,8 @@ mono (2.4.4~svn151842-2) UNRELEASED; urgency=low
   * debian/patches/mono-arm-thumb2-ftbfs.dpatch:
     + Use GCC atomic built-ins to prevent FTBFS on ARM with Thumb2 (Thanks to
       Alexander Sack <asac at ubuntu.com>)
+  * debian/patches/mono-thumb2-jit-blx.dpatch:
+    + Assorted JIT fixes for ARM (Thanks to Alexander Sack <asac at ubuntu.com>)
 
  -- Mirco Bauer <meebey at debian.org>  Sat, 20 Feb 2010 12:13:59 +0100
 
diff --git a/debian/patches/00list b/debian/patches/00list
index d2a3cfe..57ed8af 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -24,3 +24,4 @@ build_genxs_2.0
 dont_assert_on_empty_DGC_field_r146984
 skip_docs_build
 mono-arm-thumb2-ftbfs
+mono-thumb2-jit-blx
diff --git a/debian/patches/mono-thumb2-jit-blx.dpatch b/debian/patches/mono-thumb2-jit-blx.dpatch
new file mode 100644
index 0000000..e488d61
--- /dev/null
+++ b/debian/patches/mono-thumb2-jit-blx.dpatch
@@ -0,0 +1,155 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## mono-thumb2-jit-blx.dpatch by  <asac at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad mono-2.4.4~svn151842~/mono/mini/mini-arm.c mono-2.4.4~svn151842/mono/mini/mini-arm.c
+--- mono-2.4.4~svn151842~/mono/mini/mini-arm.c	2009-11-30 17:27:39.000000000 +0100
++++ mono-2.4.4~svn151842/mono/mini/mini-arm.c	2010-02-22 15:51:11.000000000 +0100
+@@ -2273,6 +2273,12 @@
+ 	return code;
+ }
+ 
++gboolean
++mono_arm_thumb_supported (void)
++{
++	return thumb_supported;
++}
++
+ /*
+  * emit_load_volatile_arguments:
+  *
+diff -urNad mono-2.4.4~svn151842~/mono/mini/mini-arm.h mono-2.4.4~svn151842/mono/mini/mini-arm.h
+--- mono-2.4.4~svn151842~/mono/mini/mini-arm.h	2009-04-09 22:52:11.000000000 +0200
++++ mono-2.4.4~svn151842/mono/mini/mini-arm.h	2010-02-22 15:51:11.000000000 +0100
+@@ -181,5 +181,11 @@
+ void
+ mono_arm_throw_exception (MonoObject *exc, unsigned long eip, unsigned long esp, gulong *int_regs, gdouble *fp_regs);
+ 
++void
++mono_arm_throw_exception_by_token (guint32 type_token, unsigned long eip, unsigned long esp, gulong *int_regs, gdouble *fp_regs);
++
++gboolean
++mono_arm_thumb_supported (void);
++
+ #endif /* __MONO_MINI_ARM_H__ */
+ 
+diff -urNad mono-2.4.4~svn151842~/mono/mini/tramp-arm.c mono-2.4.4~svn151842/mono/mini/tramp-arm.c
+--- mono-2.4.4~svn151842~/mono/mini/tramp-arm.c	2008-12-12 20:49:41.000000000 +0100
++++ mono-2.4.4~svn151842/mono/mini/tramp-arm.c	2010-02-22 15:51:11.000000000 +0100
+@@ -40,6 +40,16 @@
+ 	return 0;
+ }
+ 
++static inline guint8*
++emit_bx (guint8* code, int reg)
++{
++	if (mono_arm_thumb_supported ())
++		ARM_BX (code, reg);
++	else
++		ARM_MOV_REG_REG (code, ARMREG_PC, reg);
++	return code;
++}
++
+ /*
+  * mono_arch_get_unbox_trampoline:
+  * @gsctx: the generic sharing context
+@@ -66,7 +76,7 @@
+ 
+ 	ARM_LDR_IMM (code, ARMREG_IP, ARMREG_PC, 4);
+ 	ARM_ADD_REG_IMM8 (code, this_pos, this_pos, sizeof (MonoObject));
+-	ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_IP);
++	code = emit_bx (code, ARMREG_IP);
+ 	*(guint32*)code = (guint32)addr;
+ 	code += 4;
+ 	mono_arch_flush_icache (start, code - start);
+@@ -210,7 +220,7 @@
+ 		code += 4;
+ 	}
+ 	ARM_MOV_REG_REG (code, ARMREG_LR, ARMREG_PC);
+-	ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_R0);
++	code = emit_bx (code, ARMREG_R0);
+ 
+ 	/* we build the MonoLMF structure on the stack - see mini-arm.h
+ 	 * The pointer to the struct is put in r1.
+@@ -269,7 +279,7 @@
+ 	}
+ 
+ 	ARM_MOV_REG_REG (code, ARMREG_LR, ARMREG_PC);
+-	ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_IP);
++	code = emit_bx (code, ARMREG_IP);
+ 	
+ 	/* OK, code address is now on r0. Move it to the place on the stack
+ 	 * where IP was saved (it is now no more useful to us and it can be
+@@ -297,7 +307,7 @@
+ 		code += 4;
+ 	}
+ 	ARM_MOV_REG_REG (code, ARMREG_LR, ARMREG_PC);
+-	ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_IP);
++	code = emit_bx (code, ARMREG_IP);
+ 
+ 	/*
+ 	 * Now we restore the MonoLMF (see emit_epilogue in mini-arm.c)
+@@ -326,9 +336,9 @@
+ 	/* do we need to set sp? */
+ 	ARM_ADD_REG_IMM8 (code, ARMREG_SP, ARMREG_SP, (14 * 4));
+ 	if ((tramp_type == MONO_TRAMPOLINE_CLASS_INIT) || (tramp_type == MONO_TRAMPOLINE_GENERIC_CLASS_INIT) || (tramp_type == MONO_TRAMPOLINE_RGCTX_LAZY_FETCH))
+-		ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_LR);
++		code = emit_bx (code, ARMREG_LR);
+ 	else
+-		ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_IP);
++		code = emit_bx (code, ARMREG_IP);
+ 
+ 	constants = (gpointer*)code;
+ 	constants [0] = mono_get_lmf_addr;
+@@ -367,7 +377,7 @@
+ 
+ 	code = buf = mono_global_codeman_reserve (16);
+ 
+-	ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_LR);
++	code = emit_bx (code, ARMREG_LR);
+ 
+ 	mono_arch_flush_icache (buf, code - buf);
+ 
+@@ -417,7 +427,7 @@
+ 	} else {
+ 		ARM_LDR_IMM (code, ARMREG_R1, ARMREG_PC, 8); /* temp reg */
+ 		ARM_MOV_REG_REG (code, ARMREG_LR, ARMREG_PC);
+-		ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_R1);
++		code = emit_bx (code, ARMREG_R1);
+ 
+ 		constants = (gpointer*)code;
+ 		constants [0] = arg1;
+@@ -522,7 +532,7 @@
+ 	ARM_B_COND (code, ARMCOND_EQ, 0);
+ 	/* otherwise return, result is in R1 */
+ 	ARM_MOV_REG_REG (code, ARMREG_R0, ARMREG_R1);
+-	ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_LR);
++	code = emit_bx (code, ARMREG_LR);
+ 
+ 	g_assert (njumps <= depth + 2);
+ 	for (i = 0; i < njumps; ++i)
+@@ -546,8 +556,8 @@
+ 
+ 		/* Jump to the actual trampoline */
+ 		ARM_LDR_IMM (code, ARMREG_R1, ARMREG_PC, 0); /* temp reg */
+-		ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_R1);
+-		*(guint32*)code = tramp;
++		code = emit_bx (code, ARMREG_R1);
++		*(gpointer*)code = tramp;
+ 		code += 4;
+ 	}
+ 
+@@ -600,8 +610,8 @@
+ 
+ 	/* Jump to the actual trampoline */
+ 	ARM_LDR_IMM (code, ARMREG_R1, ARMREG_PC, 0); /* temp reg */
+-	ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_R1);
+-	*(guint32*)code = tramp;
++	code = emit_bx (code, ARMREG_R1);
++	*(gpointer*)code = tramp;
+ 	code += 4;
+ 
+ 	mono_arch_flush_icache (buf, code - buf);

-- 
mono



More information about the Pkg-mono-svn-commits mailing list