+
+Tue Mar 18 11:50:14 CET 2008 Paolo Molaro <lupus@ximian.com>
+
+ * mini.h, mini-trampolines.c, tramp-*.c: change the signature of
+ mono_arch_patch_callsite() to include the start of the managed method
+ to be able to perform bound checks.
+
2008-03-17 Mark Probst <mark.probst@gmail.com>
* mini.c: Generic sharing for the isinst instruction.
mono_jit_info_table_find (mono_domain_get (), mono_get_addr_from_ftnptr (addr));
if (mono_method_same_domain (ji, target_ji))
- mono_arch_patch_callsite (code, addr);
+ mono_arch_patch_callsite (ji->code_start, code, addr);
}
}
void mono_arch_save_unwind_info (MonoCompile *cfg) MONO_INTERNAL;
void mono_arch_register_lowlevel_calls (void) MONO_INTERNAL;
gpointer mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr) MONO_INTERNAL;
-void mono_arch_patch_callsite (guint8 *code, guint8 *addr) MONO_INTERNAL;
+void mono_arch_patch_callsite (guint8 *method_start, guint8 *code, guint8 *addr) MONO_INTERNAL;
void mono_arch_patch_plt_entry (guint8 *code, guint8 *addr) MONO_INTERNAL;
void mono_arch_nullify_class_init_trampoline(guint8 *code, gssize *regs) MONO_INTERNAL;
void mono_arch_nullify_plt_entry (guint8 *code) MONO_INTERNAL;
}
void
-mono_arch_patch_callsite (guint8 *code, guint8 *addr)
+mono_arch_patch_callsite (guint8 *method_start, guint8 *code, guint8 *addr)
{
unsigned long *p = (unsigned int *)(code-12);
* points to the pc right after the call.
*/
void
-mono_arch_patch_callsite (guint8 *orig_code, guint8 *addr)
+mono_arch_patch_callsite (guint8 *method_start, guint8 *orig_code, guint8 *addr)
{
guint8 *code;
guint8 buf [16];
}
void
-mono_arch_patch_callsite (guint8 *code_ptr, guint8 *addr)
+mono_arch_patch_callsite (guint8 *method_start, guint8 *code_ptr, guint8 *addr)
{
guint32 *code = (guint32*)code_ptr;
}
void
-mono_arch_patch_callsite (guint8 *p, guint8 *addr)
+mono_arch_patch_callsite (guint8 *method_start, guint8 *p, guint8 *addr)
{
guint32 *code = (void *)p;
/* Search for and patch the calling sequence
}
void
-mono_arch_patch_callsite (guint8 *code, guint8 *addr)
+mono_arch_patch_callsite (guint8 *method_start, guint8 *code, guint8 *addr)
{
guint8 *callsite_begin;
guint64 *callsite = (guint64*)(gpointer)(code - 16);
}
void
-mono_arch_patch_callsite (guint8 *code_ptr, guint8 *addr)
+mono_arch_patch_callsite (guint8 *method_start, guint8 *code_ptr, guint8 *addr)
{
guint32 *code = (guint32*)code_ptr;
/* This is the 'blrl' instruction */
/*------------------------------------------------------------------*/
void
-mono_arch_patch_callsite (guint8 *orig_code, guint8 *addr)
+mono_arch_patch_callsite (guint8 *method_start, guint8 *orig_code, guint8 *addr)
{
gint32 displace;
unsigned short opcode;
/*------------------------------------------------------------------*/
void
-mono_arch_patch_callsite (guint8 *orig_code, guint8 *addr)
+mono_arch_patch_callsite (guint8 *method_start, guint8 *orig_code, guint8 *addr)
{
gint32 displace;
unsigned short opcode;
}
void
-mono_arch_patch_callsite (guint8 *code, guint8 *addr)
+mono_arch_patch_callsite (guint8 *method_start, guint8 *code, guint8 *addr)
{
if (sparc_inst_op (*(guint32*)code) == 0x1) {
sparc_call_simple (code, (guint8*)addr - (guint8*)code);
}
void
-mono_arch_patch_callsite (guint8 *orig_code, guint8 *addr)
+mono_arch_patch_callsite (guint8 *method_start, guint8 *orig_code, guint8 *addr)
{
guint8 *code;
guint8 buf [8];