#include <mono/metadata/appdomain.h>
#include <mono/metadata/marshal.h>
#include <mono/metadata/tabledefs.h>
+#include <mono/metadata/profiler-private.h>
#include <mono/arch/arm/arm-codegen.h>
#include <mono/arch/arm/arm-vfp-codegen.h>
/* Flush instruction cache, since we've generated code */
mono_arch_flush_icache (buf, code - buf);
+ mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
/* Sanity check */
g_assert ((code - buf) <= buf_len);
code = emit_bx (code, ARMREG_LR);
mono_arch_flush_icache (buf, code - buf);
+ mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
if (info)
*info = mono_tramp_info_create ("nullified_class_init_trampoline", buf, code - buf, NULL, NULL);
/* Flush instruction cache, since we've generated code */
mono_arch_flush_icache (buf, code - buf);
+ mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE, mono_get_generic_trampoline_simple_name (tramp_type));
g_assert ((code - buf) <= size);
code += 4;
#endif
mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_UNBOX_TRAMPOLINE, m);
g_assert ((code - start) <= size);
/*g_print ("unbox trampoline at %d for %s:%s\n", this_pos, m->klass->name, m->name);
g_print ("unbox code is at %p for method at %p\n", start, addr);*/
g_assert ((code - start) <= buf_len);
mono_arch_flush_icache (start, code - start);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE, NULL);
return start;
}
}
mono_arch_flush_icache (buf, code - buf);
+ mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE, NULL);
g_assert (code - buf <= tramp_size);
code = emit_bx (code, ARMREG_R1);
mono_arch_flush_icache (buf, code - buf);
+ mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE, NULL);
g_assert (code - buf <= tramp_size);
}
mono_arch_flush_icache (buf, code - buf);
+ mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
g_assert (code - buf <= tramp_size);
code += 4;
mono_arch_flush_icache (buf, code - buf);
+ mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
g_assert (code - buf <= tramp_size);
if (info)
/* Should be a 'bl' */
if ((((ins >> 25) & 0x7) == 0x5) && (((ins >> 24) & 0x1) == 0x1)) {
#endif
- gint32 disp = ((gint32)ins) & 0xffffff;
+ gint32 disp = ((((gint32)ins) & 0xffffff) << 8) >> 8;
guint8 *target = code - 4 + 8 + (disp * 4);
return target;
gpointer
mono_arch_get_gsharedvt_arg_trampoline (MonoDomain *domain, gpointer arg, gpointer addr)
{
- guint8 *code, *start;
+ guint8 *code, *buf;
int buf_len;
gpointer *constants;
buf_len = 24;
- start = code = mono_domain_code_reserve (domain, buf_len);
+ buf = code = mono_domain_code_reserve (domain, buf_len);
/* Similar to the specialized trampoline code */
ARM_PUSH (code, (1 << ARMREG_R0) | (1 << ARMREG_R1) | (1 << ARMREG_R2) | (1 << ARMREG_R3) | (1 << ARMREG_LR));
constants [1] = addr;
code += 8;
- g_assert ((code - start) <= buf_len);
+ g_assert ((code - buf) <= buf_len);
- nacl_domain_code_validate (domain, &start, buf_len, &code);
- mono_arch_flush_icache (start, code - start);
+ nacl_domain_code_validate (domain, &buf, buf_len, &code);
+ mono_arch_flush_icache (buf, code - buf);
+ mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE, NULL);
- return start;
+ return buf;
}
#else