[Mono-dev] [PATCH] ARM support for IMT

Paolo Molaro lupus at ximian.com
Wed Oct 24 11:45:09 EDT 2007


On 10/23/07 Rodrigo Kumpera wrote:
> Index: mini/mini-arm.c
> ===================================================================
> --- mini/mini-arm.c	(revision 87303)
> +++ mini/mini-arm.c	(working copy)
[...]
> @@ -2422,8 +2457,19 @@
>  		case OP_CALL_MEMBASE:
>  			g_assert (arm_is_imm12 (ins->inst_offset));
>  			g_assert (ins->sreg1 != ARMREG_LR);
> -			ARM_MOV_REG_REG (code, ARMREG_LR, ARMREG_PC);
> -			ARM_LDR_IMM (code, ARMREG_PC, ins->sreg1, ins->inst_offset);
> +			call = (MonoCallInst*)ins;
> +			if (call->emit_imt_code) {

We could remove this flag as you can just check that call->method is an
interface method.

> +				ARM_ADD_REG_IMM8 (code, ARMREG_LR, ARMREG_PC, 4);
> +				ARM_LDR_IMM (code, ARMREG_PC, ins->sreg1, ins->inst_offset);
> +				*((gpointer*)code) = (gpointer)call->method;
> +				code += 4;
> +#if DEBUG_IMT
> +				printf ("Emmited IMT value for method %s value %p\n", call->method->name, call->method);
> +#endif

Remove this from the commit.

> +MonoObject* mono_arch_find_this_argument (gpointer *regs, MonoMethod *method)

The return type goes into its own line.

> +#define ENABLE_WRONG_METHOD_CHECK 0
> +#define BASE_SIZE (8)
> +
> +static void
> +arm_emit_value_and_patch_ldr (arminstr_t **code, arminstr_t *target, guint32 value)
> +{
> +	guint32 delta = ((guint32)*code) - ((guint32)target);
> +	delta -= 8;
> +	g_assert (delta >= 0 && delta <= 0xFFF);
> +	*target = *target | delta;
> +	**code = value;
> +	*code = *code + 1;

The pattern we use everywhere is to return the new code pointer from
the function, please change this function and its caller to follow
that same pattern.

> +gpointer mono_arch_build_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckItem **imt_entries, int count)

Return type in its own line.

Please apply the suggested changes and commit.
Thanks!

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list